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
50
votes
7 answers

How to disable Google Chrome extension autoupdate

How do I disable Google Chrome extension autoupdate?
gerunn
  • 1,089
  • 1
  • 9
  • 11
50
votes
6 answers

Google Chrome Customize Developer Tools Theme / Color Schema

How to change color schema on Developer Tools, JavaScript Console in Google Chrome ? Like this:
50
votes
6 answers

How do you force Chrome pages/tabs to crash using JavaScript?

Trying to set window.location or using window.navigate() to make the browser go to about:crash or chrome://crash doesn't work. Is there a way to do it?
trusktr
  • 44,284
  • 53
  • 191
  • 263
50
votes
3 answers

Error in launching Chrome Extension for a specific page

I'm writing a simple Chrome extension that displays a JavaScript alert saying "Hello World". In this example I have specified that the extension will only run for google.com (by putting this in the permissions property within manifest.json). Even…
Noor
  • 19,638
  • 38
  • 136
  • 254
49
votes
3 answers

Chrome-extension: Append functions to right click menu

How would I append functions to the right click menu in the browser? E.g something appended to the right click menu which does function dosomething() which is located in my extension.
Skizit
  • 43,506
  • 91
  • 209
  • 269
49
votes
4 answers

Is it possible to require npm modules in a chrome extension ?

I tried so but I have a 'require is not defined' error. I can't find information about that, can someone enlighten the noob in me please?
void42
  • 921
  • 2
  • 10
  • 14
49
votes
4 answers

Getting unique ClientID from chrome extension?

I'm developing chrome extension. I need the ability to identify each client as a unique client. I can't store guid in a cookie since cookie can be deleted. I need something to be read from the system itself which is unique. Now - I know that JS…
Royi Namir
  • 144,742
  • 138
  • 468
  • 792
49
votes
3 answers

What are Chrome apps vs plugins vs extensions and how to develop them

I am trying to understand about Chrome (browser) development. I am very new to this and trying to figure out where to start in order to develop for Chrome Browser. Just have a couple of questions: What is the difference between Chrome Browser apps…
user203687
  • 6,875
  • 12
  • 53
  • 85
49
votes
4 answers

What do impressions in the Chrome extension developer dashboard mean?

In the developer dashboard, under stats, we can find two types of graphs: installations and impressions. What does these mean?
Jeevan
  • 3,878
  • 6
  • 29
  • 37
49
votes
5 answers

Google Chrome Extension - Script Injections

I'm trying to get my Chrome Extension to inject some javascript with content_scripts, using this previous answer as a reference. manifest.json "name": "My Chrome Extension", "version": "1.0", "manifest_version": 2, "content_scripts": [{ …
Nick Fury
  • 1,313
  • 3
  • 13
  • 23
48
votes
2 answers

Can I access a property from my manifest.json in my extension's JavaScript files?

I'd like to refer to the version number as defined in my manifest.json in my extension's JavaScript files. Is there any way to do this?
bittersweetryan
  • 3,383
  • 5
  • 28
  • 42
48
votes
1 answer

Chrome extension login best practices

I'm creating a Chrome extension popup and need login. For now, I will make my own authentication with a username and password, but what are best practices within an extension? Here are my thoughts: I will make the login against a remote server…
Rasmus Christensen
  • 8,321
  • 12
  • 51
  • 78
48
votes
2 answers

Chrome extension: Inject JS before page load

Is it possible to inject JS before page load, or is it necessary to use content scripts and way for the document to finish? For example, is there a faster way to execute JS that turns the page red as soon as it's opened?
Ian McIntyre Silber
  • 5,553
  • 13
  • 53
  • 76
48
votes
3 answers

How to get a content script to load AFTER a page's Javascript has executed?

My extension is supposed to load a content script, searchTopic.js, only after the page it's injected into has already fully loaded (yes, I have set "run_at" to "document_end" in the extension manifest), but in fact it's loading before all the DOM…
FractalBob
  • 3,225
  • 4
  • 29
  • 40
48
votes
12 answers

Chrome says my extension's manifest file is missing or unreadable

I'm a new chrome extension developer, and I was going through the Chrome tutorial on making a "Hello World" extension, here's my code: { "name": "My First Extension", "version": "1.0", "manifest_version": 2, …
user1689242
  • 493
  • 1
  • 4
  • 4