PBear.SF
PBear.SF

Reputation: 43

Add commands to existing application right-click menu in macOS Dock

Safari's dock icon includes right-click commands for "New Window" and "New Private Window" -- see screenshot.

Since Mozilla rather negligently left these shortcuts off of the Firefox dock icon, is there any way (i.e., via AppleScript?) to add the same commands to Firefox's icon in the dock?

Safari context menu in macOS dock

Edit: It has come to my attention that, currently, both Firefox and Safari act identically in this matter. If either application is open, the "New Window" and "New Private Window" commands appear in its dock icon's context menu. When either Safari or Firefox is closed, no such commands can be seen. This may be an across-the-board restriction in macOS regarding what commands may be seen when Command-Clicking on pinned icons in the dock for applications that are not running. If so, it's a pity; in Windows, if Firefox is pinned to the taskbar, these commands are always available via right-clicking whether Firefox is open or closed.

Upvotes: 4

Views: 759

Answers (1)

user149341
user149341

Reputation:

Not without modifying the Firefox application itself. (Good luck… it's a scary place in there.)

Dock menu items have to be created from native code running within an application. They can't be set by another process.

Applescript can do some interesting things in general, but it can only interact with existing functionality of an application (and even then, only with functionality that's explicitly been made scriptable). It can't add completely new features to an existing application.

Upvotes: 2

Related Questions