← Beamhook

Enable JavaScript from Apple Events

A one-time switch, per browser, so Beamhook can hook your keys to one specific tab.

Firefox is not supported. Beamhook's browser controls work with Safari, Chrome, Brave, Arc and Vivaldi.

Beamhook controls a native app like Spotify with a single AppleScript command. Browsers work differently: to see which tabs are playing — and to send play/pause to the one you picked — Beamhook asks the browser to run a small piece of JavaScript in each tab. macOS ships with that ability turned off.

Without it your media keys still reach the browser; macOS just decides for itself which tab hears them. That's what the notice in Beamhook is telling you. Turning it on takes about twenty seconds.

Safari

1. Reveal the developer settings

Choose Safari → Settings (⌘,), click Advanced, and tick Show features for web developers. This is what puts the Developer tab in the Settings toolbar.

Advanced
Show features for web developers
Safari → Settings → Advanced, at the bottom of the pane.

2. Tick the box

A Developer tab now sits at the right-hand end of the Settings toolbar, after Advanced. Open it and tick the third box under Automation: Allow JavaScript from Apple Events. That's it — no restart, no reload.

Developer
WebsitesProfilesExtensions AdvancedDeveloperFeature Flags
Automation:
Allow remote automation
Allow JavaScript from Smart Search field
Allow JavaScript from Apple Events
Safari → Settings → Developer. Three boxes sit under Automation; you want the last one.

On older versions of Safari

Before the Developer tab existed, the same switch lived in the menu bar: step 1 added a Develop menu, and Allow JavaScript from Apple Events sat inside it. If your Settings window has no Developer tab, look there instead — it's one setting either way, so ticking it in one place ticks it in the other.

SafariFileEditView HistoryDevelop WindowHelp
Open Page With
Show Web Inspector

Allow JavaScript from Apple Events
Allow Remote Automation
The older route: the Develop menu in the menu bar. Neighbouring items vary by version.

Chrome

In the menu bar, choose View → Developer → Allow JavaScript from Apple Events. A checkmark means it's on. There's nothing to switch on first.

ChromeFileEditView HistoryBookmarks WindowHelp
Chrome's View → Developer submenu.

The other browsers

After you turn it on

Still stuck, or does your browser look different? Open an issue on GitHub and tell us what you see — including your macOS and browser versions.  ·  beamhook.app