1つの入力と3つのリンクを持つ単純なhtmlページを作成しました。
「OK」->ファイル内のすべてのものをローカルストレージに保存します
「WhoamI」->ローカルストレージに保存された値のアラート
「チェック」->その値が「asd」の場合、「asd」で応答するか、「Asd」では応答しない
非常に単純で、これを通常のhtmlページとしてテストしましたが、機能します。すべての関数は正常に動作します。
これがindex.htmlです
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title> System Information </title>
<script src="main.js"></script>
</head>
<body>
<input type="text" name="text" id="text">
<a href="#" onclick="saveChanges(); return false">OK</a>
<a href="#" onclick="who(); return false">WhoAmI</a>
<a href="#" onclick="check(); return false">check</a>
</body>
</html>
これがjavascriptmain.jsです
function saveChanges() {
  var theValue = text.value;
localStorage["ChromeLogin"] = theValue;
}
function who() {
    alert(localStorage["ChromeLogin"]);
}
function check(){
    var test = localStorage["ChromeLogin"];
    if (test == "asd"){
        alert("it is asd");
    }else{
        alert("It is NOT asd");
    }
}

ただし、Google Chrome拡張機能とまったく同じコードをインポートすると、すべてが機能しなくなります。
これが私のmanifest.jsonコードです。
{
  "name": "testLocalStorage",
  "version": "0.0.1",
  "description": "Capture a tab",
  "options_page": "index.html",
  "manifest_version": 2,
  "browser_action": {
  "default_title": "Capture tab"
  },
  "permissions" : ["tabs", "<all_urls>", "storage"]
}
私はこれが問題だと思っています:

私はこれを読み通しましたが、理解できませんでした。
どんな助けでもありがたいです
ありがとう
