9

How to inspect extension `chrome.storage` in Chrome DevTools

 1 year ago
source link: https://serebrov.github.io/html/2023-06-13-chrome-extension-inspect-storage.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

How to inspect extension `chrome.storage` in Chrome DevTools

Posted on 2023, Jun 13 One min read

The extension storage is not displayed under the “Application” tab in Chrome DevTools, but it is possible to access the extension storage using a javascript console, here is how:

it is possible to access it via the javascript console:

  • Open some web page, open Chrome DevTools
  • In the javascript console, select the extension context (the drop-down with “top” in it)
  • Use chrome.storage.local to access the local storage

The chrome.storage.local is a StorageArea object and it has methods to get and set values.

We can also print the entire storage by passing the null to the get method with chrome.storage.local.get(null).then((data) => console.log(data)).

extension storage access

The demo:

There should have been a video here but your browser does not seem to support it.
Tags: web

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK