Quantcast
Channel: User Chamilyan - Stack Overflow
Viewing all articles
Browse latest Browse all 43

Chrome extension: load different content scripts

$
0
0

I want to load a different content script depending on the page and tab that is currently selected. Right now, I have three content scripts. I want to use two of them for one page and the third one for another page.

Belonging to page 1:

content_script.jsload_content_script.js

Belonging to page2:

newtab_content_script.js

right now my manifest looks like this

{"name": "A plugin for AdData express. Generate an instant excel document from the brands you check mark.","version": "1.0","background_page": "background.html","permissions": ["cookies","tabs", "http://*/*", "https://", "*", "http://*/*", "https://*/*","http://www.addataexpress.com", "http://www.addataexpress.com/*"  ],"content_scripts": [    {"matches": ["<all_urls>","http://*/*","https://*/*"],"js": ["load_content_script.js", "content_script.js", "newtab_content_script.js", "jquery.min.js", "json.js"]    }  ],"browser_action": {"name": "AdData Express Plugin","default_icon": "icon.png","js": "jquery.min.js","popup": "popup.html"  }}

how would I structure this in the manifest or elsewhere?


Viewing all articles
Browse latest Browse all 43

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>