Mink icon indicating copy to clipboard operation
Mink copied to clipboard

Firefox/WebExtensions version of Mink

Open machawk1 opened this issue 8 years ago • 6 comments

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.

machawk1 avatar Nov 14 '17 15:11 machawk1

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.

machawk1 avatar Jan 06 '18 19:01 machawk1

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.

ibnesayeed avatar Jan 06 '18 23:01 ibnesayeed

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.

machawk1 avatar Sep 12 '19 18:09 machawk1

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.

machawk1 avatar Feb 11 '20 14:02 machawk1

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.

machawk1 avatar Feb 13 '20 15:02 machawk1

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?

machawk1 avatar Jun 24 '20 15:06 machawk1