javascript - Firefox SDK page-mod arbitrarily stops working -
i've created extension using add-on sdk, relies in part on page-mod. has been working fine.
however, @ point (i'm not sure when, because working on different part of extension when happened) page-mod stopped working. however, code didn't change.
i using -p option cfx when running extension (when launching it, type cfx -p firefox_development_profile run
(for more see the cfx documentation )
when include profile dir, content script doesn't work. when don't include it, does. there in profile causing page-mod stop working.
i made basic page-mod plugin see if there in code causing problem, has same problem. test code (in main.js
is)
var data = require("sdk/self").data; var pagemod = require("sdk/page-mod"); pagemod.pagemod({ include: "*.org", contentscript: "alert('opened matching page')", onattach: function(worker) { console.log("been attached") } });
my package.json
follows:
{ "name": "test_firefox", "fullname": "test plugin", "id": "jid1-0yzmdwetd2my3g", "description": "an addon on work dalhousie glossary system", "author": "daniel yule", "license": "mit 2.0", "version": "0.1.0" }
to clear: extension works when run cfx run
not when used profile dir command cfx -p firefox_development_profile run
is there in firefox profile (which don't remember making changes to) cause page-mod stop working?
may problem :
a page mod not modify pages until pages loaded or reloaded. in other words, if add-on loaded while user’s browser open, user have reload open pages match mod mod affect them.
font : http://blog.mozilla.org/addons/2012/09/12/introducing-page-mods-attachto
Comments
Post a Comment