我花了好几个小时试图找出为什么我的Chrome扩展不能工作,因为它应该只是发现,显然谷歌Chrome网站不允许扩展做某些事情,而它是开放的。
我读过这篇文章,虽然它已经2年了,并且发布的解决方案对我没有用:基于https://chrome.google.com/webstore/的Chrome扩展内容脚本
我在OS上运行Chrome版本的41.0.2272.118 (64-bit)。正如其中一个响应所示,我已经运行了命令open /Applications/Google\ Chrome.app --args --allow-scripting-gallery;,但是扩展的内容脚本仍然不能在webstore中运行。我所要做的就是使用chrome.runtime.sendMessage和chrome.runtime.onMessage在内容脚本和后台脚本之间进行通信。
谷歌是否决定完全删除这些功能,或者现在是否有一个新的命令?
发布于 2015-04-05 22:51:55
是的,他们把它移走了。我猜是被滥用了。
您可以参考chrome://flags上当前支持的标志列表。
或者,在http://peter.sh/experiments/chromium-command-line-switches/上有一个直接从源中提取的列表
为了获得更多的证据,下面是同一个源文件的更新版本:
bool ChromeExtensionsClient::IsScriptableURL(
const GURL& url, std::string* error) const {
// The gallery is special-cased as a restricted URL for scripting to prevent
// access to special JS bindings we expose to the gallery (and avoid things
// like extensions removing the "report abuse" link).
// TODO(erikkay): This seems like the wrong test. Shouldn't we we testing
// against the store app extent?
GURL store_url(extension_urls::GetWebstoreLaunchURL());
if (url.host() == store_url.host()) {
if (error)
*error = manifest_errors::kCannotScriptGallery;
return false;
}
return true;
}正如您所看到的,任何基于开关的逻辑都不再存在;CWS URL总是被认为是非脚本的。
https://stackoverflow.com/questions/29462932
复制相似问题