English 中文(简体)
将本地存储通过本地存储到当量
原标题:passing local storage to contenscript

我正在开发一个铬扩展名, 我想知道, < br/ > 有任何方法可以从“ 强” 地底页面

< a href=" "http://code.google.com/chrome/extensions/ messsaging.html" rel="nofol" >内容脚本和扩展页之间传递的信息

以便我能够使用内容脚本中本地存储的所有关键/价值?

问题回答

从背景页面发送此信息 :

sendResponse({all_lS: JSON.stringify(localStorage));

内容说明:

var lS =  JSON.parse(response.all_lS);   

这将是你们本地的系统复制件





相关问题
Is there an equivalent to localStorage in React Native?

I d like to implement the equivalent to the javascript localStorage in my React Native app. But I m unsure how to set. To function how I want it to, I would like the localStorage to be stored every ...

Local Database Storage default data

I have developed application using HTML 5 Localstorage. How can I create a TABLE and populate 10000+ rows before initializing my HTML 5 enabled application. Please suggest a pattern.

When do items in HTML5 local storage expire?

For how long is data stored in localStorage (as part of DOM Storage in HTML5) available? Can I set an expiration time for the data which I put into local storage?

Sharing variables between web workers? [global variables?]

Is there any way for me to share a variable between two web workers? (Web workers are basically threads in Javascript) In languages like c# you have: public static string message = ""; static void ...

How to store objects in HTML5 localStorage/sessionStorage

I d like to store a JavaScript object in HTML5 localStorage, but my object is apparently being converted to a string. I can store and retrieve primitive JavaScript types and arrays using localStorage, ...

Limit of localstorage on iPhone?

I m wondering what s the limit of localstorage HTML 5 on iPhone? I read that it was like 5 Mb, but I m surprised is so little. Any ideas?

HTML5 localStorage & SQL

I understand that HTML5 "localStorage" is a key:value store but I am wondering if there is a Javascript library available that offers a more SQL-ish API?

热门标签