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
188
votes
4 answers

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 options.html page, but when I try to access…
user476214
  • 1,881
  • 2
  • 12
  • 3
186
votes
7 answers

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 test this behavior? I realize there are some…
184
votes
9 answers

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 requirement is changing the locale.
user1614862
  • 3,701
  • 7
  • 29
  • 46
179
votes
6 answers

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 indicator.css are actually part of the Readability…
Mark Bell
  • 28,985
  • 26
  • 118
  • 145
171
votes
20 answers

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 offensive extension but it doesn't make sense to…
167
votes
3 answers

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) }); And in the background script I…
164
votes
5 answers

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 functions. Is there a way (extension, userscript,…
Spedwards
  • 4,167
  • 16
  • 49
  • 106
164
votes
6 answers

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 let me see a small view of the Console at the…
162
votes
7 answers

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": 2, "name": "Extension name", "description":…
161
votes
5 answers

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": [ "activeTab", "https://api.domain.com/" …
brandonhilkert
  • 4,205
  • 5
  • 25
  • 38
154
votes
9 answers

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 to be put directly into the XHR's open() call for HTTP Auth,…
jules
  • 1,658
  • 2
  • 12
  • 10
154
votes
4 answers

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: Is there a way I can add the chrome variable to…
145
votes
6 answers

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
airbai
  • 3,906
  • 5
  • 26
  • 30
139
votes
1 answer

Chrome extension: force popup.html to close

I'm wondering is there anyway I can force popup.html to close?
Skizit
  • 43,506
  • 91
  • 209
  • 269
135
votes
19 answers

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 installed. For example: A user installs my plugin,…
user179169