Firefox/WebExtensions version of Mink
This was started in https://github.com/machawk1/ffmink prior to the Mink 2.0 rewrite to use modern JS and the button bar over constant DOM intrusion. It also predates the introduction of WebExtensions. What would it take to port Mink to WebExtensions and have a common codebase between Chrome and Firefox (as well as other browsers that support WebExtensions)? This ticket can be used to document the investigation.
In #240 we may move to Web Components, which does not have the same level of support in Firefox as Chrome. A polyfill may help for the time being but be aware that some UI tweaks will be necessary when #240 is completed.
While Firefox does not support custom elements natively just yet (the work is in progress), the polyfill for the same is in a pretty good state. It does already support other constructs such as shadow DOM and some other new APIs.
The WebExtensions API has some nuances that would consolidate the codebases, e.g., the Chrome extensions API uses callbacks while WebExtensions uses Promises. https://github.com/mozilla/webextension-polyfill would help if we were to rewrite Mink using WebExtensions (browser.* instead of chrome.*). While Firefox supports chrome.* by default, moving to use WebExtensions would facilitate compatibility beyond the two browsers.
Mozilla's approach to this is "write using browser.* API and Promises, include polyfill as a fallback for those that use a callback model, the chrome.* APIs, etc."
Given 2+ years have passed since opening this issue, it might be worthwhile to:
- [ ] Check if Chrome continues to use a callback model.
- [ ] Update whether Chrome allows usage of the native
browser.*APIs of WebExtensions.
https://github.com/honestbleeps/Reddit-Enhancement-Suite/blob/master/CONTRIBUTING.md#building-development-versions-of-the-extension has some good details on project layout and compatibility. Might want to look how they are handling Promises vs. Callbacks within the code.
Safari will start to have WebExtensions support, albeit, with some core features missing (e.g. no blocking requests).
- [ ] What version of Safari will have this support, can Mink be tested on it prior?