Chrome 53以上の環境で、起動オプションに下記のパラメータを追加することによって、async/awaitが使用可能となります。(2016/07/06現在) (async() => { await setLocalStorage({ aaa: 1, bbb: 2 }); let aaa = await getLocalStorage("aaa"); let bbb = await getLocalStorage("bbb"); let all = await getLocalStorage(); console.log(aaa);// 1 console.log(bbb);// 2 console.log(all);// {aaa: 1, bbb: 2} })(); function setLocalStorage(obj) { return new Promise( (resolve
See related links to what you are looking for.
localStorageだとオプションでunlimitedStorageを指定していても5MB以上は保存できないみたいで、App cacheやWebSQLを使う必要があるとか 調べてるとchrome.storageでもunlimitedStorageは使えるようなのでこれを使うことにしました データ形式はlocalStorage同様に単純ですが非同期で実行されるので扱いがめんどうです chrome.storageはchromeの拡張機能用のデータを保存する機能です データ保存用の機能はlocalStorage, sessionStoage, webSQL, IndexedDBなどがありますがlocalStorageに近いです 英語のマニュアル localStorageとの違い ○keyとvalueを保存できてlocalStorage自体を1つのオブジェクトのように扱えましたが、保存できるv
chrome.storage の API を使う localStorage を使うとこれはこれで動くのですが、もう少し扱いやすい方法がないか調べたところ、chrome.storage という localStorage に似た方法を見つけました。 chrome.storage – Google Chrome localStorage の場合、background.js を通して Message Passing でデータのやり取りを行う必要がある。 これに対し chrome.storage では background.js なしで、ダイレクトに content_scripts 等から chrome.storage のデータにアクセスできます。また、chrome.storage.onChanged.addListener の API で、データ変更に対するコールバックを簡単に登録できて便利。 以
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く