[13] [DFN[[[Safari]]]] は、 [[Apple]] の [[Webブラウザー]]です。

* 環境

[4] [[Safari]] は [[Mac OS]] で動作します。

[14] [[iOS]] 版は [DFN[[[Mobile Safari]]]] と呼ばれています。
[[アプリ内ブラウザー]]としても非常によく用いられています。

[15] 以前は [[Windows]] 版 [[Safari]] もありました。

[35] [[アプリ内ブラウザー]]機能として [[Safari View Controller]]
があります。

* 構成

[16] [[レンダリングエンジン]]として [[WebKit]] を使っています。

[17] [[JavaScript]] エンジンとして [[JavaScriptCore]] を使っています。

* デバッグ

- [24] 
[CITE@en[google/[[ios-webkit-debug-proxy]]: A DevTools proxy (Chrome Remote Debugging Protocol) for iOS devices (Safari Remote Web Inspector).]], [TIME[2021-05-19T06:24:10.000Z]] <https://github.com/google/ios-webkit-debug-proxy>

[25] 
[CODE[ios-webkit-debug-proxy]] を使うと [[iOS]] の [[Safari]] にアクセスできます。

[26] 
端末と [[USB]] ケーブルで接続し、 [[Apple]] のドライバーをインストールする必要があります。
[[Windows]] の標準の構成でも [[iPhone]] のストレージにはアクセスできますが、
それだけでは駄目で、 [[Apple]] 謹製のドライバーが必要です。

[27] 
ドライバーは [[iTunes]] をインストールすれば良いことになっていますが、
うまくいかないトラブルが多発しているようです。
自動でインストールされていないときは
[CODE[C:\Program Files\Common Files\Apple\Mobile Device Support\Drivers]]
ないし
[CODE[C:\Program Files (x68)\Common Files\Apple\Mobile Device Support\Drivers]]
にドライバーのファイルがあって、それを手動でインストールすればいいらしいのですが、
[CODE[Drivers]] という[[フォルダー]]が存在しないこともあります。
[[Apple]] が単独で配布はしていないようなので、
存在しない時どうしたらいいのかわかりません。
とにかくこれを用意してインストールする必要があります。

[28] 
ドライバーがインストールされており、端末とケーブルで接続された状態で、
[CODE[ios-webkit-debug-proxy]] ([CODE[ios-webkit-debug-proxy.exe]])
を実行すると、
サーバーが動きます。
サーバーが起動後すぐに異常終了するときは [[iTunes]]
をインストールし忘れていないか確認しましょう。
サーバー起動後[[コマンドプロンプト]]に端末が接続されたと表示されないといはドライバーがインストールされているか確認しましょう。

[29] 
昔は
[CODE[ios-webkit-debug-proxy]]
さえあれば [[Chrome]] の
[[DevTools]]
で開けたようですが、今は [[Safari]] の[[プロトコル]]が変更されたらしく、
開けないようです。

[30] 
また
[CODE[ios-webkit-debug-proxy]]
組み込みのデフォルトの
DevTools Web UI
があるのですが、それも[[プロトコル]]が変わったせいかうまく動きません。
UI は表示されるのですが、何も表示されず何もおきません。
どのページが開かれているかがわかるくらいです。


[34] 
不思議なことに通常の[[文書]]の Inspector はまったく動かないのに、
[[サービスワーカー]]の Network だけは表示されます。


- [31] [CITE@en[RemoteDebug/[[remotedebug-ios-webkit-adapter]]: Debug Safari and WebViews on iOS from tools like VS Code and Chrome DevTools]], [TIME[2021-05-19T06:30:49.000Z]] <https://github.com/RemoteDebug/remotedebug-ios-webkit-adapter>

[32] 
[CODE[ios-webkit-debug-proxy]]
の公式は回避手段として
[CODE[remotedebug-ios-webkit-adapter]]
を使うことを推奨していました。
[CODE[remotedebug-ios-webkit-adapter]]
は
[CODE[ios-webkit-debug-proxy]]
にプロトコル変換のラッパー的な [[node.js]] のプログラムを組み合わせたものです。

[33] 
ところが
[CODE[remotedebug-ios-webkit-adapter]]
の開発者は開発を中止してしまい、
かわりに有償プランの有る商用サービスを売り始めました。
そのため将来性に不安があります。
[TIME[2021-05-19T06:35:07.700Z]]


* メモ

- [1] ''Apple-Safariのスレ'' <http://pc3.2ch.net/test/read.cgi/hp/1041996555/>
- [2] ''Article 7968 at 03/01/10 14:15:58 From: tato@fureai.or.jp Subject: [js-ml:07968] Mac OSX 用ブラウザ  Safari  '' <http://ml.fureai.or.jp/~js-ml/20030110/7968.html>
- [3] ''●アップルルームについて(^^)×4'' <http://pc.2ch.net/test/read.cgi/mac/1048568719/>: Safari 流出騒動関連

- [5] ''iCapture - your site through the eyes of Apple's Safari browser'' <http://www.danvine.com/icapture/> : Safari で画面写真を撮影してくれます。混んでいると結果が出るのは数分後ですが、空いている時間帯ならすぐに出てくるみたいです。画面写真は一定期間不特定多数に公開された状態になるので注意・・・するほどのことでもないですが。

[6]
[CITE[スラッシュドット ジャパン | Safari が Acid2 Test を最初にクリア]] <http://slashdot.jp/mac/05/04/30/1122234.shtml?topic=74>
([[名無しさん]] [WEAK[2005-05-03 12:51:42 +00:00]])

[7]
[CITE[Safari HTML Reference: Introduction to Safari HTML Reference]] <http://developer.apple.com/documentation/AppleApplications/Reference/SafariHTMLRef/Introduction.html>
([[名無しさん]])

[8]
[CITE[Safari CSS Reference: Introduction to Safari CSS Reference]] <http://developer.apple.com/documentation/AppleApplications/Reference/SafariCSSRef/Introduction.html>
([[名無しさん]])

[9]
[CITE[Safari JavaScript Reference]] <http://developer.apple.com/documentation/AppleApplications/Reference/SafariJSRef/index.html#//apple_ref/doc/uid/TP40001482>
([[名無しさん]])

[10]
[CITE[Safari の JavaScript の不備: Days on the Moon]] <http://nanto.asablo.jp/blog/2006/01/13/209495>
([[名無しさん]])

[11]
[CITE[Historical User Agent strings]] ([CODE[2006-12-31 11:51:02 +09:00]] 版) <http://developer.apple.com/internet/safari/uamatrix.html>

[12] [[スクリプト]]で[[絶対配置]]の [[SVG]] [[要素]]を挿入したり移動させたりなんでしちゃってるんですが、
[[Windows Vista]] +  [[Safari]]  では一部が[[レンダリング]]されなかったり、移動後にも一部消し残しができたりします。
[[Chrome]] では起きないので、描画ライブラリー周りのバグでしょうか。
とりあえず、もっと上に別な[[要素]]を一瞬だけ[[レンダリング]]することで無理矢理再描画させると解決しました。

[18] [CITE@en[Introduction to “What’s New in Safari”]]
([TIME[2015-06-15 11:59:29 +09:00]] 版)
<https://developer.apple.com/library/safari/releasenotes/General/WhatsNewInSafari/Introduction/Introduction.html#//apple_ref/doc/uid/TP40014305-CH1-SW1>

[FIG(quote)[
[FIGCAPTION[
[19] [CITE@en[Safari 7.0]]
([TIME[2015-11-04 23:11:09 +09:00]] 版)
<https://developer.apple.com/library/safari/releasenotes/General/WhatsNewInSafari/Articles/Safari_7_0.html#//apple_ref/doc/uid/TP40014305-CH5-SW21>
]FIGCAPTION]

> Safari 7 makes use of this feature by giving each browser tab its own separate Web Content process for loading and rendering the page, and then napping this process when the tab is not immediately visible to the user.

]FIG]


[FIG(quote)[
[FIGCAPTION[
[20] [CITE@en[Introduction to “What’s New in Safari”]]
([TIME[2015-11-04 23:37:06 +09:00]] 版)
<https://developer.apple.com/library/safari/releasenotes/General/WhatsNewInSafari/Introduction/Introduction.html#//apple_ref/doc/uid/TP40014305-CH1-SW1>
]FIGCAPTION]

> This document summarizes changes to the Safari Web browser since version 4.0. 

]FIG]


[21] [CITE[Release Notes for Safari Technology Preview 2 | WebKit]]
([TIME[2016-04-17 12:43:01 +09:00]] 版)
<https://webkit.org/blog/6098/release-notes-for-safari-technology-preview-release-2/>

[22] [CITE[いにしえの Safari 4 beta の UI を懐かしむ - Qiita]]
( ([TIME[2016-08-10 12:12:20 +09:00]]))
<https://qiita.com/usagimaru/items/e709a80522c74e7aa9dc>

[23] [CITE[Release Notes for Safari Technology Preview 17 | WebKit]]
( ([TIME[2016-11-10 10:08:39 +09:00]]))
<https://webkit.org/blog/7071/release-notes-for-safari-technology-preview-17/>

[36] [CITE@ja[Apple「iOS/iPadOS/macOSのSafariは全て別物である」と主張して規制回避を図る | スラド アップル]], [TIME[2023-11-11T12:49:35.000Z]] <https://apple.srad.jp/story/23/11/07/1215255/>

