Created
November 22, 2015 16:22
-
-
Save urig/f5aa42946210d1f202d3 to your computer and use it in GitHub Desktop.
Firefox add-on index.js with elegant hack to load a page-mod script from the add-on's root folder rather than from under its /data folder (for http://stackoverflow.com/questions/22656494/contentscriptfile-dont-work-in-pagemod)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var self = require('sdk/self'); | |
var pageMod = require("sdk/page-mod"); | |
pageMod.PageMod({ | |
include: "*.github.com", | |
contentScriptFile: "resource://<your_extension_name>/somefile.js" | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment