【发布时间】:2021-10-11 06:42:45
【问题描述】:
此代码适用于 Safari(重新加载网页直到 HTML 包含特定文本)。 如何为 Chrome 修复它?
tell application "Safari"
set keyword to "Authentication mail"
repeat
set myWindow to current tab of first window
activate
do JavaScript "window.location.reload()" in myWindow
repeat while (do JavaScript "document.readyState" in document 1) is not "complete"
delay 0.5
end repeat
set pageContent to do JavaScript ("window.document.documentElement.outerHTML") in myWindow
if pageContent contains keyword then
beep beep beep
exit repeat
end if
delay 2 -- wait a bit before running again
end repeat end tell
【问题讨论】:
-
RE:“如何为 Chrome 修复它?” ——你试过什么?看看How to create a Minimal, Reproducible Example & How do I ask a good question?
-
????谢谢你,user3439894!
标签: javascript google-chrome applescript loading automator