I developed a simple javascript injection which works very well.
Can anybody tell me how to define the domain on which I want my firefox add-on to work for?
E.g. this doesn’t work for http://www.myexample.com in main.js:
const self = require("self"),
page_mod = require("page-mod");
exports.main = function() {
page_mod.PageMod({
include: "*myexample.com*",
contentScriptWhen: "ready",
contentScriptFile: self.data.url("inject.js")
});
};
These lines also don’t work:
include: "*.myexample.com/*",
include: "*.myexample.com*",
It’s all in the documentation:
The
match-patternmodule recognizes when you intend to match the domain name only, no need to add wildcards after the domain name.