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
8
votes
0 answers

To get selected text with new line characters?

We are developing a Chrome extension in which we tried to get the selected text in a browser tab. To do so, we are using a context menu option but we got an empty string as selected text by using the following method in…
Barani
  • 552
  • 4
  • 18
8
votes
1 answer

What is chrome.identity.getProfileUserInfo meant to return?

With Chrome 37 now released, there is a new API available, identity.getProfileUserInfo. I am not really sure what information this is meant to return or what it represents. From the documentation, I thought it would return the email address and id…
user3806049
  • 290
  • 2
  • 9
8
votes
2 answers

chrome.browserAction.onClicked.addListener() with popup

I want to add Listener to the event which fires, everytime the browser icon is clicked. I have also a popup which comes up on click on this icon. I tried chrome.browserAction.onClicked.addListener() but didnot get it fired, later i saw that the doc…
doniyor
  • 36,596
  • 57
  • 175
  • 260
8
votes
2 answers

chrome.storage remove specific item from an array

This is the JSON stored in my chrome local storage {"users":[ {"password":"123","userName":"alex"}, {"password":"234","userName":"dena"}, {"password":"343","userName":"jovit"} ]} Is it possible to remove a specific item in "users" ? I…
8
votes
2 answers

Sharing a local storage object across a web-app and a Chrome extension

I need to store a users profile and his preferences in a localStorage object \ cookies in a way that they'll be accessible(readable) and writable from both the web-app, and the chrome extension (that are basically part of the same product). I found…
Oleg Belousov
  • 9,981
  • 14
  • 72
  • 127
8
votes
1 answer

How can I make an iframe not save to history in Chrome?

I am attempting to develop a Chrome extension that injects an Angular application into the user's browser window in order to make an interactive sidebar. I have mostly been able to achieve 100% of what I want by adding an iframe to the page through…
8
votes
1 answer

Event pages and background pages

Since there's no clear explanation in Chrome Extensions documentation, I came here for help. I learned that background pages are basically invented to extend the extension's lifetime, and designed to hold values or keep the "engine" running in…
user3423014
8
votes
1 answer

Interprocess communication between browser extension and native application

How can an interprocess communication be estabilished between a browser extension and a native application? Is there any cross-platform (Linux and Mac OS X) and cross-browser solution (Firefox, Chrome, Safari)? The only idea that comes to my mind is…
8
votes
3 answers

Avoid dynamically injecting the same script multiple times when using chrome.tabs.executeScript(...)

I'm building a Google Chrome extension. The basic setup is I have a Browser action button that injects jQuery and another bit of JavaScript into the active tab when it is clicked to do it's thing. This is my first Chrome extension, but it seems…
Pete
  • 248
  • 2
  • 9
8
votes
1 answer

Can You Build A Chrome Extension Using Django?

I am building a Chrome Extension for my team to input information that will store data as efficiently as possible. I know Chrome Extensions are built with JavaScript, but was wondering if I could use Django to build a Chrome Extension? My plan…
AdamHurwitz
  • 9,758
  • 10
  • 72
  • 134
8
votes
2 answers

Securely store token/password in Chrome extension

I'm implementing a Chrome extension, which needs to access a 3rd party API endpoint using a token. How do I store a token securely in the Chrome extension, assuming other Chrome extension scripts can access the page's localStorage & cookie?
8
votes
4 answers

How to automatically chrome-cast a website or a tab

Is there a way to automatically google cast a chrome tab or a specific website everytime I visit the website URL ? Any command or function or script or bat file ?
8
votes
1 answer

Chrome extension development: chrome.contextMenus is null

I am developing a Google Chrome extension for myself. It adds an extra menu item to the right click context menus of the images on every page. Currently, my extension works without a problem, but when I check console logs, I see this error…
8
votes
2 answers

chrome.runtime is undefined when extension installed from chrome store

When i console.log(chrome) with google chrome browser i get certain properties but i find the 'runtime' property of chrome is not available. app: Object csi: function () { native function GetCSI(); return GetCSI();} loadTimes: function () { native…
codeofnode
  • 18,169
  • 29
  • 85
  • 142
8
votes
3 answers

How get Facebook token using Oauth2 with chrome.identity

I'm using chrome.identity in a packaged app to get a user token using Facebook. I call chrome.identity.launchWebAuthFlow, and I need to take the access token, send it to the server, and then access token is used to verify the user. Works great with…