简体   繁体   中英

Why can't this chrome extension be installed?

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

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.

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

add in you 'manifest.json':

'manifest_version': 2

example:

{
    "name": "name your extension",
    "version": "1.0",
    "description": "description your building",
    "manifest_version": 2,
    "browser_action":{
       "default_icon": "icon777.png",
       "popup": "body.html"
    }
 }

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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