MCPcopy Index your code
hub / github.com/darkreader/darkreader / writeImageDetailsQueue

Function writeImageDetailsQueue

src/inject/cache.ts:33–46  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

31const cachedImageUrls: string[] = [];
32
33function writeImageDetailsQueue() {
34 imageDetailsCacheQueue.forEach((details, url) => {
35 if (url && url.startsWith('https://')) {
36 try {
37 const json = JSON.stringify(details);
38 sessionStorage.setItem(`${STORAGE_KEY_IMAGE_DETAILS_PREFIX}${url}`, json);
39 cachedImageUrls.push(url);
40 } catch (err) {
41 }
42 }
43 });
44 imageDetailsCacheQueue.clear();
45 sessionStorage.setItem(STORAGE_KEY_IMAGE_DETAILS_LIST, JSON.stringify(cachedImageUrls));
46}
47
48export function writeImageDetailsCache(url: string, imageDetails: ImageDetails): void {
49 if (!url || !url.startsWith('https://')) {

Callers

nothing calls this directly

Calls 1

clearMethod · 0.45

Tested by

no test coverage detected