random-agent-spoofer
random-agent-spoofer copied to clipboard
Port this to an WebExtention
For those who want to try to port this addon to an WebExtention you can help me here https://github.com/Mylainos/random-agent-spoofer/tree/webext. The branch is webext
.
Don't hesitate to create an issue and ask questions !
If @dillbyrne is ok we will merge it when it's ready.
I didn't think it was possible to port the RAS Jetpack addon to a RAS WebExtension addon.
https://blog.mozilla.org/addons/2015/08/21/the-future-of-developing-firefox-add-ons/
Which contains:
Add-ons based on the Jetpack SDK will work well as long as they don’t use require(‘chrome’) of some of the low-level APIs to touch objects in the content process.
As RAS relies on require('chrome') and alters objects in the content process I assumed a RAS WebExtension was not on the cards.
This info was released a while ago though, so I'd be ecstatic if in fact low level API access is now available and a RAS WebExtension was possible now.
require('chrome')
is used for messages between windows and for intercept request in order to change the User Agent, the headers, etc.
WebRequest API allow to rewrite the request and it's easy to inject script which alter the contents and communicate with the background.
The only thing we need is an API which allow the access and the modification of browser's preferences. For prototyping, I have started to write an WebExtention Experiment doing that. I will see with the WebExtention team if it's possible to add it in Firefox (see this roadmap).
@Mylainos Thanks for attempting this, hopefully the WebExtension team will come to their senses and allow global access to the browser preferences. Good thing we still have another 12 months to negotiate with them.
That was quick, the RAS WebExtension port project link is now a dead end, either gone or has moved elsewhere.
It's because I've merge the webext branch to the master branch. https://github.com/Mylainos/random-agent-spoofer/