From ec927221a234a92db89dd799b216efa69d72f54d Mon Sep 17 00:00:00 2001
From: FoxRefire <155989196+FoxRefire@users.noreply.github.com>
Date: Sun, 13 Oct 2024 07:35:53 +0900
Subject: [PATCH] Refactor: Separate history page from main page
---
popup/history.html | 18 ++++++++++++++++++
popup/{showHistory.js => history.js} | 21 +++------------------
popup/main.html | 11 ++---------
3 files changed, 23 insertions(+), 27 deletions(-)
create mode 100644 popup/history.html
rename popup/{showHistory.js => history.js} (55%)
diff --git a/popup/history.html b/popup/history.html
new file mode 100644
index 0000000..164d89a
--- /dev/null
+++ b/popup/history.html
@@ -0,0 +1,18 @@
+
+
+
+ Widevine L3 Guessor - History
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/popup/showHistory.js b/popup/history.js
similarity index 55%
rename from popup/showHistory.js
rename to popup/history.js
index 0a9c5e6..cb9058b 100644
--- a/popup/showHistory.js
+++ b/popup/history.js
@@ -1,24 +1,9 @@
let psshs=chrome.extension.getBackgroundPage().psshs;
function showHistory(){
- chrome.storage.local.get(null, ((data) => {
+ chrome.storage.local.get(null, (data => {
let tree=jsonview.renderJSON(JSON.stringify(data), document.getElementById('histDisp'));
jsonview.toggleNode(tree);
}));
- document.getElementById('home').style.display='none';
- document.getElementById('noEME').style.display='none';
- document.getElementById('history').style.display='grid';
- document.getElementById('toggleHistory').style.display='none';
-}
-
-function backHistory(){
- document.getElementById('histDisp').innerHTML="";
- document.getElementById('history').style.display='none';
- document.getElementById('toggleHistory').style.display='grid';
- if(psshs.length){
- document.getElementById('home').style.display='grid';
- } else {
- document.getElementById('noEME').style.display='grid';
- }
}
function saveHistory(){
@@ -41,7 +26,7 @@ function clearHistory(){
document.getElementById('histDisp').innerHTML="";
}
}
-document.getElementById('historyButton').addEventListener("click", showHistory);
-document.getElementById('backHistory').addEventListener("click", backHistory);
+
document.getElementById('saveHistory').addEventListener("click", saveHistory);
document.getElementById('clearHistory').addEventListener("click", clearHistory);
+showHistory()
diff --git a/popup/main.html b/popup/main.html
index 869d7f6..d32f716 100644
--- a/popup/main.html
+++ b/popup/main.html
@@ -7,7 +7,8 @@
-
+
+
-
-
-
-
-
-
Version =VER= update available!
Download
@@ -83,7 +78,5 @@
Clearkey detected
-
-