Hacker News new | past | comments | ask | show | jobs | submit login

Tampermonkey can change what's on the web page, but extensions can do much more than that, e.g. add toolbar menus and items to the context menu, add keyboard shortcuts, manage bookmarks, and so on. (See the API guide for an overview [1])

It's true that many extensions could "just be" Tampermonkey scripts. I'd guess they ship as standalone extensions due to a combination of: less friction to install, more discoverable, can extend with fancier features later on, and probably just inertia/ignorance from developers unaware of Tampermonkey.

1. https://developer.chrome.com/docs/extensions/reference/




As for keyboard shortcuts, userscripts can do that by observing individual key presses. I personally use a tiny library [0] by the Violentmonkey team to do it which is easy to use and smooths out differences between platforms and browser implementations.

While userscripts can't add items to toolbar or context menus, you can register menu commands [1] which have the added benefit of being able to be added dynamically after examining page contents. This is done using the `GM_registerMenuCommand` api [2].

[0]: https://violentmonkey.github.io/guide/keyboard-shortcuts

[1]: https://imgur.com/a/SWpOoRS

[2]: https://violentmonkey.github.io/api/gm/#gm_registermenucomma...


Right, for the average user the barrier to entry for userscripts is significantly higher than for extensions. I recently released one (a small enhancement to the Netflix UI) in both forms for this reason: https://greasyfork.org/en/scripts/446689-netflix-recommendat..., https://chrome.google.com/webstore/detail/netflix-recommenda...


A friend of mine uses this extension that tracks emails. It injects a pixel it made remotely into the email body. That sketches me out so much ha.

But yeah I have made a few extensions myself since I spend a lot of time in Chrome. If they go ahead with the anti-adblock I will have to learn Firefox's extension.




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: