gpt4 book ai didi

javascript - Chrome 扩展创建 - 未捕获的类型错误 : Cannot read property 'create' of undefined

转载 作者:行者123 更新时间:2023-11-28 04:26:08 26 4
gpt4 key购买 nike

content.js: chrome.tabs.create({ url: 'http://www.sethjfreeman.com' });

ma​​nifest.json

{
"manifest_version": 2,

"name": "Secure Video Downloader",
"description": "Download Videos Virus Free",
"version": "1.0",
"content_scripts": [
{
"matches": ["https://gostream.is/*", "http://gostream.is/*"],
"js": ["content.js", "jquery-3.2.1.min.js"],
"run_at": "document_end"
}
],
"browser_action": {
"default_icon": "secure_16.png",
"default_popup": "popup.html"
},
"permissions": [
"tabs", "http://*/*"
]

}

描述:
当页面加载时,我在尝试打开新选项卡时收到此错误

最佳答案

您无权访问外部注入(inject)网站上的 chrome.tabs

您需要将消息传递给后台脚本并调用chrome.tabs.create({ url: 'http://www.sethjfreeman.com' }); 从那里。

检查Message Passing

关于javascript - Chrome 扩展创建 - 未捕获的类型错误 : Cannot read property 'create' of undefined,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45044585/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com