0

Google Chrome の拡張機能を作成していますが、小さな問題があります。実際、拡張機能は機能しますが、調べてみると次のエラーが表示されます。

次のコンテンツ セキュリティ ポリシー ディレクティブに違反しているため、インライン スクリプトの実行を拒否しました: "script-src 'self' chrome-extension-resource:"。

このエラーの原因はわかりません。これは私のmanifest.jsonにあるものです:

{
    "manifest_version": 2,

    "name": "Pokémon Search",
    "short_name": "PokéSearch",
    "description": "This extension searches for the desired Pokémon at Bulbapedia and Serebii.",
    "version": "1.1.0",

    "permissions": [ "tabs" ],
    "icons": {
    "16": "16.png",
    "48": "48.png",
    "128": "128.png"
    },
    "browser_action": {
        "default_icon": "icon.png",
        "default_popup": "popup.html"
    }
}

これは私が popup.html に持っているものです:

<!doctype html>
<html>
    <head>
        <script type='text/javascript' src='jquery.js'></script>
        <script type='text/javascript' src='listOfPokemon.js'></script> 
        <script type='text/javascript' src='listOfMove.js'></script> 
        <script type='text/javascript' src='listOfItem.js'></script> 
        <script type='text/javascript' src='mcs.js'></script>   
        <script type='text/javascript' src='popup.js'></script> 

        <link rel='stylesheet' type='text/css' href='popup.css' />
    </head>

    <body>
        <h5>Pok&eacutemon Search</h5>

        <form id='mainForm'>
            <div align='center'><h6>What do you want to search?</h6><br /></div>
            <input type='radio' name='searchType' id='searchPokemon' value = 'pokemon' checked='checked' /><h6>Pok&eacutemon</h6><br />
            <input type='radio' name='searchType' id='searchMove' value = 'move' /><h6>Move</h6><br />
            <input type='radio' name='searchType' id='searchItem' value = 'item' /><h6>Item</h6>
            <input type='text' id='pokemonName' />
            <input type='radio' name='destinyPage' id='radioBulbapedia' value='bulbapedia' checked='checked'/><h6>Search on Bulbapedia</h6>
            <input type='radio' name='destinyPage' id='radioSerebii' value='serebii'/><h6>Search on Serebii</h6><br /><br />
            <div align='center'><h6>Generation (Serebii only)</h6>
            <input type='number' name='generation' id='gen' value='6' max='6' min='1'/><br />
            <input type='button' id='submitButton' value='Search' /></div>
        </form>

    </body>
</html>

popup.js: https://www.dropbox.com/s/tczqpaom0igy2bh/popup.js これは、popup.html の要素に影響を与える唯一のファイルです。

4

0 に答える 0