2015-05-12 12 views
0

內容腳本通常會列出確切的URL或全面接受某些類型的URl的例子,下面的示例針對每個網頁。我希望「匹配」是一個數據集。 「manifest_version」:2,如何根據某些數據文件中保存的URL爲Chrome擴展製作內容腳本?

"name": "Getting started example", 
"description": "This extension shows a Google Image search result for the current page", 
"version": "1.0", 

"browser_action": { 
    "default_icon": "icon.png", 
    "default_popup": "popup.html " 
}, 
"permissions": [ 
    "activeTab", 
    "https://ajax.googleapis.com/" 
], 
"content_scripts": [ 
    { 
     "matches": ["*://*/*"] 
    } 
] 

回答

0

你可以列出你想作爲一個數組使用的URL:

"content_scripts": [ 
    { 
     "matches": [ 
         "http://www.google.com/*", 
         "http://stackoverflow.com/*" 
        ] 
    } 
] 
相關問題