我的內容腳本會在頁面中插入一些按鈕。當我點擊按鈕時,它會執行一些操作,例如console.log(「...」),也許它會使用鼠標選擇。我的內容腳本如何在iframe中工作?
當頁面有iframe時可以工作嗎?
我的內容腳本會在頁面中插入一些按鈕。當我點擊按鈕時,它會執行一些操作,例如console.log(「...」),也許它會使用鼠標選擇。我的內容腳本如何在iframe中工作?
當頁面有iframe時可以工作嗎?
您應該在manifest.json
中將all_frames: true
添加到您的content scripts聲明中。
"content_scripts": [
{
"matches": [
"http://*/*",
"https://*/*"
],
"all_frames": true,
"js": [
"content_script.js"
]
}
]
取決於iframe內容是否在同一個域中。 – Daedalus 2012-07-30 03:33:19
就像http://developer.apple.com/library/ios/#technotes/tn2239/_index.html – Tom 2012-07-30 03:40:18
這不能回答我的問題。 – Daedalus 2012-07-30 03:58:33