We created an extension for Firefox (we also have a Chrome version), which injects scripts into the page. Here is the code that injects the script in Firefox:
for (var i in tabs) {
if (tabs[i].url.match(possible_urls) !== null) {
tabs[i].attach({
contentScriptFile: possible_urls_script_url
});
}
}
It worked until Firefox 42.0, but since version 43.0 it stopped working. I found this document and I think the first general item is related to us. But how do we make the script work?
In addition, we would like to check future versions of Chrome and Firefox with our extensions before they are released to the general public. How do we download and use them on Windows and Ubuntu?
possible_urls_script_url
= “resource://example-at-example-dot-com/data/…/lib/content/src/common/first_time_script.js”
I also tried with “resource://example-at-example-dot-com/lib/content/src/common/first_time_script.js” and it doesn’t work either.
I found out that with Firefox Developer Edition (45.0a2) it works but with Firefox 43.0 it doesn’t.
Also when injecting with contentScript
(instead of contentScriptFile
) it still doesn’t work on Firefox 43.0. But it works on Firefox Developer Edition (45.0a2).