-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
593e730
commit 43e0a54
Showing
10 changed files
with
257 additions
and
85 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title>Onion VPN :: Options Page</title> | ||
</head> | ||
<body> | ||
<style> | ||
body { | ||
min-width: 500px; | ||
} | ||
input[type=text] { | ||
width: 100%; | ||
box-sizing: border-box; | ||
} | ||
</style> | ||
<table width=100%> | ||
<tr> | ||
<td><input type="checkbox" id="badge"></td> | ||
<td><label for="badge">Show badge number (total number of active Tor instances)</label></td> | ||
</tr> | ||
<tr> | ||
<td></td> | ||
<td>Comma-separated list of ports<sup>1</sup></td> | ||
</tr> | ||
<tr> | ||
<td></td> | ||
<td><input type="text" id="ports"></td> | ||
</tr> | ||
<tr> | ||
<td><input type="checkbox" id="start"></td> | ||
<td><label for="start">Start Tor client when browser starts<sup>2</sup></label></td> | ||
</tr> | ||
<tr> | ||
<td></td> | ||
<td>Additional command-line arguments<sup>3</sup></td> | ||
</tr> | ||
<tr> | ||
<td></td> | ||
<td><input type="text" id="arguments"></td> | ||
</tr> | ||
</table> | ||
<p> | ||
<input type="button" id="support" value="Support Development"> | ||
<input type="button" id="reset" value="Reset"> - <input type="button" id="save" value="Save"> <span id="info"></span> | ||
</p> | ||
<hr> | ||
1: When starting a new Tor instance, use a port number among this list. | ||
<br> | ||
2: Note that you will be disconnected until the extension successfully establishes its first connection | ||
<br> | ||
3: Comma-separated list of additional arguments to pass to the Tor executable. It is user responsibility to make sure these additional arguments are not going to conflict with the extension operation. For instance for the Tor client to make all OR connections through the SOCKS 5 proxy, use <code>Socks5Proxy, 127.0.0.1:9191</code> | ||
|
||
<script src="index.js"></script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
'use strict'; | ||
|
||
var info = document.getElementById('info'); | ||
|
||
chrome.storage.local.get({ | ||
ports: [2020, 2021, 2022, 2023, 2024, 2025, 2026, 2027, 2028, 2029, 2030], | ||
badge: true, | ||
start: false, | ||
arguments: '' | ||
}, prefs => { | ||
document.getElementById('ports').value = prefs.ports.join(', '); | ||
document.getElementById('badge').checked = prefs.badge; | ||
document.getElementById('start').checked = prefs.start; | ||
document.getElementById('arguments').value = prefs.arguments; | ||
}); | ||
|
||
document.getElementById('save').addEventListener('click', () => { | ||
let ports = document.getElementById('ports').value.split(/\s*,\s*/).filter(s => s && isNaN(s) === false); | ||
ports = ports.length ? ports : [2020, 2021, 2022, 2023, 2024, 2025, 2026, 2027, 2028, 2029, 2030]; | ||
chrome.storage.local.set({ | ||
ports, | ||
badge: document.getElementById('badge').checked, | ||
start: document.getElementById('start').checked, | ||
arguments: document.getElementById('arguments').value | ||
}, () => { | ||
document.getElementById('ports').value = ports.join(', '); | ||
info.textContent = 'Options saved'; | ||
window.setTimeout(() => info.textContent = '', 750); | ||
}); | ||
}); | ||
|
||
// reset | ||
document.getElementById('reset').addEventListener('click', e => { | ||
if (e.detail === 1) { | ||
info.textContent = 'Double-click to reset!'; | ||
window.setTimeout(() => info.textContent = '', 750); | ||
} | ||
else { | ||
localStorage.clear(); | ||
chrome.storage.local.clear(() => { | ||
chrome.runtime.reload(); | ||
window.close(); | ||
}); | ||
} | ||
}); | ||
// support | ||
document.getElementById('support').addEventListener('click', () => chrome.tabs.create({ | ||
url: chrome.runtime.getManifest().homepage_url + '?rd=donate' | ||
})); |
Oops, something went wrong.