From 51670161037e74356c0464d72adf5133f74d252c Mon Sep 17 00:00:00 2001 From: Index Date: Mon, 1 Jul 2024 19:42:26 -0500 Subject: [PATCH] style: add Inventory Cache to debug page --- js/extra-pages.js | 143 +++++++++++++++++++++++----------------------- 1 file changed, 71 insertions(+), 72 deletions(-) diff --git a/js/extra-pages.js b/js/extra-pages.js index 1add1ab..c5a5990 100644 --- a/js/extra-pages.js +++ b/js/extra-pages.js @@ -241,89 +241,88 @@ if (window.location.pathname.split('/')[3] === 'polyplus' && window.location.has }); } else if (window.location.pathname.split('/')[3] === 'polyplus' && window.location.hash === '#debug') { document.addEventListener('DOMContentLoaded', function () { - chrome.storage.sync.get(['PolyPlus_Settings', 'PolyPlus_PinnedGames', 'PolyPlus_BestFriends', 'PolyPlus_ItemWishlist'], function(result) { - document.querySelector('#main-content .container').innerHTML = ` - -
-

Poly+ Debug

-

This page is used by developers for debugging most data related things. It is unrecommended you modify any data on this page, but if you ever want to go ahead.

-
-
-
-
-
-

Settings

-
- ${JSON.stringify((result.PolyPlus_Settings || {}), null, 2) - .replaceAll('\n','
') - .replaceAll(' ', ' ') - .replaceAll('\t', '    ')} - -
-
-
-
-
-

Version: v${Version}

-

Data Size: Loading byte(s)

- - Open GitHub -
-
-
- Created by Index + #main-content .container label + p { + margin-bottom: 4px; + font-size: 0.9rem; + margin-top: -4px; + } + +
+

Poly+ Debug

+

This page is used by developers for debugging most data related things. It is unrecommended you modify any data on this page, but if you ever want to go ahead.

-
-
-
-

Pinned Games (${(result.PolyPlus_PinnedGames || []).length})

-
- ${JSON.stringify((result.PolyPlus_PinnedGames || []), null, 2) - .replaceAll('\n','
') - .replaceAll(' ', ' ') - .replaceAll('\t', '    ')} - +
+
+
+
+

Settings

+
+ ${JSON.stringify((sync.PolyPlus_Settings || {}), null, 2) + .replaceAll('\n','
') + .replaceAll(' ', ' ') + .replaceAll('\t', '    ')} + +
+
+
+
+
+

Inventory Cache

+
+ ${JSON.stringify((local.PolyPlus_InventoryCache || {data: [], requested: "never"}), null, 2) + .replaceAll('\n','
') + .replaceAll(' ', ' ') + .replaceAll('\t', '    ')} +
-
-
-

Best Friends (${(result.PolyPlus_BestFriends || []).length})

-
- ${JSON.stringify((result.PolyPlus_BestFriends || []), null, 2) - .replaceAll('\n','
') - .replaceAll(' ', ' ') - .replaceAll('\t', '    ')} - +
+
+
+

Version: v${Version}

+

Data Size: Loading byte(s)

+ + Open GitHub
-
-
-
-

Item Wishlist (${(result.PolyPlus_ItemWishlist || []).length})

-
- ${JSON.stringify((result.PolyPlus_ItemWishlist || []), null, 2) - .replaceAll('\n','
') - .replaceAll(' ', ' ') - .replaceAll('\t', '    ')} - +
+
+

Pinned Games (${(sync.PolyPlus_PinnedGames || []).length})

+
+ ${JSON.stringify((sync.PolyPlus_PinnedGames || []), null, 2) + .replaceAll('\n','
') + .replaceAll(' ', ' ') + .replaceAll('\t', '    ')} + +
+
+
+
+
+

Item Wishlist (${(sync.PolyPlus_ItemWishlist || []).length})

+
+ ${JSON.stringify((sync.PolyPlus_ItemWishlist || []), null, 2) + .replaceAll('\n','
') + .replaceAll(' ', ' ') + .replaceAll('\t', '    ')} + +
-
- `; + `; + }) }) }); } \ No newline at end of file