Today I start programming a firefox extension.
After some research and tests, I saw this is not a simple issue and I create this first tutorial about Programming extension with Firefox.
I created a folder named myx and I add with two files: manifest.json and myx.js.
The first file named manifest.json has this source code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | { "manifest_version": 2, "name": "MYX", "version": "1.0", "description": "Simple style exemple ...", "content_scripts": [ { "matches": ["*://*.google.com/search?*"], "js": ["myx.js"] } ], "permissions": [ "*://google.com/*" ] } |
The file named myx.js has this source code:
1 | document.body.style.border = "5px solid blue"; |
I open the firefox with this URL: about:debugging#/runtime/this-firefox and a load the manifest.json file with Load Temporary Add-on….
Firefox will create a blue border every time when you use google search to search something.
The programming extensions is a complex issue because you need to know advanced programming technics for security: Content Security Policy, X-Frame-Options, Cross-Site Scripting (XSS) and more.