如何在我的Manifest.JSON中包含此HTML文件

时间:2016-05-18 11:41:36

标签: html google-chrome google-chrome-extension

亲爱的Stackoverflow用户,

我有一个HTML文件,我想将其包含在manifest.Json文件中。我在哪里这样做?这是我的清单文件:

{
"manifest_version": 2,
    "name": ".......",
    "description": ".......",
    "version": "1.1",


    "background": {
        "scripts": [
            "blockpics.js"]
        "page": "nyes.html"
    },
    "browser_action": {
        "default_icon": {
            "19": "images/icon19-disabled.png"
        },
        "default_title": "PAD_SEF05"
    },



    "permissions": [
        "tabs",
        "http://*/*",
        "https://*/*",
        "webRequest",
        "webRequestBlocking",
        "<all_urls>"
    ]
}

这是我的nyes.html:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" >
<html xmlns="http://www.w3.org/1999/xhtml">
<head><title>Ajax Test
    </title>
    <script type="text/javascript">
<!--
    function showImage(){
        document.getElementById('loadingImage').style.visibility='visible';
    }

    -->

    </script>
    </head>
<body>
    <input type="button" value="Ajax Button" onclick="showImage();"/>
    <img id="loadingImage" src="ajax-loader.gif" style="visibility:hidden"/>

</body>

那我该怎么做?提前谢谢!

1 个答案:

答案 0 :(得分:0)

您可以尝试将其添加到清单中:

"web_accessible_resources": [
    "nyes.html"
  ]