commit 899c14bab50b5b98819eea868e71b31c9d7045af Author: benjamyn Date: Sat Jun 13 15:35:47 2020 +1000 Initial diff --git a/background.js b/background.js new file mode 100644 index 0000000..bcb4dca --- /dev/null +++ b/background.js @@ -0,0 +1,7 @@ +function openPage() { + browser.tabs.create({ + url: "https://youtube.com" + }); +} + +browser.browserAction.onClicked.addListener(openPage); diff --git a/icons/48.png b/icons/48.png new file mode 100644 index 0000000..90687de Binary files /dev/null and b/icons/48.png differ diff --git a/manifest.json b/manifest.json new file mode 100644 index 0000000..df0f7bf --- /dev/null +++ b/manifest.json @@ -0,0 +1,19 @@ +{ + + "manifest_version": 2, + "name": "Upto", + "version": "0.1", + + "description": "Uploads the URL+timestamp to the uptoserver", + + "icons": { + "48": "icons/48.png" + }, + "browser_action": { + "browser_style": true, + "default_popup": "popup/choose.html", + "default_icon": { + "16": "icons/48.png" + } + } +} diff --git a/popup/choose.html b/popup/choose.html new file mode 100644 index 0000000..ca6eb84 --- /dev/null +++ b/popup/choose.html @@ -0,0 +1,15 @@ + + + + + + + + + +
Load
+
Save
+ + + + diff --git a/popup/choose_page.css b/popup/choose_page.css new file mode 100644 index 0000000..83571f7 --- /dev/null +++ b/popup/choose_page.css @@ -0,0 +1,15 @@ +html, body { + width: 300px; +} + +.page-choice { + width: 100%; + padding: 4px; + font-size: 1.5em; + text-align: center; + cursor: pointer; +} + +.page-choice:hover { + background-color: #CFF2F2; +} diff --git a/popup/choose_page.js b/popup/choose_page.js new file mode 100644 index 0000000..67e219c --- /dev/null +++ b/popup/choose_page.js @@ -0,0 +1,21 @@ +document.addEventListener("click", function(e) { + if (!e.target.classList.contains("page-choice")) { + return; + } + //browser.tabs.create({ + // url: chosenPage + //}); + if (e.target.textContent === 'Load') { + console.log('Load Data') + fetch('http://10.6.9.52:5000') + .then(resp => resp.text()) + .then(data => browser.tabs.create({ + url: data + })); + + } + if (e.target.textContent === 'Save') { + console.log('Save Data') + } + +}); diff --git a/upto.js b/upto.js new file mode 100644 index 0000000..f92257d --- /dev/null +++ b/upto.js @@ -0,0 +1 @@ +document.body.style.border = '5px solid red'