If you do not use cookies.

    2 answers 2

    Storage - with access from any extension script (without message transfers between background and injected js).

    chrome.storage.local - for local storage:

    record :

     var a = {}; a["имя_ΠΊΠ»ΡŽΡ‡Π°1"] = "Π—Π½Π°Ρ‡Π΅Π½ΠΈΠ΅1"; a["имя_ΠΊΠ»ΡŽΡ‡Π°2"] = "Π—Π½Π°Ρ‡Π΅Π½ΠΈΠ΅2"; chrome.storage.local.set(a); 

    reading :

     var a = ["имя_ΠΊΠ»ΡŽΡ‡Π°1", "имя_ΠΊΠ»ΡŽΡ‡Π°2"]; chrome.storage.local.get(a, function(b) { var result1 = b["имя_ΠΊΠ»ΡŽΡ‡Π°1"]; var result2 = b["имя_ΠΊΠ»ΡŽΡ‡Π°2"] }); 

    chrome.storage.sync - for synchronized data storage:

    record :

     var a = {}; a["имя_ΠΊΠ»ΡŽΡ‡Π°1"] = "Π—Π½Π°Ρ‡Π΅Π½ΠΈΠ΅1"; a[имя_ΠΊΠ»ΡŽΡ‡Π°2] = "Π—Π½Π°Ρ‡Π΅Π½ΠΈΠ΅2"; chrome.storage.sync.set(a); 

    reading :

     var a = ["имя_ΠΊΠ»ΡŽΡ‡Π°1", "имя_ΠΊΠ»ΡŽΡ‡Π°2"]; chrome.storage.sync.get(a, function(b) { var result1 = b["имя_ΠΊΠ»ΡŽΡ‡Π°1"], var result2 = b["имя_ΠΊΠ»ΡŽΡ‡Π°2"] }); 

      You can use the localStorage API.

      Record:
      localStorage["setting"] = value;

      Reading:
      value = localStorage["setting"];