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
77
votes
5 answers

Debug popup.html of a Chrome Extension?

I'm making a Chrome Extension and need to view the HTML/CSS/JS of the popup.html. I can't right click to inspect elements. Is there another way? I need to make sure CSS and JavaScript is being inserted correctly. How to debug a problem in that…
Skizit
  • 43,506
  • 91
  • 209
  • 269
77
votes
3 answers

Google Chrome Extensions - Open New Tab when clicking a toolbar icon

How can I create an extension for Chrome that adds an icon to the toolbar, and when you click it, it opens a new tab with some local web page (for example: f.html)? I saw this question, but it doesn't really explains what should I add in the…
Alon Gubkin
  • 56,458
  • 54
  • 195
  • 288
76
votes
1 answer

Graph Goat Teleportation Data with Google Vis. API via Chrome Extension

I just checked my Chromium task manager and noticed that my Goats Teleported count is abnormally high. I thought it might be a good idea to create a browser extension that runs the goat teleportation data through Google Visualizations API and…
76
votes
4 answers

Debugging Content Scripts for Chrome Extension

General Questions Hello! I'm delving into the world of Chrome Extensions and am having some problems getting the overall workflow down. It seems that Google has recently switched to heavily advocating Event Pages instead of keeping everything in…
76
votes
1 answer

How to modify an extension from the Chrome Web Store?

I've seen this extension in the Chrome Web store, which shows the newest videos of a YouTube channel. I want to modify this extension in order to make it work with a different channel. How can I get this done?
Alex_dlc
  • 907
  • 1
  • 7
  • 3
75
votes
2 answers

How to debug Google Chrome background script?

I have very simple extension: manifest.json { "name": "historyCleaner", "version": "0.1.1", "manifest_version": 1, "description": "This is my first Chrome extension", "background": { "scripts": ["cleaner.js"] }, "permissions": [ …
ciembor
  • 7,189
  • 13
  • 59
  • 100
74
votes
5 answers

Making a Chrome Extension download a file

I am creating an extension that will download a mp3 file off a website. I am trying to do this by creating a new tab with the link to the mp3 file, but chrome keeps opening it inside the player instead of downloading it. Is there any way I can…
Franz Payer
  • 4,069
  • 15
  • 53
  • 77
74
votes
5 answers

Taking screenshot using javascript for chrome extensions

I have made a lot of search regarding taking pictures using JS but none seem to be useful. Some say using activeX controls, which doesn't suit my situation. I was hoping to take picture using JS and upload it a server.
Sridarshan
  • 1,268
  • 3
  • 13
  • 15
74
votes
1 answer

How do I send an HTTP request from a Chrome extension?

I'm working on a chrome extension that sends a HTTP request. How do I send it to www.example.com with the parameter par with value 0? https://www.example.com?par=0 (the server reads the parameter par and does something) I found this article,…
74
votes
3 answers

Any way to remove X button from chrome tabs?

Is there any way to modify chrome tabs to remove the button that closes the tab? I've read through chrome develope tab. but I don't see any mention of the close button.
Takkun
  • 6,131
  • 16
  • 52
  • 69
71
votes
4 answers

Obtaining Chrome Extension ID for development

Although similar to this SO question, I am not asking: Under what conditions does an extension's ID change? nor How can I upload my zip archive to the Chrome Dashboard? I am however asking, how I can obtain an extension's key without using the…
Jack
  • 10,313
  • 15
  • 75
  • 118
71
votes
6 answers

sending message to chrome extension from a web page

I want to send message from the console of the random web page to my chrome extension. chrome.extension.sendMessage doesn't seem to work.
dilpreet023
  • 855
  • 1
  • 7
  • 5
69
votes
10 answers

Is it possible to run Google Chrome in headless mode with extensions?

I cannot use my currently installed extensions in Google Chrome using headless mode. Is there any way to enable them? An easy way to check if the extensions work is by adding, for example, the "Comic Sans Everything" extension. So Google looks like…
69
votes
7 answers

Chrome Extension Manifest 'Matches'

I'm trying my hands at a simple Chrome Extension, but am running into a problem with providing a value for the matches array in my content_scripts. { "name": "My Extension", "version": "1.0", "description": "My Extension Experiment", …
Aristotle
  • 1,052
  • 1
  • 10
  • 15
69
votes
3 answers

Is it possible to develop Google Chrome extensions using node.js?

I'd like to start developing Google Chrome extension using node.js (since I've already written a "text-to-song" script in node.js, and I'd like to turn it into a Chrome extension.) What would be the most straightforward way of approaching this…
Anderson Green
  • 30,230
  • 67
  • 195
  • 328