Course lesson
Control Chrome From Script Kit using Apple Events
Chrome allows developers to execute JavaScript using Apple Events. When you enable this feature, you can write scripts that can access and modify the page you're currently browsing.
- Duration
- 3 min
- Access
- Free
- Transcript
- Retained from source evidence
Chrome allows developers to execute JavaScript using Apple Events. When you enable this feature, you can write scripts that can access and modify the page you're currently browsing.
You can get the site's contents, update storage, or do any action you would typically do through an extension of the Chrome Dev Tools.
let value = await applescript(`
tell application "Google Chrome" to tell window 1
get execute active tab javascript "
${js}
"
end tell
`)