Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Browser denies any resources loading from contentScript #140

Closed
sbahir opened this issue Sep 13, 2022 · 1 comment
Closed

Browser denies any resources loading from contentScript #140

sbahir opened this issue Sep 13, 2022 · 1 comment

Comments

@sbahir
Copy link

sbahir commented Sep 13, 2022

If you try to load any resources from contentScript, you will get a browser error

Denying load of chrome-extension://<EXTENSION_ID>/<IMAGE_PATH>. Resources must be listed in the web_accessible_resources manifest key in order to be loaded by pages outside the extension.

When I open the link chrome-extension://<EXTENSION_ID>/<RESOURCE_PATH> I can access the resource (an image in my case).

I tried the solution suggested here but unfortunately it didn't work

Did anyone hit this issue?

If you have any suggestion, please let me know!

@sbahir
Copy link
Author

sbahir commented Sep 13, 2022

Found the problem:

From ContentScript, you should load the image using

chrome.runtime.getURL(<RESOURCE_PATH_IN_BROWSER>) and not some import from js

Make sure that you can open the path that is displayed by the browser

@sbahir sbahir closed this as completed Sep 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant