saadtazi / firefox-profile-js

Firefox Profile creation using nodejs and CLI
MIT License
60 stars 30 forks source link

WebExtensions with package.json should not be classified as JetPack addon #106

Closed Photonios closed 4 years ago

Photonios commented 4 years ago

This fixes a bug with WebExtensions that have both a package.json and a manifest.json. This is very common and firefox-profile classifies these extensions as a JetPack style addon. Firefox subsequently fails to load them.

JetPack style addons are deprecated and we should first attempt to read the manifest.json in case this is a WebExtension.

An example addon for which the old approach is problematic is AdBlock Plus. It lists both package.json and manifest.json.

This is a fix for: https://github.com/webdriverio/webdriverio/issues/5095

Photonios commented 4 years ago

On a side note, a repository reproducing the issue can be found here:

https://github.com/Photonios/wdio-firefox-extension-issue-repro

saadtazi commented 4 years ago

Thank you the detailed report and the repro steps! Greatly appreciated. Merging and releasing right after.

saadtazi commented 4 years ago

Do you think we should increase the MAJOR? 2.0.0 or 1.4.0?

Photonios commented 4 years ago

I'd increase the MAJOR to be on the safe side. It would be less surprising if something were to break. I don't expect any of the changes to break something, but who knows. There might be some edge cases.

saadtazi commented 4 years ago

:+1: Just released v2.0.0! Thank you again.