Auto Extension Chrome Extension

I am doing a chrome extension to find all the links on the page I am using browser_action. I get an error while refreshing the page, the chrome extension automatically runs javascript code. How can I make sure that if you click the update in the browser, the extension does not start? I want it to work only when you click the small icon on the toolbar.

This is what my manifest looks like

{
  "name": "Find all first",
  "version": "1.0",
  "description": "Find all Linkes",
  "browser_action": {
    "default_icon": "icon.png",
    "popup": "popup.html"
  },
  "icons": {
    "16": "icon.png",
    "128": "icon-big.png"
  },
  "permissions": [
    "tabs",
    "http://*/*",
    "https://*/*"
  ],
  "content_scripts": [ {
    "matches": ["http://*/*", "https://*/*"], 
    "js": ["content.js"]
  }]
}

Then I call this in my popup.html

chrome.tabs.executeScript(null, {file: 'content.js'}, function() {
  console.log('Success');
});
+5
source share
1 answer

contents_scripts, , content.js script , , matches (, - ).

content.js , " ", content_scripts , . , " ", popup.html content.js, .

+7

All Articles