Search code examples
google-chromegoogle-chrome-extensiongoogle-chrome-osgoogle-pixel

Invalid Manifest on Pixel Slate (Chrome OS)


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"]
}

Solution

  • 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.