Does the official web browser support user scripts?

Hi.
Does the official web browser support user scripts, something like you would get in Firefox via Greasemonkey?
If not, is there a way to leverage Autoconfig Startup Scripting (AKA userChrome.js) like you could do in Firefox?
Thanks.

I haven’t tried with userContent.js, but userContent.css does work :wink:

For now. Mozilla is retiring the whole userChrome stuff.

I created a file at /home/defaultuser/.local/share/org.sailfishos/browser/.mozilla/chrome/userContent.css with the following content but it doesn’t seem like the style is applied:

body {
    background-color: black !important;
}

Is this the correct location?
Thanks.

1 Like

Nor sure, could be you need

user_pref(“toolkit.legacyUserProfileCustomizations.stylesheets”, true);

in prefs.js/user.js

If you want white text on black background i would recommend doing it through about:config you can search for color there, set your colors and then set browser.display.document.color.use to 2, always use your color settings, the last step is important for the changes to take effect

Well, playing around, what does work is installing extensions via the enterprise deployment method.

If you put valid .xpi files in /usr/lib64/xulrunner-qt5-78.15.1/distribution/extensions, the next browser launch will install them to the user profile (.local/share/org.sailfishos/browser/.mozilla/).

However, they do not seem to do anything. (I tried chill-out and borderify from Example extensions - Mozilla | MDN )

1 Like

Does it show under extensions.webextensions.uuids in about:config? Tried with ublock but doesn’t seem to work
Edit: oh wow it actually works with renaming to the ID

Wait? Ublock works with this trick?!

Not really, but it installs and with uuid you can then visit: moz-extension://4e462f42-8167-4324-846c-000663bcf77b/settings.html
But…

Maybe an earlier version of the extension works, from the time our browser engine was the latest version? I tried older versions, but i couldn’t install another version somehow. I don’t know if it’s enough just to remove the file the browser created after installation. I also couldn’t get i don’t care about cookies or i still don’t care about cookies installed.