5

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

4

2 回答 2

17

错误消息是不言自明的:

'manifest_version' 键必须存在并设置为 2(不带引号)。有关详细信息,请参阅developer.chrome.com/extensions/manifestVersion.html

参考文档在页面顶部提供了一个非常清晰的示例:

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

这些点表示为了示例而省略了清单文件的某些部分。您必须编辑manifest.json文件,并"manifest_version": 2在文件中的某个位置插入。

例如,在您的情况下,您可以在"version"键之前添加一行并将"manifest_version": 2声明放在那里。

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

请注意,行尾有一个逗号。在JSON数据格式中,每个名称/值对都由逗号分隔。

于 2013-09-23T20:54:08.990 回答
0

添加你的'manifest.json':

'manifest_version': 2

例子:

{
    "name": "name your extension",
    "version": "1.0",
    "description": "description your building",
    "manifest_version": 2,
    "browser_action":{
       "default_icon": "icon777.png",
       "popup": "body.html"
    }
 }
于 2018-03-30T02:52:41.537 回答