I am following the instructions on developing a WebExtension for Firefox. I have it working for HTML pages. But, I would also like my script to run when the requested "page" is an image. Is this possible?
Here is what I have:
manifest.json:
{
"manifest_version": 2,
"name": "Test",
"version": "1.0",
"applications": {
"gecko": {
"id": "alert@example.com",
"strict_min_version": "42.0",
"strict_max_version": "50.*",
"update_url": "https://example.com/updates.json"
}
},
"description": "Just does an alert.",
"icons": {
"48": "icons/border-48.png"
},
"content_scripts": [
{
"matches": ["<all_urls>"],
"js": ["alert.js"]
}
]
}
alert.js:
alert("ok");
After installing the plugin by following the instructions (by going to "about: debugging"), I get a JavaScript alert for all HTML pages. But if I navigate to an image (for example by right clicking on an image and choosing "View Image"), no alert occurs.