I'm scratching my head on this one.
My add-on installs but does not seem to function.
I have a working add-on I built for Firefox(web) that geolocates, gets domain/path/etc/, user-agent, ports the info to the content script, yada yada, etc etc, but I couldn't seem to get it to do more than install on the nightly Fennec build.
I understand some modules aren't available on mobile yet, which is not a big deal, at this point I am literally just trying to get an alert box to pop-up.
Just for the hell of it here are the basic files for the alert box:
lib/main.js
var data = require("sdk/self").data;
var pageMod = require("sdk/page-mod");
exports.main = function() {
pageMod.PageMod({
include: "*",
contentScriptWhen: 'ready',
contentScriptFile: [data.url("test.js") ],
attachTo: ["top"]
});
};
data/test.js
window.alert("hello");
alert("you");
My thoughts are this may be a version conflict, but my fix didn't seem to make a difference.
I have installed the nightly build of firefox which today is (29.0a1)
I have installed the Addon-sdk-1.15 (current)
When I package my addon
cfx xpi --force-mobile
the produced Install.rdf reads max-version(22.0a1).
This appears to be my problem, so I have adjusted the max-version to (29.0a1) in the constructor for the install.rdf located in /addon-sdk-1.15/app-extension/install.rdf, so when I package again the max-version will match my nightly build.
Is this the correct method of doing this?
I install the xpi, by
adb push my-addon.xpi /mnt/sdcard/
Then open Firefox Mobile and type this into the address bar:
file:///mnt/sdcard/my-addon.xpi
It installs correctly, but again, no functionality.
Does anyone have any useful input?
Thank you in advance.