When i console.log(chrome) with google chrome browser i get certain properties but i find the ‘runtime’ property of chrome is not available. so chrome.runtime is undefined. and hence i am not able to use chrome.runtime.sendMessage for my extension How to resolve the above?? EDIT : my code is : EDIT 2 : from here : https://developer.chrome.com/docs/extensions/mv3/manifest/externally_connectable. I am sure(correct me
Tag: google-chrome-extension
How can I listen to xhr response using chrome-extension?
I want execute a function when some a chrome window gets a XHR response. I don’t know what exactly this request is like, because of a codified param of this request, for example: api.xxx.com/rest?random=123 So I don’t think I could use or which both need specify the request details. Answer The listeners for those events do not need you to
Disable / Enable Chrome Extension Via Browser Action / Icon
The chrome extension I am developing inserts content scripts and css onto every page of a website. However, the user may have a certain page or pages he or she does not want the extension to run on, so it would be great if I could set up the browser action as basically a toggle on / off. What I’d
chrome.storage.sync.remove array doesn’t work
I am making a small Chrome extension. I would like to use chrome.storage but I can’t get it to delete multiple items (array) from storage. Single item removal works. Nothing seems to break but the last loop that alerts out what is in the storage still shows all the values I am trying to delete. Answer When you pass in
How to use chrome.alarms for Google Chrome extension
manifest.json I trying to create a function to make a popup “great” every minute like this: Could someone please tell why is it not triggering that alert. I check the console, no error was displayed. Answer Here is the simplest working example I can think of, warning it is very annoying as when the alarm is on it alerts “Beep”
Inject CSS stylesheet as string using Javascript
I’m developing a Chrome extension, and I’d like users to be able to add their own CSS styles to change the appearance of the extension’s pages (not web pages). I’ve looked into using document.stylesheets, but it seems like it wants the rules to be split up, and won’t let you inject a complete stylesheet. Is there a solution that would
Simulated Click in Chrome Extension
I am making a Chrome extension. One part of this extension needs to be able to simulate a click in order to activate the onClick events on the page. Here is the code from the background script: Here is the error message that I am getting from Chrome’s JavaScript debugging: I am guessing that it is something to do with
Google Chrome extensions simple message passing error
I am trying to pass a message between my popup to a background page using the one message interface (I’m using code similar to the one in Google’s example for this). popup: and this is how I listen (and reply) in background.js: Now when I inspect everything in the console the messages are exchanged ok but I get the following
Get selection from Google Docs
Is there a way around the fact that does not seem to work in Google Docs? I want to capture text from a highlighted selection from Google Docs. My implementation is with Chrome Extensions, but that is not as relevant as the fact that window.getSelection() doesn’t seem to work there (though it does elsewhere). Thanks! Answer As mentioned on Docs
Access variables and functions defined in page context using a content script
I’m learning how to create Chrome extensions. I just started developing one to catch YouTube events. I want to use it with YouTube flash player (later I will try to make it compatible with HTML5). manifest.json: myScript.js: The problem is that the console gives me the “Started!”, but there is no “State Changed!” when I play/pause YouTube videos. When this