简体   繁体   English

Pixel Slate上的清单无效(Chrome操作系统)

[英]Invalid Manifest on Pixel Slate (Chrome OS)

Users of my Chrome extension are reporting problems installing it on a Pixel Slate device. 我的Chrome扩展程序的用户报告说在Pixel Slate设备上安装它时出现问题。 The error just says "Invalid Manifest", and the extension cannot be installed. 该错误仅显示“ Invalid Manifest”,并且无法安装扩展名。

However, there is no such error on a Windows or OSX device, and the manifest seems to be valid based on my inspection. 但是,在Windows或OSX设备上没有此类错误,根据我的检查,清单似乎是有效的。

Does anyone have any idea what the problem may be? 有谁知道可能是什么问题?

Manifest follows: 清单如下:

{
  "manifest_version": 2,

  "name": "ProTABS - Tab Management for Pro's",
  "short_name": "ProTABS",
  "description": "\"I got 99 problems, but a tab ain't one.\"  An intelligent tab manager for the everyday user.",
  "version": "1.5.1",

  "minimum_chrome_version": "55",

  "icons": {
    "16": "./static/icons/icon16.png",
    "32": "./static/icons/icon32.png",
    "48": "./static/icons/icon48.png",
    "128": "./static/icons/icon128.png"
  },

  "browser_action": {
    "default_popup": "frontend.html"
  },

  "background": {
    "page": "backend.html",
    "persistent": false
  },

  "commands": {
    "_execute_browser_action": {
      "suggested_key": {
        "windows": "Ctrl+Shift+A",
        "mac": "Command+Shift+A",
        "linux": "Ctrl+Shift+A"
      }
    }
  },

  "permissions": ["tabs", "webNavigation", "storage", "alarms"]
}

I discovered the cause of the problem after taking a suggestion to try the extension in a Chrome OS Emulator and attempting to load it as a Packed Extension. 我在尝试在Chrome OS模拟器中尝试扩展并将其加载为打包扩展后,发现了问题的原因。

In this case, the bad manifest was caused by the section: 在这种情况下,错误的清单是由以下部分引起的:

"commands": {
  "_execute_browser_action": {
    "suggested_key": {
      "windows": "Ctrl+Shift+A",
      "mac": "Command+Shift+A",
      "linux": "Ctrl+Shift+A"
    }
  }
}

The problem was that chromeos was not specified as a platform in the map of suggested_key and a default key was not specified. 但问题是, chromeos没有被指定为在地图平台suggested_keydefault未指定密钥。

In my case, I was able to simplify the setting as follows (because on Mac, Chrome maps Ctrl to Command ): 就我而言,我可以简化设置,如下所示(因为在Mac上,Chrome将Ctrl映射为Command ):

"commands": {
  "_execute_browser_action": {
    "suggested_key": {
      "default": "Ctrl+Shift+A",
    }
  }
}

Adding a default ensures that the manifest will be valid for any future platforms as well, so long as they have keys compatible with those in the default. 添加default可确保清单也对将来的任何平台有效,只要它们具有与默认值兼容的密钥即可。

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

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