diff --git a/manifest.json b/manifest.json index c6577fe..9b2e0e6 100644 --- a/manifest.json +++ b/manifest.json @@ -4,7 +4,8 @@ "version": "1.0", "manifest_version": 3, "permissions": [ - "tabs" + "tabs", + "storage" ], "action" : { "default_title": "EtherScan Scraper", diff --git a/popup.css b/popup.css index 15bce83..8dec59b 100644 --- a/popup.css +++ b/popup.css @@ -58,7 +58,8 @@ input[type=text] { } #scrapeButton { - height: 40vh; + height: 30px; + width: 95vw; } #prompt { diff --git a/popup.html b/popup.html index 59b6e53..720b0a1 100644 --- a/popup.html +++ b/popup.html @@ -14,9 +14,7 @@

EtherScan Address Notes Scraper

-
- -
+

Open 'etherscan.io/mynotes_address'? @@ -33,6 +31,9 @@

+
+ +
\ No newline at end of file diff --git a/popup.js b/popup.js index 1733b55..ff5a831 100644 --- a/popup.js +++ b/popup.js @@ -14,7 +14,16 @@ document.addEventListener('DOMContentLoaded', async() => { let addressNotes; // address notes returned from a scrape let displayNotes; // address notes being displayed in a table, whether all or just those returned from a search - + chrome.storage.sync.get(/* String or Array */["data"], function(items){ + // items = [ { "phasersTo": "awesome" } ] + addressNotes = items.data; + displayNotes = items.data; + // alert(displayNotes.length); + if(addressNotes.length > 0){ + generateNotesTable(); + } + // console.log(items); + }); /** * Retrieves the currently focused tab * @returns {Promise<*>} @@ -119,14 +128,22 @@ document.addEventListener('DOMContentLoaded', async() => { * Either displays all scraped address note values, or address note values returned in a search. */ function generateNotesTable() { + chrome.storage.sync.set({ "data": displayNotes}, function(){ + // alert("hello"); + }); if (addressNotes.length === 0) { generateError("There are no address notes"); } else { + + // chrome.storage.sync.set({ "data2": displayNotes}, function(){ + // // alert("hello"); + // }); + document.getElementById("notes").style.display = "block"; document.getElementById("search").style.display = "block"; - document.getElementById("scrape").style.display = "none"; + // document.getElementById("scrape").style.display = "none"; document.getElementById("downloadButton").style.display = "block"; - + scrapeButton.innerText = "SCRAPE"; let div = document.getElementById("notes-table"); let table = document.createElement("table"); let tableBody = document.createElement("tbody");