spotify-web-ads-remover icon indicating copy to clipboard operation
spotify-web-ads-remover copied to clipboard

Firefox support

Open xileftenurb opened this issue 3 years ago • 19 comments

xileftenurb avatar May 05 '21 17:05 xileftenurb

Looks good, but - are you running this on Firefox, and the extension successfully blocks ads?

tomer8007 avatar May 05 '21 17:05 tomer8007

Well, truth is, I did not test it, I don't know how...

xileftenurb avatar May 05 '21 17:05 xileftenurb

You can test this using Firefox's developer page. You have instructions for example here.

tomer8007 avatar May 05 '21 17:05 tomer8007

oh thank, I will check that

xileftenurb avatar May 05 '21 18:05 xileftenurb

I tested it (finally using the instruction found here -> https://extensionworkshop.com/documentation/develop/temporary-installation-in-firefox/

and it fails because it does not recognize "wsHook" as a variable.

What puzzle me is that this variable does not seem to exist in firefox, nor in chrome (when tapping "wsHook" in inspector, both return me undefined variable), but chrome does not seem to throw any error while running the script.

xileftenurb avatar May 06 '21 12:05 xileftenurb

This variable is defined here: https://github.com/tomer8007/spotify-web-ads-remover/blob/2c56b7cc85a1ea60cb68d24b4cea7f3d9fb4bcca/content_script.js#L43 Perhaps there is a problem with the script injection on page load. You can take a look at the other addon here, in which it works. Hopefully this helps.

tomer8007 avatar May 06 '21 15:05 tomer8007

I found the root of the problem -> Content Security Policy: The page’s settings blocked the loading of a resource at inline (“script-src”). content_script.js:35:43

not sure how this could be fixed, since it will block any script injection.

xileftenurb avatar May 06 '21 23:05 xileftenurb

Actually this makes me think about how it actually worked in Chrome so far, so I've pushed 66ad20f688a5945d4a169fd1939a3f86ad89c317 for completeness. Please try to see if it fixes anything on Firefox now.

tomer8007 avatar May 15 '21 11:05 tomer8007

I downloaded the code and compiled for testing into Firefox, and it works. Can I create a pull request for uploading the manifest updated for working also on Firefox?

lorenanunez avatar Jun 13 '21 20:06 lorenanunez

@lorenanunez You can open a separate pull request, given that you actually get ads blocked on Firefox

tomer8007 avatar Jun 14 '21 05:06 tomer8007

image im encountering the same issue after installing from the main branch, installing on firefox, changing all instances of chrome -> browser and extension.getURL -> runtime.getURL

mackdroid avatar Nov 14 '21 08:11 mackdroid

a possible workaround would be disabling content security policy browser wide, but i dont think thats a good idea

mackdroid avatar Nov 14 '21 08:11 mackdroid

image still occurs

mackdroid avatar Nov 14 '21 08:11 mackdroid

oh i forgot to restart the browser, well anyways setting security.csp.enable to false in about:config and the extension works as flawlessly

mackdroid avatar Nov 14 '21 08:11 mackdroid