Addons and the Jolla browser

asked 2016-08-01 19:25:37 +0300

DaveRo gravatar image

updated 2016-10-08 17:38:34 +0300

I've been experimenting with the Jolla Browser (Jolla C, SFOS 2.0.2). I have several userscripts I would like to run so I thought I would try to convert them into addons - which is what I do with Firefox on Android. I thought I would start with the stuff I wrote for TJC, here:
https://together.jolla.com/question/102311/userscripts-and-firefox-addon-for-following-questions-on-together/

I've read all I can find about addons and the Jolla Browser (which was mainly about ad-blockers, but also mentioned Stylish) and it's clear that addons worked once but maybe not after 2014. I have various Firefox addons written over the years. I can't get recent ones, created with the addon SDK (i.e jetpack) to load. But an older, xul addon (with no UI changes, just javascript) appeared to install so that looked promising. If such addons work I can use code such as here:
https://developer.mozilla.org/en-US/Add-ons/Code_snippets/On_page_load
to load URL-dependant scripts, which will do what I want.

I can't get it to work. My conclusion is that the overlay script doesn't run at all. If anybody wants to look at it I've put my test addon (just a stub) here:
https://dl.dropboxusercontent.com/u/862480/temp/TJC-new-posts.xpi
(An xpi is just a zip file. You can download and unpack it to see the code and maybe install it in Firefox - if you allow unsigned addons.) I can install that in desktop firefox: It displays 'TJC-new-posts' on the console.

On Jolla I can load it by file:///.........TJC-new-posts.xpi and it asks me to confirm installation. After restart I can see it in about:support and the files are in ~/.mozilla/mozembedlite/extensions
I've been using chrome://global/content/console.xul to view the console (that's not ideal - perhaps I could fix it with css in userChrome) and I can see messages associated with the addon - but not my test message.

I've researched mozembedlite too, but I don't know C. What changed in 2014? Is it now capable of running such an addon? All information, guesses, and corrections to my understanding welcome.

Edit 1 7-10-16

I tried to load my test addon, above, in the 2.0.4 browser. This time failed to load:
Javascript Errror: resource://gre/modules/AddonManager.jsm line 1859: NS_ERROR_ILLEGAL_VALUE: aBrowser must be a nsIDOMElement or null

There is an addons manager in there: it outputs several debug messages.

Any clues, anyone?

Edit 2: 8-10-16

Since this is a non-bootstrapped addon, what the install process should do is simply move it to extensions/staged/. A restart will then install it. So I put the extension into extensions/staged/ and started the browser.

It threw errors during the install - see the screenshot here:
https://dl.dropboxusercontent.com/u/862480/temp/Screenshot_20161007_003_staged_addon_2.png

As before about:support showed the extension, but it obviously hadn't loaded.

Since this is gecko 38 I tried loading a jpm addon: same result: aBrowser must be a nsIDOMElement or null

I think that's it for now. I don't really expect this to be fixed, there are several more important issues, but I was hoping that someone with knowledge of the SFOS browser and mozembed would explain how the ability to run extensions was lost, and whether there's a chance of it being revived.

This, from Chris Lord of Mozilla, might be of interest:
http://chrislord.net/index.php/2016/03/08/state-of-embedding-in-gecko/

edit retag flag offensive close delete