Chrome拡張機能のchrome.storageに保存したデータの取得、削除方法メモ
2410 ワード
chromeの拡張機能ではchrome.storageというAPIを使ってデータの保存ができる。
テスト中とかにchrome.storageに入れたデータを確認したり削除したくなるかもしれない(というかなった)のでその方法のメモ書き。
ポップアップを検証
とかで開発者ツールを出してConsoleから下記を打てば今保存されているデータが確認できる。
Console
// storage.syncの場合
chrome.storage.sync.get(null, ((data) => {console.log(data)}));
// storage.localの場合
chrome.storage.local.get(null, ((data) => {console.log(data)}));
すべてのデータを削除するには下記のような感じ。
Console
// storage.syncの場合
chrome.storage.sync.clear();
// storage.localの場合
chrome.storage.local.clear();
Author And Source
この問題について(Chrome拡張機能のchrome.storageに保存したデータの取得、削除方法メモ), 我々は、より多くの情報をここで見つけました https://qiita.com/mnao305/items/5d0a8de99fb8ae9fe25e著者帰属:元の著者の情報は、元のURLに含まれています。著作権は原作者に属する。
Content is automatically searched and collected through network algorithms . If there is a violation . Please contact us . We will adjust (correct author information ,or delete content ) as soon as possible .