2
我必須關閉並重新打開它,以便像每天100次這樣的開發目的,並且需要額外的時間來打開Web檢查器禁用緩存,清除緩存,開始調試JavaScript以及偶爾清除本地數據庫變得枯燥乏味。有沒有辦法在Web Inspector打開的情況下啓動Safari?
我必須關閉並重新打開它,以便像每天100次這樣的開發目的,並且需要額外的時間來打開Web檢查器禁用緩存,清除緩存,開始調試JavaScript以及偶爾清除本地數據庫變得枯燥乏味。有沒有辦法在Web Inspector打開的情況下啓動Safari?
這是我寫的啓動Safari Inspector的AppleScript。您可以將其導出爲可執行應用程序,並讓它坐在碼頭中,只需單擊一下即可進入Inspector。您也可以在Xcode的構建階段啓動它,以便在應用程序發送到模擬器時運行它。根據需要將「iPad Simulator」更改爲「iPone Simulator」或連接的設備。
tell application "Safari"
activate
delay 2
tell application "System Events"
tell process "Safari"
set frontmost to true
click menu item 2 of menu 1 of menu item "iPad Simulator" of menu 1 of menu bar item "Develop" of menu bar 1
end tell
end tell
end tell