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.

This tag is dedicated to questions about extension development for the Google Chrome web browser.

The Chrome extension API is documented here.

Absolute beginners should start here.

A good tutorial video by official Google Developers is available on YouTube

Overview of extension architecture can be read here.

The What's New page lists some of the recent changes to the extension APIs, while the Official Chrome Releases Blog announces new releases of Chrome and Chrome OS. For general updates on the browser, visit the Official Chrome Blog.

Troubleshooting

Before posting a question, make sure that you've read the API documentation. If some methods are not documented, it may be because they are deprecated.

If necessary, include relevant parts of your manifest.json file in the question.

A common source of errors is the misunderstanding of manifest version 2 and Content Security policy (CSP). Read the documentation for the CSP to see if it answers to your question.

For anything not related to development of Chrome extensions, such as issues with publishing in the Chrome Web Store, browse the Chromium-extensions Google group (now read-only). Extension authors with questions about the Chrome Web Store can contact the cws-developer-support team at https://support.google.com/chrome_webstore/contact/developer_support/.

Migration to Manifest Version 3

Manifest version 3 is now in support since chrome 88, and will be allowed on the chrome webstore on January 2021. It is recommended to read how to migrate from v2 to v3 and an overview of the new features are found here.

29271 questions
615
votes
6 answers

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: { "name": "MyExtension", …
599
votes
18 answers

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.. case "getBrowserForDocumentAttribute": alert("ZOMG…
Skizit
  • 43,506
  • 91
  • 209
  • 269
505
votes
15 answers

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::ERR_BLOCKED_BY_CLIENT Why does it block some Ajax call but…
s.alem
  • 12,579
  • 9
  • 44
  • 72
478
votes
27 answers

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 exists, or does jQuery have some easy way to do…
mattsven
  • 22,305
  • 11
  • 68
  • 104
464
votes
5 answers

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 changes in DOM state. I could set up polling but…
Fletcher Moore
  • 13,558
  • 11
  • 40
  • 58
357
votes
21 answers

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 using console.log, but nothing…
snehit vaddi
  • 3,854
  • 2
  • 9
  • 13
346
votes
30 answers

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 can update the interval at which Chrome reloads…
Andrey Fedorov
  • 9,148
  • 20
  • 67
  • 99
285
votes
5 answers

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://boadgeojelhgndaghljhdicfkmllpafd/cast_sender.js Failed to load…
264
votes
11 answers

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?
Axiol
  • 5,664
  • 9
  • 37
  • 49
249
votes
13 answers

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 console. Is there a way that I can get…
Hailwood
  • 89,623
  • 107
  • 270
  • 423
230
votes
9 answers

Accessing console and devtools of extension's background.js

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 messages either. My manifest file: { "name": "My First…
221
votes
11 answers

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 changes are not showing in Resource panel for me By…
214
votes
12 answers

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, but I'd rather do this inside Chrome.
209
votes
8 answers

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 versions, where does Chrome store the files?
191
votes
6 answers

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): {{app.name}} Every time I click on one of these links, Chrome shows the URL…
ebi
  • 4,862
  • 6
  • 29
  • 40
1
2 3
99 100