Safari
提供: MacWiki
目次
Safari とは?[編集]
Apple 純正の Web ブラウザです。 KHTML を拡張した WebKit を使用しており、 動作が軽快なのが特徴です。
関連するソフトウェア[編集]
SafariStand[編集]
Tips[編集]
- 以下のコマンドを実行すると、デバッグ用のメニューが追加されます。
% defaults write com.apple.Safari IncludeDebugMenu -bool true
- 開いているページの保存とその復元
市川せうぞーさんの AppleScriptプログラム(Restore_URL.app)を使用する。スクリプトメニューやDockなどに登録すると利用しやすいでしょう。
Safariで開いているページの一時保存・リストア - 名もないテクノ手(2009-03-19)
- RSS形式ファイル(下記)を開いて表示できる
<?xml version="1.0" encoding="UTF-8"?> <rss version="2.0" ...
リーダー機能[編集]
Safari 5.x のリーダー機能は、条件を満たす web ページをリーディングに特化した体裁で表示させる(→Appleのサイト「 Safariの新機能」)。
その表示の体裁を自分流へ変更したい場合には、自己責任で下記のファイル(Reader.html)に変更を加える。ただしその格納ディレクトリや中身の形式はバージョン等に依存し一定していないようなので注意が必要。
- アプリケーション(Safari)の中を「パッケージの内容を表示」で表示させ,Resourcesフォルダ内のReader.html を編集する。(Safari 5.0.x)
- Reader.html ファイルは下記のディレクトリに格納されている(Safari 5.1.7 (MacOSX 10.7.4) で確認)(Safari 6.0.5 (MacOSX 10.8.5) で確認)
/System/Library/PrivateFrameworks/Safari.framework/Versions/A/Resources/Reader.html
- Reader.html ファイルは下記のディレクトリに格納されている(Safari 6.0 (MacOSX 10.7.4) で確認)(Safari 6.1 (MacOSX 10.8.5) で確認)
/System/Library/StagedFrameworks/Safari/Safari.framework/Versions/A/Resources/Reader.html
- 背景色を灰色表示させるなど、Reader.html 内の該当部分を書き換える例(あるバージョンの場合)
#article { ... .page { ... # background: white; # 背景色 background: #f0f0f0; width: 658px; # 表示幅 padding: 45px 70px; # 左右マージン
- Reader.html 内を書き換える例(あるバージョンの場合)
#article { # background: rgb(251, 251, 251); # 背景色 background: rgb(235, 235, 235); ... .page { # padding: 45px 53px; # 左右マージン padding: 25px 33px; ... # margin-right: 17px; # 左右マージン # margin-left: 17px; # 左右マージン margin-right: 7px; margin-left: 7px;
- Safari拡張機能による体裁の変更
AppleScript[編集]
- Webページのタイトル等を取得する
tell application "Safari" if not (exists front document) then return set theTitle to name of front document set theURL to URL of front document end tell -- set the clipboard to "* " & theTitle & return & theURL & return
- 複数のWebページのタイトル等を取得する
set theData to "" tell application "Safari" if not (exists front document) then return repeat with aTab in every tab of every window set theTitle to name of aTab set theURL to URL of aTab set theData to theData & "* " & theTitle & return & theURL & return end repeat end tell -- set the clipboard to theData
- Safariで開いているすべてのウインドウのタイトルとURLの一覧をクリップボードにコピーする - 名もないテクノ手(2009-09-17)
- Webページを開く
set theURL to "http://macwiki.sourceforge.jp/wiki/" tell application "Safari" make new document with properties {URL:theURL} -- open location theURL end tell
- 複数のWebページを開く(タブで開く)
set listURL to {"http://macwiki.sourceforge.jp/wiki/", "http://www.apple.com/jp/"} tell application "Safari" repeat with idx from 1 to (length of listURL) set aURL to item idx of listURL if idx is 1 then make new document with properties {URL:aURL} else tell window 1 make new tab with properties {URL:aURL} end tell end if end repeat end tell
- Safari のウィンドウを画面全体にする
tell application "Safari" activate if not (exists front document) then make document do JavaScript "moveTo(0,0);self.resizeTo(screen.availWidth,screen.availHeight)" in front document end tell
- その他、参考 URL
機能拡張[編集]
いくつかのご紹介
- SafariStand 各種のSIMBLプラグイン(機能拡張)を利用可能
- SafariGetures マウスジェスチャ用
Safari 5.x用[編集]
「機能拡張」( 拡張子は safariextz) を持っている.「開発」機能により有効化.
- HsRestoreSession.safariextz
- SafariRestore.safariextz
- autopagerize_for_safari.safariextz
- そのほかいろいろ