My add-on, compiled from a Greasemonkey script that uses GM_ functions, does not work in Firefox version 31+ -
i have firefox add-on overlay based extension working in firefox version 31. not working in version 32 , above. utilize userscript compiler tool build extension. don't see anything(errors/outputs) in console extension.
though when run script using greasemonkey plugin working fine. problem when running extension after building xpi file.
below extension structure:
myextension |-->skin |-->classic |-->content |-->myscript.user.js |-->myscriptprefman.js |-->myscriptscript-compiler.js |-->myscriptxmlhttprequester.js |-->script-compiler-overlay.xul |-->chrome |-->install.rdf |-->icon.png |-->chrome.manifest below install.rdf file contents:
<?xml version="1.0"?> <rdf xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:em="http://www.mozilla.org/2004/em-rdf#"> <description about="urn:mozilla:install-manifest"> <em:id>{9ef9b86c-03da-4e10-9552-e97a6d258af5}</em:id> <em:name>sample extension</em:name> <em:version>2.6</em:version> <em:description>a sample extension - firefox</em:description> <em:creator>mozdev</em:creator> <em:contributor>greasemonkey compiler anthony lieuallen;</em:contributor> <em:contributor>http://arantius.com/</em:contributor> <em:homepageurl>www.example.com</em:homepageurl> <em:targetapplication><description> <em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id> <em:minversion>2.0</em:minversion> <em:maxversion>35.*</em:maxversion> </description> </em:targetapplication> </description> </rdf> chrome.manifest contents:
content myextension content/ overlay chrome://browser/content/browser.xul chrome://myextension/content/script-compiler-overlay.xul skin myextension classic/1.0 skin/classic/ do need alter in extension or convert bootstrap extension or utilize add-on sdk build xpi file?
update:i have followed the add-on sdk method suggested wladimir , created xpi installer file. userscripts not running within page. code still runs greasemonkey add-on.
this greasemonkey script runs fine in greasemonkey, not when made extension via neither compiler nor sdk.
i followed steps install add-on sdk in local machine. used cfx command build xpi file. install in firefox latest version(ver.33.0.2) , visit openuserjs.org can't see anything. why that?
i have replicated code using firefox request api gm_xmlhttprequest , local storage storing info locally. , create script communicate main.js using message passing backbone of restartless firefox addon sdk api's.
var info = require("self").data; var pagemod = require("page-mod"); pagemod.pagemod({ include: "*.example.com", //mywebsite url contentscriptwhen: 'start', contentscriptfile: data.url("contentscript.js") }); contentscriptfile place want write userscripts , communicate main.js using port messaging in latest firefox addonsdk api's.
i used request api getting info server instead of using unsupported gm_xmlhttprequest.
var request = require("sdk/request").request; var userdetails = request({ url: "http://example.com/user/1", oncomplete: function (response) { var res = response.json[0]; } }); and extension restartless , totally rewritten using high , low level api's in firefox documentation. hope future browser changes using these api's , back upwards extension longer period of time.
firefox-addon greasemonkey xpi
No comments:
Post a Comment