javascript Chrome 扩展禁用“此扩展可能已损坏” Chrome 63.0.3239.84

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/47757849/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-29 07:34:47  来源:igfitidea点击:

Chrome extension disabled "This extension may have been corrupted" Chrome 63.0.3239.84

javascriptgoogle-chromegoogle-chrome-extension

提问by Tob

I have a private Chrome extension that opens a text box and uses input from the textbox to open URLs in new tabs. It was working fine until this past weekend when the Chrome update prompted a new "This extension may have been corrupted" error. On Windows, Chrome will disable the extension, on OSX it will crash Chrome. On both, loading the extension unpacked works fine, only when it is packed into a .crx does it prompt the error.

我有一个私人 Chrome 扩展程序,它打开一个文本框并使用来自文本框的输入在新选项卡中打开 URL。直到上周末 Chrome 更新提示新的“此扩展程序可能已损坏”错误时,它才能正常工作。在 Windows 上,Chrome 将禁用扩展程序,在 OSX 上它会使 Chrome 崩溃。在这两种情况下,加载解压缩的扩展工作正常,只有当它被打包到 .crx 时才会提示错误。

As far as I can tell, there are no misspelled file paths. What could be the issue?

据我所知,没有拼写错误的文件路径。可能是什么问题?

manifest.json

清单文件.json

{
"browser_action":
{
"default_icon": "multi_search.png",
"default_popup": "multi_search.html"
},
"description": "Opens multiple urls in new tabs.",
"manifest_version": 2,
"name": "Multi Search",
"permissions": [ "tabs" ],
"version": "1.2"
}

回答by ProgrammerMan

I had the same problem too, I found the answer at the bottom of this Google Chrome thread: https://productforums.google.com/forum/?hl=en#!topic/chrome/kGgLwnrDKpQ;context-place=forum/chrome

我也有同样的问题,我在这个谷歌浏览器线程的底部找到了答案:https: //productforums.google.com/forum/?hl=en#!topic/chrome/kGgLwnrDKpQ; context-place=forum/铬合金

Basically you will need to add an update_url value to your manifest.json. The URL can be any valid URL you want if you're not making using of that value, e.g. "http://0.0.0.0".

基本上,您需要在 manifest.json 中添加一个 update_url 值。如果您不使用该值,则该 URL 可以是您想要的任何有效 URL,例如“ http://0.0.0.0”。

In your case this would be:

在您的情况下,这将是:

{
"browser_action":
{
"default_icon": "multi_search.png",
"default_popup": "multi_search.html"
},
"description": "Opens multiple urls in new tabs.",
"manifest_version": 2,
"name": "Multi Search",
"update_url": "http://www.example.com/update.xml",
"permissions": [ "tabs" ],
"version": "1.2"
}

If you want information on actually making use of that feature, Google has this Autoupdating developer page: https://developer.chrome.com/extensions/autoupdate

如果您想了解实际使用该功能的信息,Google 有这个 Autoupdating 开发者页面:https: //developer.chrome.com/extensions/autoupdate

回答by Shashi Kumar

I have also faced this problem. but after the update chrome browser, this problem was resolved. you can try, this may be the best solution for this problem.

我也遇到过这个问题。但是更新chrome浏览器后,这个问题就解决了。你可以试试,这可能是这个问题的最佳解决方案。