简体   繁体   English

Chrome扩展程序安装错误消息

[英]Chrome extension installation error message

I built a small Chrome extension - it shows your IP and geolocation information. 我构建了一个小型Chrome扩展程序 - 它显示了您的IP和地理位置信息。 I tested it several times, packaged it (using Grunt) and uploaded to the Chrome web store. 我测试了几次,将其打包(使用Grunt)并上传到Chrome网上商店。 I verified several time that the resulting zip file contains all the files needed by the app + the manifest. 我几次验证了生成的zip文件包含app +清单所需的所有文件。

I then removed my local version, and tried installing from the web store. 然后我删除了我的本地版本,并尝试从网上商店安装。 I keep getting this error, even after refreshing, and restarting the browser several times: 即使刷新后,我仍然会收到此错误,并多次重新启动浏览器:

"There was a problem adding this item to Chrome. Please refresh the page and try again." “将此项目添加到Chrome时出现问题。请刷新页面然后重试。”

在此输入图像描述

How do I debug/solve this problem? 我该如何调试/解决这个问题?

  • The code to my extension is very simple, and is actually open on GitHub . 扩展程序的代码非常简单,实际上是在GitHub上打开的。
  • The manifest file is available here . 清单文件可在此处获得
  • The extension is available on the Chrome store here . 此扩展程序可在Chrome商店中找到

Update : 更新

Looking at the JS console, I see an error every time I hit the install button: 查看JS控制台,每次按下安装按钮时都会看到错误:

webstorePrivate.beginInstallWithManifest3: Invalid manifest webstorePrivate.beginInstallWithManifest3:无效的清单

No further information, and to me the manifest file looks ok (and it works when loaded locally). 没有进一步的信息,并且对我来说清单文件看起来没问题(并且它在本地加载时有效)。

Ok, took a while, but I found the culprit and fixed it. 好的,花了一段时间,但我找到了罪魁祸首并修复了它。 I used Yeoman and Generator-Chrome-Extension to bootstrap the extension. 我使用Yeoman和Generator-Chrome-Extension来引导扩展。 One of the tasks in the Gruntfile.js reads like this: Gruntfile.js中的任务之一如下所示:

grunt.registerTask('manifest', function() {
        var manifest = grunt.file.readJSON(yeomanConfig.app + '/manifest.json');
        //manifest.background.scripts = ['scripts/background.js'];
        grunt.file.write(yeomanConfig.dist + '/manifest.json', JSON.stringify(manifest, null, 2));
    });

As you can see on the third (commented) line, the task injects a background.js script EVEN if you do not need it. 正如您在第三行(注释)中看到的那样,任务会注入一个background.js脚本,如果您不需要它。 Furthermore if you, like me, use a background page , this renders the manifest invalid. 此外,如果您像我一样使用背景页面 ,则会使清单无效。

For some reason, it will work locally, just not from the store. 出于某种原因,它将在本地工作,而不是从商店。 Once I commented that line, the manifest is valid, and the extension available. 一旦我评论该行,清单就有效,并且扩展可用。

I had the same problem. 我有同样的问题。 I removed: 我删除了:

"app": {
    "urls": [
    ],

From the Manifest.json file and it works. 从Manifest.json文件,它的工作原理。 Hope this helps. 希望这可以帮助。

I had the same problem and I logging in with a proxy and the problem fixed. 我遇到了同样的问题,我使用代理登录并修复了问题。

Try a proxy as i guess. 我猜是尝试代理。

Please try logging out/signing out of the Web Store and signing back in. 请尝试注销/退出网上应用店并重新登录。

source: https://productforums.google.com/forum/#!topic/chrome/vFBudQDy5UE 来源: https//productforums.google.com/forum/#!topic/chrome/vFBudQDy5UE

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM