0

I just started developing a small Chrome extension, and following the https://developer.chrome.com/extensions/getstarted tutorial, I tried to find a way so that even in developer mode, the extension can be clickable on all tabs.

Right now, the extension is clickable only on pages under developer.chrome.com host.

It's probably a silly question, but do we have the possibility to test it, while on development, on other tabs (not under developer.chrome.com host)? If yes, how do we set this options? I try to add <all_tabs> permission in the manifest, but it doesn't seem to work.

Thanks!

A.I.S
  • 113
  • 3
  • 10
  • 1
    You need to reload the extension on chrome://extensions page and either reload each tab manually or use chrome.tabs.query + chrome.tabs.executeScript to insert your content script into all tabs. – wOxxOm Apr 28 '18 at 16:35

2 Answers2

1

The problem was that following this tutorial https://developer.chrome.com/extensions/getstarted, a rule is set in the background.js file that the browser action to execute on other pages.

I had to add the activeTab permission and delete code from background.js.

Credit to: https://www.sitepoint.com/create-chrome-extension-10-minutes-flat/

A.I.S
  • 113
  • 3
  • 10
0

As available here https://developer.chrome.com/extensions/user_interface#browser_action, adding browser_action to your manifest.json as against adding page_action makes the extension available in all tabs.