random-agent-spoofer icon indicating copy to clipboard operation
random-agent-spoofer copied to clipboard

Port this to an WebExtention

Open mylainos opened this issue 8 years ago • 6 comments

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 !

mylainos avatar Nov 28 '16 18:11 mylainos

If @dillbyrne is ok we will merge it when it's ready.

mylainos avatar Nov 28 '16 18:11 mylainos

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.

sueridgepipe avatar Nov 30 '16 11:11 sueridgepipe

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 avatar Nov 30 '16 21:11 mylainos

@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.

ghost avatar Nov 30 '16 23:11 ghost

That was quick, the RAS WebExtension port project link is now a dead end, either gone or has moved elsewhere.

sueridgepipe avatar Dec 02 '16 08:12 sueridgepipe

It's because I've merge the webext branch to the master branch. https://github.com/Mylainos/random-agent-spoofer/

mylainos avatar Dec 03 '16 17:12 mylainos