Search code examples
google-chromegoogle-chrome-extensionmanifest

"Extension Install Failure: Package is invalid. Details: 'Invalid value for 'page_action.default_icon'.'"


I've written Chrome extensions before but this is my first time using manifest version 2. So, I thought I should research first-hand how far back v2 is supported so that I can apply a minimum_chrome_version.

However, for some reason, whenever I try to install my extension on any version of Chrome < v23 (the current, I believe), I'm getting an error of Package is invalid. Details: 'Invalid value for 'page_action.default_icon'.'. (see screenshots) when trying install the extension from the original source, the packed CRX, or the unpacked CRX.

The strange thing is, I'm not even using page_action - I'm using browser_action...

I'm getting this error on Chrome versions:

  • 10.0.648.133
  • 15.0.874.106
  • 18.0.1025.168
  • 19.0.1084.56
  • 20.0.1132.47
  • 21.0.1180.77
  • 22.0.1229.0

and probably everything other version.

 

Anyway, here's my manifest.json :

{
    /* Appearance */
    "name": "Save as Shortcut",
    "description": "Save the current page's URL as a shortcut file (*.url)",
    "icons": {  "16": "images/icons/icon_16.png",
                "48": "images/icons/icon_48.png",
                "128": "images/icons/icon_128.png" 
             },

    /* Linked code */
    "browser_action": {
        "default_icon": {
            "19": "images/icons/icon_19.png",
            "38": "images/icons/icon_38.png"
        },
        "default_title": "Save this page's URL as a shortcut file (*.url)",
        "default_popup": "html/popup.html"
    },

    /* Technical details */
    "version": "0.10.200",
    "manifest_version": 2,
    /* "minimum_chrome_version": "23.0.0.0", */

    /* Security */
    "permissions": [
        "tabs"
    ]
}

 

Installing

Error message

(Screenshots taken of Chrome v20.0.1132.43)

 

Edit 1: ...Anyone?

Edit 2: Cmannn. Don't let me tumbleweed. ;/

Edit 3: tumbleweeds

Edit 4: Seriously? No one knows? That's a first..


Solution

  • Even though the syntax was, to the best of my eyesight, identical to Google's own example (apart from the path and filename), the lines that caused the error were:

    "default_icon": {
        "19": "images/icons/icon_19.png",
        "38": "images/icons/icon_38.png"
    },
    

    Using the following block, instead of the previous one, fixed the error (in Chrome v20, at least):

    "default_icon": "images/icons/icon_38.png"
    

    As stated in Google's documentation, Chrome will auto-resize the larger icon to fit smaller requirements, so there shouldn't be any functional or aesthetic loss.

     

    As the first codeblock works seamlessly in Chrome v23, I can only assume that the issue was caused by a glitch in Google's implementation of the version 2 manifest that was present in v < 23 but was fixed in v23.

    Although, I haven't heard of many issues, so I could be wrong.