Initial
This commit is contained in:
commit
899c14bab5
7
background.js
Normal file
7
background.js
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
function openPage() {
|
||||||
|
browser.tabs.create({
|
||||||
|
url: "https://youtube.com"
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
browser.browserAction.onClicked.addListener(openPage);
|
||||||
BIN
icons/48.png
Normal file
BIN
icons/48.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 225 B |
19
manifest.json
Normal file
19
manifest.json
Normal 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
popup/choose.html
Normal file
15
popup/choose.html
Normal 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
popup/choose_page.css
Normal file
15
popup/choose_page.css
Normal 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
popup/choose_page.js
Normal file
21
popup/choose_page.js
Normal 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')
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
Loading…
x
Reference in New Issue
Block a user