This add-on needs to be rewritten to use WebExtensions in order to be compatible with Firefox 57+.
I've been looking at the WebExtensions APIs, and there is an onBeforeSendHeaders hook that would allow the browser to change the UA sent to web pages. There's even an MDN example for a UA switcher WebExtension, but that example is probably not compatible with Firefox for Android since it uses the browserAction API (which is unsupported according to this).
This is only part of the puzzle, though: there's also the JS navigator.userAgent property that certain sites use instead of the HTTP header. On first glance, I don't see any way to change this property using WebExtensions.
Also, I can't find any hooks for the actual browser UI, so I don't think there's any way to keep the Request Desktop Site checkbox synced like the add-on does now. That means we'd need a separate UI managed by the add-on to allow users to turn RDS off. Browser actions aren't supported, but page actions might work (though apparently setIcon isn't supported, so I don't know how you could tell different page actions apart from each other!)
In my opinion, it would make more sense to integrate such a widely-requested feature into Firefox directly. Add-ons, especially on the Android version of Firefox, are used by a tiny fraction of users. The relevant bug is here for reference.
This add-on needs to be rewritten to use WebExtensions in order to be compatible with Firefox 57+.
I've been looking at the WebExtensions APIs, and there is an
onBeforeSendHeaders
hook that would allow the browser to change the UA sent to web pages. There's even an MDN example for a UA switcher WebExtension, but that example is probably not compatible with Firefox for Android since it uses thebrowserAction
API (which is unsupported according to this).This is only part of the puzzle, though: there's also the JS
navigator.userAgent
property that certain sites use instead of the HTTP header. On first glance, I don't see any way to change this property using WebExtensions.Also, I can't find any hooks for the actual browser UI, so I don't think there's any way to keep the Request Desktop Site checkbox synced like the add-on does now. That means we'd need a separate UI managed by the add-on to allow users to turn RDS off. Browser actions aren't supported, but page actions might work (though apparently setIcon isn't supported, so I don't know how you could tell different page actions apart from each other!)