This commit is contained in:
benjamyn committed 2020-06-13 15:35:47 +10:00
commit 899c14bab5
7 files changed
+78

No files matched your search

+7
View File
@@ -0,0 +1,7 @@
function openPage() {
browser.tabs.create({
url: "https://youtube.com"
});
}
browser.browserAction.onClicked.addListener(openPage);
BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 225 B

+19
View File
@@ -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"
}
}
}
+15
View File
@@ -0,0 +1,15 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<link rel="stylesheet" href="choose_page.css"/>
</head>
<body>
<div class="page-choice">Load</div>
<div class="page-choice">Save</div>
<script src="choose_page.js"></script>
</body>
</html>
+15
View File
@@ -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;
}
+21
View File
@@ -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')
}
});
+1
View File
@@ -0,0 +1 @@
document.body.style.border = '5px solid red'