LoginSignup
1
0

More than 5 years have passed since last update.

Chrome拡張をインストールする際に「Invalid manifest」のエラーが出て困った

Last updated at Posted at 2017-03-29

現象

自作のChrome拡張をzipでアップロード → 公開 → 自分の環境にインストールしようとしたところ
Invalid manifestというエラーが出てインストールできない現象に陥った

スクリーンショット 2017-03-29 11.11.31.png

実際のmanifestファイル

manifest.json
{
    "manifest_version": 2,
    "name": "invalid_manifest",
    "version": "1.0.0",

    "description": "Invalid Manifestを意図的に起こす拡張",

    "icons": {
        "16": "icons/invalid_manifest.png",
        "48": "icons/invalid_manifest.png",
        "128": "icons/invalid_manifest.png"
    },

    "content_scripts": [
        {
            "matches": ["http://www.google.co.jp"],
            "js": ["js/invalid_manifest.js"],
            "run_at": "document_end"
        }
    ]
}

原因

Match Patternsの構文が間違っていたようだった
https://developer.chrome.com/extensions/match_patterns
このページのBad Patternの書き方をしているとアップロード時のバリデーションには通るがインストール時のバリデーションで失敗するようだ

ひとつ注意点があるとすると
http://www.google.com
これはpathがなくてエラーになるので
http://www.google.com/
こうする(末尾にスラッシュをつける)とうまくいく

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0