javascript - Extension affects another web page -
i having problems creating chrome extensions. code affects pages open in chrome, how can solve it?
my manifest.json:
{ "manifest_version": 2, "name": "merch tools 41studio", "description": "report app", "version": "1.0", "background": { "scripts": ["assets/js/jquery.min.js", "assets/js/background.js"] }, "browser_action": { "default_icon": "assets/image/icon.png", "default_popup": "popup.html" }, "permissions": ["tabs"], "content_scripts": [{ "matches": ["http://*/*", "https://*/*"], "js": ["assets/js/jquery.min.js", "assets/js/highcharts.js"] }] }
you need limit list of domains content scripts run on changing matches
property in content_scripts
. having "http://*/*","https://*/*"
means content script runs on http , https websites. rather specify list of websites want extension run on.
{ "manifest_version": 2, "name": "merch tools 41studio", "description": "report app", "version": "1.0", "background": { "scripts": ["assets/js/jquery.min.js", "assets/js/background.js"] }, "browser_action": { "default_icon": "assets/image/icon.png", "default_popup": "popup.html" }, "permissions": ["tabs"], "content_scripts": [{ "matches": ["http:/yoursite.com/*"], // change sites want extension run on "js": ["assets/js/jquery.min.js", "assets/js/highcharts.js"] }] }
Comments
Post a Comment