2015-11-24 70 views
1

当我点击一个链接时,我的content.js没有运行。网址更改(点击F5时运行content.js)。获得更新的内容位于框架内部。扩展未加载URL更改

如何在不按F5的情况下触发我的content.js运行?

{ 
"name":"My name", 
"description":"My description!", 
"version":"1", 
"manifest_version":2, 
"browser_action": { 
"default_icon": "icon.png" 
}, 
"content_scripts": [ 
{ 
    "matches": ["http://www.somePage.com/article*"], 
    "js": ["content.js"] 
}]} 

回答

1

你能尝试到“all_frames”设置为true,以便当在网页的框架更新内容脚本将被再次注入就像下面这个:

"content_scripts": [ 
{ 
    "matches": [ "http://www.somePage.com/article*" ], 
    "all_frames": true, 
    "js": [ "content.js" ] 
}