Why can't this chrome extension be installed?

12,182

The error message is self-explanatory:

The 'manifest_version' key must be present and set to 2 (without quotes). See developer.chrome.com/extensions/manifestVersion.html for details.

The referenced documentation provides a very clear example at the top of the page:

{
  ...,
  "manifest_version": 2,
  ...
}

These dots indicate that parts of the manifest file were omitted for the sake of the example. You have to edit your manifest.json file, and insert "manifest_version": 2 somewhere in the file.

For example, in your case, you can add a line before the "version" key and put the "manifest_version": 2 declaration over there.

   ...
   "manifest_version": 2,
   "version": "1.0"
}

Note that there's a comma at the end of the line. In the JSON data format, every name/value pair is separated by a comma.

Share:
12,182
Ricochet_Bunny
Author by

Ricochet_Bunny

Updated on June 08, 2022

Comments

  • Ricochet_Bunny
    Ricochet_Bunny almost 2 years

    I have a couple very short + simple extensions that I can't install to chrome. I am given the following error about the 'manifest version', so I assume that the problem is that it is outdated, I haven't any experience in chrome extensions/javascript so I couldn't fix them myself as I would normally try to do, these were written for me by a friend a while back.

    Could someone let me know how I should correct these files?

    Error:

    The 'manifest_version' key must be present and set to 2 (without quotes). See developer.chrome.com/extensions/manifestVersion.html for details.
    

    Extension files:

    manifest.json for extension 1:

    {
    "content_scripts": [ {
      "exclude_globs": [  ],
      "include_globs": [ "*slavehack*index2.php\\?page=internet&openFolder=&var3=files&aktie=*&*=*" ],
      "js": [ "script.js" ],
      "matches": [ "http://*/*", "https://*/*" ]
    } ],
    "converted_from_user_script": true,
    "description": "",
    "key": "XKBlE2kyhcJNHGYLuLylZhjFVQV7puTEQbsFuGRcKoY=",
    "name": "Slavehack Process Log Protector",
    "version": "1.0"
    }
    

    script.js for extension 1:

    // ==UserScript==
    // @name           Slavehack Process Log Protector
    // @include        *slavehack*index2.php?page=internet&openFolder=&var3=files&aktie=*&*=*
    // @version                1.0
    // ==/UserScript==
    var allA = document.getElementsByTagName('a');
    for (var i = 0; i < allA.length; i++) {
        if ( allA[i].innerHTML.match('Access logfile') ) {
            window.location.href = allA[i].href;
        }
    }
    

    manifest.json for extension 2:

    {
      "content_scripts": [ {
      "exclude_globs": [  ],
      "include_globs": [ "*slavehack*index2.php\\?page=internet&var3=&aktie=FP&var2=*&transfer=*&tonumber=*&toip=*" ],
      "js": [ "script.js" ],
      "matches": [ "http://*/*", "https://*/*" ]
       } ],
       "converted_from_user_script": true,
       "description": "",
       "key": "WxQnzwPDzxXFW/TSZw6dNJJJSyVIXlub/QQGMlVtjbc=",
       "name": "Bank IP Log Crack Remover",
       "version": "1.0"
    }
    

    script.js for extension 2:

    // ==UserScript==
    // @name           Bank IP Log Crack Remover
    // @include        *slavehack*index2.php?page=internet&var3=&aktie=FP&var2=*&transfer=*&tonumber=*&toip=*
    // @version                1.0
    // ==/UserScript==
    var bankip = window.location.href.split('=')[window.location.href.split('=').length - 1]
    window.location.href = 'http://www.slavehack.com/index2.php?page=internet&var2='+bankip.replace('#','')+'&var3=crack&var4=';
    

    Many thanks for any help

    • Rob W
      Rob W over 10 years
      The error message is self-explanatory... It even contains a link to documentation that features an example on the expected format.
    • Ricochet_Bunny
      Ricochet_Bunny over 10 years
      Yeah, I gave it my best go at trying to correct the files with the info in the docs but I really don't have any experience in JavaScript and I've never worked with browser extensions so I just couldn't do it. Do you think you could help me out? I'd really appreciate it
  • Ricochet_Bunny
    Ricochet_Bunny over 10 years
    My apologies, I did in fact try that before I came here for help but it gave me an error message even after I had done so, but I just tried it again and it seems to have worked. I suppose I must have done something wrong the first time. Thanks a lot for your time I appreciate it.
  • satender
    satender over 8 years
    this worked for me : "manifest_version": 2, "version": "1.0"