Questions tagged [google-chrome-extension]
Extension development for the Google Chrome web browser. You write them using web technologies such as HTML, JavaScript, and CSS.
29,733
questions
626
votes
8
answers
394k
views
Access variables and functions defined in page context from an extension
I want to control youtube.com's player in my extension:
manifest.json:
{
"name": "MyExtension",
"version": "1.0",
"description": "...
616
votes
18
answers
1.1m
views
Chrome sendrequest error: TypeError: Converting circular structure to JSON
I've got the following...
chrome.extension.sendRequest({
req: "getDocument",
docu: pagedoc,
name: 'name'
}, function(response){
var efjs = response.reply;
});
which calls the following..
...
530
votes
15
answers
655k
views
Getting "net::ERR_BLOCKED_BY_CLIENT" error on some AJAX calls
Recently I've realised that, some adblocker extensions (such as adBlocker plus) block some Ajax calls. I get that error on the console:
GET http://localhost/prj/conn.php?q=users/list/ net::...
517
votes
30
answers
551k
views
How to wait until an element exists?
I'm working on an Extension in Chrome, and I'm wondering: what's the best way to find out when an element comes into existence? Using plain javascript, with an interval that checks until an element ...
469
votes
5
answers
362k
views
Is there a JavaScript / jQuery DOM change listener?
Essentially I want to have a script execute when the contents of a DIV change. Since the scripts are separate (content script in the Chrome extension & webpage script), I need a way simply observe ...
366
votes
22
answers
1.1m
views
Error message "DevTools failed to load SourceMap: Could not load content for chrome-extension://..."
I'm trying to display an image selected from the local machine and I need the location of that image for a JavaScript function. But I'm unable to get the location.
To get the image location, I tried ...
361
votes
31
answers
120k
views
How do I auto-reload a Chrome extension I'm developing?
I'd like for my chrome extension to reload every time I save a file in the extension folder, without having to explicitly click "reload" in chrome://extensions/. Is this possible?
Edit: I'm aware I ...
285
votes
5
answers
230k
views
Google Chromecast sender error if Chromecast extension is not installed or using incognito
I'm having an error running Chromecast sender in Chrome Incognito or if Chromecast extension is not installed:
Failed to load resource: net::ERR_ADDRESS_UNREACHABLE chrome-extension://...
274
votes
11
answers
301k
views
How can I get the URL of the current tab from a Google Chrome extension?
I'm having fun with Google Chrome extension, and I just want to know how can I store the URL of the current tab in a variable?
258
votes
13
answers
217k
views
google chrome extension :: console.log() from background page?
If I call console.log('something'); from the popup page, or any script included off that it works fine.
However as the background page is not directly run off the popup page it is not included in the ...
232
votes
10
answers
135k
views
Accessing console and devtools of extension's `background` script
I just started out with Google Chrome extensions and I can't seem to log to console from my background js. When an error occurs (because of a syntax error, for example), I can't find any error ...
222
votes
11
answers
266k
views
How to save CSS changes of Styles panel of Chrome Developer Tools?
How to save CSS changes of Styles panel of Google Chrome Developer Tools?
At tool's website it's mentioned that we can see all change in resource panel
But I'm working locally on a CSS file but ...
216
votes
8
answers
492k
views
Where does Chrome store extensions?
I looked in:
C:\Documents and Settings\username\Local Settings\Application Data\Google\Chrome\User Data\Default\Extensions
for unpacked extensions, but that folder is empty for me.
For newer ...
215
votes
12
answers
164k
views
Simulate limited bandwidth from within Chrome?
Is there a way I can simulate various connection speeds from within Chrome?
I need to be able to check http://localhost with varying speeds.
I know there are standalone applications that can do this,...
200
votes
9
answers
296k
views
How to change the locale in chrome browser
I want to change Accept-language request header to anything I wanted in chrome, is there any extension or plugin where I can do it. I want to be able to change locale and language both. Main ...
192
votes
6
answers
104k
views
AngularJS changes URLs to "unsafe:" in extension page
I am trying to use Angular with a list of apps, and each one is a link to see an app in more detail (apps/app.id):
<a id="{{app.id}}" href="apps/{{app.id}}" >{{app.name}}</a>
Every time ...
191
votes
4
answers
167k
views
Chrome extension: accessing localStorage in content script
I have an options page where the user can define certain options and it saves it in localStorage: options.html
Now, I also have a content script that needs to get the options that were defined in the ...
187
votes
7
answers
58k
views
How to test chrome extensions?
Is there a good way to do this? I'm writing an extension that interacts with a website as a content script and saves data using localstorage. Are there any tools, frameworks, etc. that I can use to ...
183
votes
8
answers
24k
views
Is it possible to hide extension resources in the Chrome web inspector network tab?
When I'm viewing the downloaded resources for a page in the Chrome web inspector, I also see the HTML/JS/CSS requested by certain extensions.
In the example above, indicator.html, indicator.js and ...
172
votes
6
answers
116k
views
Chrome developer tools: View Console and Sources views in separate views/vertically tiled?
Chrome developer tools: Is there a way to view the Console tab and the Sources tab in separate views? I often want to look at both of these simultaneously.
Pressing Esc when on the Sources tab will ...
172
votes
21
answers
181k
views
Disable developer mode extensions pop up in Chrome
Since the latest release of chrome (34.0.1847.116) last week, I have been receiving the “Disable developer mode extensions" when running automated tests using watir-webdriver.
This seems to be the ...
170
votes
9
answers
189k
views
Reading response headers with Fetch API
I'm in a Google Chrome extension with permissions for "*://*/*" and I'm trying to make the switch from XMLHttpRequest to the Fetch API.
The extension stores user-input login data that used ...
168
votes
3
answers
62k
views
Chrome Extension Message passing: response not sent
I am trying to pass messages between content script and the extension
Here is what I have in content-script
chrome.runtime.sendMessage({type: "getUrls"}, function(response) {
console.log(response)
...
165
votes
4
answers
40k
views
How do I use WebStorm for Chrome Extension Development?
I just bought WebStorm 5 and so far have been really enjoying its Inspection features. One hitch I've run in to when developing my Chrome extension is that it doesn't recognize the chrome variable:
...
165
votes
5
answers
264k
views
Chrome Extension - Get DOM content
I'm trying to access the activeTab DOM content from my popup. Here is my manifest:
{
"manifest_version": 2,
"name": "Test",
"description": "Test script",
"version": "0.1",
"permissions": [...
164
votes
5
answers
99k
views
Using ECMAScript 6
I'm looking for a way to run ECMAScript 6 code in my browser's console but most browsers don't support functionality that I'm looking for. For example Firefox is the only browser that supports arrow ...
164
votes
7
answers
155k
views
How to use jQuery in chrome extension?
I am writing a chrome extension. And I want to use jQuery in my extension. I am not using any background page, just a background script.
Here are my files :
manifest.json
{
"manifest_version": ...
147
votes
6
answers
224k
views
Where to find extensions installed folder for Google Chrome on Mac?
I can not find them under ~/Library/Application Support/Google/Chrome/; Where are they?
Mac Pro 10.8.4
Chrome Version 26.0.1410.65
144
votes
13
answers
85k
views
How to import ES6 modules in content script for Chrome Extension
In Chrome 61, support for modules in JavaScript was added. Right now I am running Chrome 63.
I am trying to use import/export syntax in Chrome extension content script to use modules.
In manifest....
140
votes
1
answer
56k
views
Chrome extension: force popup.html to close
I'm wondering is there anyway I can force popup.html to close?
139
votes
3
answers
334k
views
Checkbox Check Event Listener
Recently I have been working with the Chrome Plugin API and I am looking to develop a plugin which will make life easier for me for managing a website.
Now what I wish to do is to fire an event when ...
138
votes
19
answers
159k
views
Check whether user has a Chrome extension installed
I am in the process of building a Chrome extension, and for the whole thing to work the way I would like it to, I need an external JavaScript script to be able to detect if a user has my extension ...
133
votes
7
answers
299k
views
Refused to apply inline style because it violates the following Content Security Policy directive
So, in about 1 hour my extensions failed hard.
I was doing my extension and it was doing what I pretended. I made some changes, and as I didnt liked I deleted them, and now my extension is throwing ...
130
votes
3
answers
120k
views
Chrome Extension how to send data from content script to popup.html
I know this this has been asked in numerous posts but honestly I don't get them. I am new to JavaScript, Chrome Extensions and everything and I have this class assignment.
So I need to make a plugin ...
124
votes
4
answers
46k
views
Detect Chrome extension first run / update
How can an extension find out that it is being run for the first time or has just been updated, so that the extension can perform some specific actions? (e.g. open a help page or update settings)
123
votes
9
answers
163k
views
Modify HTTP responses from a Chrome extension
Is it possible to create a Chrome extension that modifies HTTP response bodies?
I have looked in the Chrome Extension APIs, but I haven't found anything to do this.
122
votes
6
answers
123k
views
sendMessage from extension background or popup to content script doesn't work
I know that question has been repeatedly asked in different ways, but I tried to go through all the answers (hopefully I didn't miss anyone) and none of them worked for me.
Here is my extension's ...
120
votes
4
answers
169k
views
Chrome Extension: Make it run every page load
I want to make a chrome extension that executes some scripts after one page is loaded, I am not sure whether I have to implement this logic on the background page or it can be anywhere else, any help ...
119
votes
8
answers
59k
views
How do I view the storage of a Chrome Extension I've installed?
It seems like it should be possible to view the localStorage/chrome.storage of Chrome Extensions installed on my browser. I've played around with the Developer Tools a bit, but haven't found a way to ...
117
votes
8
answers
65k
views
Can I programmatically open the devtools from a Google Chrome extension?
I have a chrome extension which hooks into the devtools. Ideally I want a badge that, when clicked, opens up the devtools on the new tab which I created. Is there any way to do this from the ...
113
votes
12
answers
154k
views
How to download a CRX file from the Chrome web store for a given ID? [closed]
I'd like to download the .crx file of an extension from webstore, I use fiddler to analyze the network request when I install an extension from webstore and got it.
For example, for the extension: ...
112
votes
12
answers
63k
views
Google Chrome Extensions - Can't load local images with CSS
I have a simple Chrome extension that uses the content script feature to modify a website. More specifically, the background-image of said website.
For some reason I can't seem to be able to use ...
110
votes
2
answers
104k
views
How can I save information locally in my chrome extension?
I want my chrome extension to save some information, and I'm not sure how to start the code...
I need it to save strings.
For example - The user inputs a string (In a text area over the popup) and ...
109
votes
14
answers
65k
views
Export CSS changes from inspector (webkit, firebug, etc)
When I'm working with CSS, I'll often test in a browser - say, Chrome - right click an element, click Inspect Element, and edit the CSS right there. The use of arrow keys to change things like margin ...
108
votes
16
answers
426k
views
Download content video from video stream with a path of .TS or .m3u8 file through actual code so i can make chrome extension [closed]
Videos on most sites make use of progressive downloading, which means that the video is downloaded to my computer, and easy to trace. There are lots of extensions out there to do this, and even in the ...
105
votes
7
answers
85k
views
Run script each time Chrome extension icon clicked
How do I write a chrome extension such that every time a user clicks the icon, my script is run but no popup is opened? (I would look this up in the docs myself but for whatever reason they suddenly ...
103
votes
2
answers
138k
views
Getting the source HTML of the current page from chrome extension
I have a chrome extension. I need to analyse from the HTML source of the current page. I found here all kinds of solutions with background pages and content scripts but none helped me. here is what I ...
102
votes
4
answers
145k
views
Chrome extension: How to open a link in new tab?
In my Stackoverflow folder, I have stackoverflow.ico and 2 bellow files. When importing it to Chrome, it shows the icon in address bar, but when I click on it, Chrome doesn't open any new tab. What am ...
100
votes
7
answers
127k
views
Custom protocol handler in chrome
How do i set up a custom protocol handler in chrome? Something like:
myprotocol://testfile
I would need this to send a request to http://example.com?query=testfile, then send the httpresponse to my ...
98
votes
9
answers
64k
views
Persistent Service Worker in Chrome Extension
I need to define my Service Worker as persistent in my Chrome extension because I'm using the webRequest API to intercept some data passed in a form for a specific request, but I don't know how I can ...