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
60
votes
3 answers

How to get my extension's id from JavaScript?

I'm writing a Chrome extension, I need to get my extension's id in my code, so I don't need to change it manually every time. How can I do this?
wong2
  • 34,358
  • 48
  • 134
  • 179
60
votes
9 answers

React tab doesn't appear in chrome developer tools

I have installed React Developer Tools Chrome browser extension. But i cannot see the React tab in developer tools instead there are new tabs named "Components" & "Profiler". I re-installed the extension, restarted the browser and computer, checked…
60
votes
6 answers

Chrome extension hint.js & ngHintModules

Our angular app sometime does not load on chrome canary (Version 41.0.2237.0 canary (64-bit)) saying Failed to instantiate module ngHintModules due to: RangeError: Maximum call stack size exceeded But it loads fine in firefox, chrome (Version…
Kamrul
  • 7,175
  • 3
  • 31
  • 31
60
votes
2 answers

Install Chrome extension form outside the Chrome Web Store

I have developed a Chrome extension and I have packed it. I sent my extension to some people to try it, but Chrome started to block extensions that it does not find in the store. Is there any way to install my extension without getting blocked by…
nrofis
  • 8,975
  • 14
  • 58
  • 113
60
votes
3 answers

Getting around X-Frame-Options DENY in a Chrome extension?

I'm the author of Intab, a Chrome extension that lets you view a link inline as opposed to a new tab. There's not much fancy stuff going on behind the scenes, it's just an iframe that loads the URL the user clicked on. It works great except for…
60
votes
3 answers

chrome.storage.local.get and set

I'm trying to use chrome.storage.local in my extension, and it doesn't seem to work. I used localStorage but realized that I can't use it in content scripts over multiple pages. So, this is what I've come up with: function save() { var channels…
user569322
59
votes
5 answers

Chrome extension - retrieving global variable from webpage

I am working on an extension for Chrome. I wish parse the content of the "original" Gmail message (the currently viewed message). I tried to utilize the jQuery.load() as follows $(windows).load(function() { alert(GLOBALS); }); and place it at the…
Mr.
  • 9,429
  • 13
  • 58
  • 82
59
votes
3 answers

How to listen for url change with Chrome Extension

I am writing a Google Chrome extension to automate some common tasks. The functionality I want is as follows: Create a new tab and navigate to my webmail enter username and password click "submit" button Wait until the webmail page appears, and…
HelloWorld
  • 2,480
  • 3
  • 28
  • 45
59
votes
8 answers

Chrome Extension "Refused to load the script because it violates the following Content Security Policy directive"

I'm trying to create a Chrome extension, but none of my JS works. The console shows this error: Refused to load the script 'https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js' because it violates the following Content Security…
Mia
  • 817
  • 2
  • 8
  • 13
59
votes
1 answer

Get all keys from Chrome Storage

I can get the value of a storage key with the Chrome Extension API: chrome.storage.sync.get("someKey", function() {}); How can I get all key names that exist in the Chrome storage?
58
votes
7 answers

.crx file install in chrome

I have just created a very simple chrome extension and it works fine. But when I converted to .crx file and try to open it with chrome, nothing happens. my chrome browser version is 19.0.1081.2 dev-m. My extension uses jquery-1.4.2.min. I could not…
58
votes
2 answers

jQuery in Google Chrome Content Script?

How would I go about including the jQuery library in my Google Chrome Content Script? I have tried, fruitlessly, of course. Should I use , or is there a different/better way to go about it? Thanks in advance!
esqew
  • 42,425
  • 27
  • 92
  • 132
57
votes
4 answers

'observe' on 'MutationObserver': parameter 1 is not of type 'Node'

I am creating a Chrome extension and trying to include a small text beside the SEND button of the gMail compose box. I am using a MutationObserver to know when the compose box window appears. I am doing this by observing an element with class no…
57
votes
10 answers

How do I switch to the active tab in Selenium?

We developed a Chrome extension, and I want to test our extension with Selenium. I created a test, but the problem is that our extension opens a new tab when it's installed, and I think I get an exception from the other tab. Is it possible to switch…
Uri
  • 2,992
  • 8
  • 43
  • 86
57
votes
5 answers

Inject HTML into a page from a content script

I am building a Chrome Extension and I have a requirement to overlay a blob of html on top of a few websites. At the moment I am using a JQuery .Get to pull the html from my server. In order to improve performance I am wondering if it is possible to…
QFDev
  • 8,668
  • 14
  • 58
  • 85