0

Users of my Chrome extension are reporting problems installing it on a Pixel Slate device. The error just says "Invalid Manifest", and the extension cannot be installed.

However, there is no such error on a Windows or OSX device, and the manifest seems to be valid based on my inspection.

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"]
}
  • 1
    JSON looks valid. Could be a bug in ChromeOS. Try investigating in an OS emulator. – wOxxOm Jan 22 '19 at 10:16
  • Thanks for the suggestion, I figured out what it was. The `suggested_key` section needed either a `default` key or a platform-specific key for chrome os. Once I added that the manifest was accepted. – Bogdan Kiselitsa Jan 27 '19 at 02:26
  • 1
    Sounds like a useful info. Please add an answer. – wOxxOm Jan 27 '19 at 04:14

1 Answers1

0

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.

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.

In my case, I was able to simplify the setting as follows (because on Mac, Chrome maps Ctrl to 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.