web_accessible_resources | messaging Chrome extension from web page | Browser Plugin library
kandi X-RAY | web_accessible_resources Summary
kandi X-RAY | web_accessible_resources Summary
This is a proof of concept for using Web Accessible Resources to relay messages from a web page to a Chrome extension. When you open the page, it should send the string "hello" to the extension. The extension will reverse the string and send it back to the web page.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of web_accessible_resources
web_accessible_resources Key Features
web_accessible_resources Examples and Code Snippets
Community Discussions
Trending Discussions on web_accessible_resources
QUESTION
I'm trying to update my Chrome Extension to Manifest v3. I use a JSTensorflow Model and it pops this error:
Uncaught EvalError: Refused to evaluate a string as JavaScript because 'unsafe-eval' is not an allowed source of script in the following Content Security Policy directive: "script-src 'self'".
I know that Manifest v3 doesn't allow 'unsafe-eval', so how can I turn around this problem?
My manifest.json:
...ANSWER
Answered 2022-Mar-22 at 20:55Here we learn that chrome bans any external resource or any script which includes eval()
using something called the Content Security Policy
.
I am also running a project with the same idea as yours and just ran into the same issue. It also mentions on that page some workarounds include:
Using a 'templating library' (A library which complies with the rules)
Access remote content (Send requests to an external server which does the processing there)
As far as I know there's no tensorflow.js which complies so #2 might be the only answer here.
QUESTION
I get a net::ERR_FILE_NOT_FOUND
error when using chrome.runtime.getURL
function.
ANSWER
Answered 2022-Mar-13 at 15:32When you use it in a CSS file or code line, try to use it like this:
QUESTION
Here is my background script;
...ANSWER
Answered 2021-Dec-30 at 08:00activeTab
works only when the user explicitly invokes your extension as described in the documentation for WebExtensions and Chrome extensions). Evidently, its name is highly misleading: it should have been something like activeTabWhenInvoked
.
In order to access any tab without prior interaction with your extension you'll have to add broad host permissions in manifest.json:
QUESTION
The article from here shows a method for websites to determine whether a user has a particular extension installed, if "web_accessible_resources" (in case of Chrome) allows this. My question is why do browsers not filter these requests themselves? The only use case I came up with was to fingerprint the user.
...ANSWER
Answered 2021-Dec-22 at 12:21The author of an extension lists such accessible resources in its manifest.json intentionally. This is a feature used by extensions to add a UI or a font/image to the web page(s) and so on.
Fingerprinting is possible only due to a poor implementation in Chrome (and Chromium-based browsers), which will be eventually fixed in ManifestV3 so extensions can set use_dynamic_url
.
Firefox WebExtensions aren't affected because Firefox uses a unique per-machine UUID, more info.
QUESTION
I have this piece of code in my manifest:
...ANSWER
Answered 2021-Dec-05 at 06:17It turns out that duplicate keys are no longer allowed. And to fix it, you not only need to delete one of the duplicates (as I did), but you need to unpublish your extension entirely and then republish.
It wasn't clear on what would happen when unpublishing. Essentially, you extension will disappear from the Webstore and when you republish, it takes longer than usual to review it. (it took about 2 days vs the normal couple hours). In that time it will say 'pending' but when it does get approved, everything in your store will be restored and it will be as though nothing happened.
QUESTION
I tried many ways to play a sound from the URL but it isn't working.
When I inspected the page have errors console:
chrome-extension://invalid/:1 GET chrome-extension://invalid/ net::ERR_FAILED
Uncaught (in promise) DOMException: Failed to load because no supported source was found.
manifest.json:
...ANSWER
Answered 2021-Nov-14 at 15:12Add schema to URL:
QUESTION
I would like to implement a hotkey that triggers a function in my content script. The content script (main.js) is executed on page laod from my popup.js file.
i have added the command into my manifest.json and when I add the onCommand listener to my popup.js I can console log that it gets triggered when I press my hotkey (Ctrl+Shift+K)
However I can not get it passed to my content script.
manifest.json
...ANSWER
Answered 2021-Oct-25 at 21:15Use messages like below
popup.js
QUESTION
ANSWER
Answered 2021-Oct-07 at 03:40Based on your description and the manifest code you provided, and the screenshot shows the "Inspect popup" option is disabled (greyed out), so I think your problem is that there is no "default_popup"
declaration in the manifest
. Or you can use chrome.browserAction.setPopup to solve the problem.
This is a similar case:Disable "inspect popup" menu entry in chrome extensions.
QUESTION
I start a chrome extension that is triggered on instagram.com. I wanted to load a local font but when I open the extension I get this error when font is loading
...ANSWER
Answered 2021-Sep-03 at 05:37We can use chrome.runtime.getURL API to get the URL of our resource and then we can provide that URL in src of font-face.
QUESTION
I'm building a browser extension for Microsoft Edge in which I need to inject a script into certain pages. Whenever I try to load the unpacked extension, Edge reports, “Error Invalid value for 'web_accessible_resources[0]'.” However, I've looked at the documentation and some examples and it appears that I have a valid configuration. Below is a minimum working example to reproduce the error:
manifest.json ...ANSWER
Answered 2021-Sep-01 at 13:39I tried using the Manifest v2 format for web_accessible_resources
. It loaded successfully, but it had a background error that said, “The maximum currently-supported manifest version is 2, but this is 3. Certain features may not work as expected.” I guess that solves that. Microsoft's documentation didn't make that clear.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install web_accessible_resources
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page