google chrome - Matching content script with last keyword match -



google chrome - Matching content script with last keyword match -

i have page in block.html in extension directory. want match content script page name.

check manifest file below, there content_script match:

{ "manifest_version": 2, "name": "cobra security atd", "version": "1.0", "description": "cobra security advance threat defence.", "icons": { "48": "img/48-48.png", "128": "img/128-128.png" }, "browser_action": { "default_icon": "img/16-16.png", "default_title": "cobra security advance threat defence", "default_popup": "popup.html" }, "background": { "scripts": ["js/jquery-1.11.1.js","js/event.js"], "persistent": false }, "content_scripts": [ { "matches": ["http://*/*block.html"], "js": ["js/jquery-1.11.1.js","js/block.js"] } ], "permissions": [ "<all_urls>", "tabs", "webnavigation" ] }

one not inject content scripts chrome-extension:// pages. cannot indicate schema in manifest, , can't indicate host permission allow inject it.

since it's extension control, don't need inject scripts anything!

if want set code in it, you.. set code in it, in <script src="..."> fashion.

if want inform page of event, utilize messaging.

if want pass info when open page, can utilize this trick, sending request data.

google-chrome google-chrome-extension

Comments

Popular posts from this blog

xslt - DocBook 5 to PDF transform failing with error: "fo:flow" is missing child elements. Required content model: marker* -

mediawiki - How do I insert tables inside infoboxes on Wikia pages? -

Local Service User Logged into Windows -