Pitmairen / selection-search

Search extension for the chrome web browser
GNU General Public License v3.0
180 stars 26 forks source link

Porting to Firefox as a Webextension #42

Open 4i6l opened 6 years ago

4i6l commented 6 years ago

I've found this extension to be a great timesaver when searching on Chromium based browsers but I'd love to see if it could be made available on Firefox as well.

I downloaded the latest .crx file and submitted it to Mozilla's compatibility checker in the following link and it seems that it is compatible with Firefox, although there were a few warnings in the report viewer:

https://www.extensiontest.com/

I hope this means that minimal changes will have to be made in order to successfully port it. I'd really appreciate it if you would consider doing this so that more users will be able to use this excellent extension.

Pitmairen commented 6 years ago

I will have a look at it, and if it is not too much work will try to make it compatible with firefox.

Pitmairen commented 6 years ago

I have created a branch with some small tweaks to make it work in Firefox: https://github.com/Pitmairen/selection-search/tree/firefox-support

Unfortunately Firefox does not support some of the technologies that the extension is using, so it may not work perfectly.

For example, the extension uses a Shadow DOM to prevent a sites styling from affecting the popup. Firefox does not support this, so the popup styling may be influences by the current site's style-sheet which can make the popup look weird. Once Firefox supports Shadow DOM, this problem will be fixed.

You can look the last commits in the Firefox branch to see what changes has been made to make it work in firefox: https://github.com/Pitmairen/selection-search/commits/firefox-support

I will not upload it to the Firefox addon-site until firefox supports at least shadow doms.

If you want to use/test the extension in firefox now, you can download the source and load it into firefox manually:

  1. Downlaod and extract the source: firefox-support.zip
  2. Go to about:debugging in firefox and click "Load temporary add-on"
  3. Select for example the manifest.json file in the source folder

This should load the extension and you should be able to use it.

I have tested it in Firefox 55, and most of the basic features seems to work.

4i6l commented 6 years ago

This is excellent! Thanks so much for putting in the work to create an initial port. I signed a personal copy of the .zip file so I don't have to load it as a temporary add-on each time I restart my browser and it seems to be working for me.

I tested it in FF57 Nightly and the only issue I noticed so far was that I had to set extensions.webextensions.remote and extensions.webextensions.protocol.remote to false in about:config in order to import settings and keep them from resetting to default settings each time the browser restarted.

Otherwise things are working well and I look forward to when it becomes an official add-on once shadow DOM support lands.

Qwash commented 6 years ago

+1

Qwash commented 6 years ago

@Pitmairen can you please update Firefox branch

Pitmairen commented 6 years ago

Yes, I will do it.

Pitmairen commented 6 years ago

I have now merged the master branch into the firefox branch.

Qwash commented 6 years ago

SS mess with some sites buttons ex Deleted

Pitmairen commented 6 years ago

The problem is that firefox does not support Shadow DOM (https://caniuse.com/#feat=shadowdomv1). This causes the CSS used by selection search to affect the page if the site uses the same names as selection search for the classes and ids. Before starting to use the Shadow DOM, I used to generate random css class names and ids to prevent the from clashing with the site css, but this is no longer needed when using Shadow DOM.

According to this page: https://developer.mozilla.org/en-US/docs/Web/Web_Components, Firefox will add support for Shadow DOM in version 59/60.

Qwash commented 6 years ago

Thanks for clarification, for now I will put affected sites in the blacklist This extension is awesome! tyvm ♥

Qwash commented 6 years ago

Firefox 60 has been released☺

Pitmairen commented 6 years ago

Unfortunately Shadow DOM doesn't seems to be enabled in version 60. The site now states that it looks to be enabled by default by about version 63.

ghost commented 5 years ago

Firefox 64 here, Shadow DOM enabled. Could we get a official port© to ffox?

Pitmairen commented 5 years ago

I will test it soon and see how it works.

ghost commented 5 years ago

✌ thank you Per.

Pitmairen commented 5 years ago

I have testet a little bit with now with Firefox 64. Some small tweaks are needed, but it seems to work quite well. :)

ghost commented 5 years ago

Great cant wait to test it out;)

Pitmairen commented 5 years ago

I have uploaded the first experimental version for Firefox now, you can find it here: https://addons.mozilla.org/en-US/firefox/addon/selection-search-ff/

Version 64 of Firefox is required.

I have done some testing and most features seems to work fine.