Make_webext.py - Convert a GreaseMonkey userscript to a WebExtension

I got tired of various problems with UserScript extensions (e.g. GreaseMonkey not working in IFRAMES, TamperMonkey not working when scripts are disabled using NoScript), so I decided to make a tool that could convert a GreaseMonkey script to a full WebExtension, with some limitations - GM_xxx functions are not implemented and @grant none does not run the script in the page context - it always runs in extension context.

I also added a few features to make the extensions more customizable than was possible with GreaseMonkey. Multiple content and background scripts can be bundled into the source UserScript, and there are new directives to add permissions or arbitrary data to the extension manifest.json. Since the script is now running as an extension, it has access to the full WebExtension API.

The tool can be found here: https://gitlab.com/jspenguin/make-webext
An example extension using this tool can be found here: https://gitlab.com/jspenguin/block-outside-container

1 Like

I can’t find that project anymore, has it been removed? :frowning:

EDIT: Looks like it has been moved to https://gitlab.com/ktpanda/make-webext