diff options
author | Ruben Rodriguez <ruben@trisquel.info> | 2022-09-08 20:18:54 -0400 |
---|---|---|
committer | Ruben Rodriguez <ruben@trisquel.info> | 2022-09-08 20:18:54 -0400 |
commit | 5da28b0f8771834ae208d61431d632875e9f8e7d (patch) | |
tree | 688ecaff26197bad8abde617b4947b11d617309e /data/extensions/torproxy@icecat.gnu | |
parent | 4a87716686104266a9cccc2d83cc249e312f3673 (diff) |
Updated extensions:
* Upgraded Privacy Redirect to 1.1.49 and configured to use the 10 most reliable invidious instances
* Removed ViewTube
* Added torproxy@icecat.gnu based on 'Proxy toggle' extension
* Added jShelter 0.11.1
* Upgraded LibreJS to 7.21.0
* Upgraded HTTPS Everywhere to 2021.7.13
* Upgraded SubmitMe to 1.9
Diffstat (limited to 'data/extensions/torproxy@icecat.gnu')
-rw-r--r-- | data/extensions/torproxy@icecat.gnu/META-INF/cose.manifest | 37 | ||||
-rw-r--r-- | data/extensions/torproxy@icecat.gnu/META-INF/cose.sig | bin | 0 -> 3110 bytes | |||
-rw-r--r-- | data/extensions/torproxy@icecat.gnu/META-INF/manifest.mf | 47 | ||||
-rw-r--r-- | data/extensions/torproxy@icecat.gnu/META-INF/mozilla.rsa | bin | 0 -> 4359 bytes | |||
-rw-r--r-- | data/extensions/torproxy@icecat.gnu/META-INF/mozilla.sf | 4 | ||||
-rw-r--r-- | data/extensions/torproxy@icecat.gnu/background.js | 149 | ||||
-rw-r--r-- | data/extensions/torproxy@icecat.gnu/icons/p1.svg | 91 | ||||
-rw-r--r-- | data/extensions/torproxy@icecat.gnu/icons/p2.svg | 85 | ||||
-rw-r--r-- | data/extensions/torproxy@icecat.gnu/manifest.json | 45 | ||||
-rw-r--r-- | data/extensions/torproxy@icecat.gnu/settings.css | 30 | ||||
-rw-r--r-- | data/extensions/torproxy@icecat.gnu/settings.html | 63 | ||||
-rw-r--r-- | data/extensions/torproxy@icecat.gnu/settings.js | 53 |
12 files changed, 604 insertions, 0 deletions
diff --git a/data/extensions/torproxy@icecat.gnu/META-INF/cose.manifest b/data/extensions/torproxy@icecat.gnu/META-INF/cose.manifest new file mode 100644 index 0000000..42cda05 --- /dev/null +++ b/data/extensions/torproxy@icecat.gnu/META-INF/cose.manifest @@ -0,0 +1,37 @@ +Manifest-Version: 1.0 + +Name: settings.css +Digest-Algorithms: SHA1 SHA256 +SHA1-Digest: 6anv3xncTMc8eediw8wscgbrlmo= +SHA256-Digest: 47v3ADsxI7OFsLI9Ob3YZjekabJtPfjlZ/Usy1jNSEo= + +Name: settings.html +Digest-Algorithms: SHA1 SHA256 +SHA1-Digest: TaPwMv87CAK19sNiNk9L++NH/xY= +SHA256-Digest: QJcp4e6yvxtRLNJiPtGMXAFsUEhujgTYmhDdqw6mOXQ= + +Name: settings.js +Digest-Algorithms: SHA1 SHA256 +SHA1-Digest: DlYXdL43JwSn+1amJCsnPOqAkkg= +SHA256-Digest: 8rt7OebmlZC0XObdccAXaL4cKXYLt+YIyutZsfXURzY= + +Name: background.js +Digest-Algorithms: SHA1 SHA256 +SHA1-Digest: G/prqg/9BDrAPnyZUfVxVW9PYLc= +SHA256-Digest: W6G77oxIH0mEdKqOLY7BWWbfMrrZUn1wzwl4Wrvwil4= + +Name: manifest.json +Digest-Algorithms: SHA1 SHA256 +SHA1-Digest: MQzINwoLrV6jGsswMbk5++CdA8M= +SHA256-Digest: ez97jvQuuItTUiGeFJMQ4tAyj40TlSBc+Lhr8VkjGD0= + +Name: icons/p2.svg +Digest-Algorithms: SHA1 SHA256 +SHA1-Digest: rKFFu6DEQKi9NhW0lOqcyqqDegU= +SHA256-Digest: roEOnaLvEsHYPB4h+oNOMps9upEX5dPUCndsvAUz2vU= + +Name: icons/p1.svg +Digest-Algorithms: SHA1 SHA256 +SHA1-Digest: WrE4n1huN0Rg12GmZLi7S36OrZU= +SHA256-Digest: VkQJQTiZC7Uyf6ExDuquEW/Ixe9T1XndEqwTJ/1T0wM= + diff --git a/data/extensions/torproxy@icecat.gnu/META-INF/cose.sig b/data/extensions/torproxy@icecat.gnu/META-INF/cose.sig Binary files differnew file mode 100644 index 0000000..c591bad --- /dev/null +++ b/data/extensions/torproxy@icecat.gnu/META-INF/cose.sig diff --git a/data/extensions/torproxy@icecat.gnu/META-INF/manifest.mf b/data/extensions/torproxy@icecat.gnu/META-INF/manifest.mf new file mode 100644 index 0000000..0f11800 --- /dev/null +++ b/data/extensions/torproxy@icecat.gnu/META-INF/manifest.mf @@ -0,0 +1,47 @@ +Manifest-Version: 1.0 + +Name: settings.css +Digest-Algorithms: SHA1 SHA256 +SHA1-Digest: 6anv3xncTMc8eediw8wscgbrlmo= +SHA256-Digest: 47v3ADsxI7OFsLI9Ob3YZjekabJtPfjlZ/Usy1jNSEo= + +Name: settings.html +Digest-Algorithms: SHA1 SHA256 +SHA1-Digest: TaPwMv87CAK19sNiNk9L++NH/xY= +SHA256-Digest: QJcp4e6yvxtRLNJiPtGMXAFsUEhujgTYmhDdqw6mOXQ= + +Name: settings.js +Digest-Algorithms: SHA1 SHA256 +SHA1-Digest: DlYXdL43JwSn+1amJCsnPOqAkkg= +SHA256-Digest: 8rt7OebmlZC0XObdccAXaL4cKXYLt+YIyutZsfXURzY= + +Name: background.js +Digest-Algorithms: SHA1 SHA256 +SHA1-Digest: G/prqg/9BDrAPnyZUfVxVW9PYLc= +SHA256-Digest: W6G77oxIH0mEdKqOLY7BWWbfMrrZUn1wzwl4Wrvwil4= + +Name: manifest.json +Digest-Algorithms: SHA1 SHA256 +SHA1-Digest: MQzINwoLrV6jGsswMbk5++CdA8M= +SHA256-Digest: ez97jvQuuItTUiGeFJMQ4tAyj40TlSBc+Lhr8VkjGD0= + +Name: icons/p2.svg +Digest-Algorithms: SHA1 SHA256 +SHA1-Digest: rKFFu6DEQKi9NhW0lOqcyqqDegU= +SHA256-Digest: roEOnaLvEsHYPB4h+oNOMps9upEX5dPUCndsvAUz2vU= + +Name: icons/p1.svg +Digest-Algorithms: SHA1 SHA256 +SHA1-Digest: WrE4n1huN0Rg12GmZLi7S36OrZU= +SHA256-Digest: VkQJQTiZC7Uyf6ExDuquEW/Ixe9T1XndEqwTJ/1T0wM= + +Name: META-INF/cose.manifest +Digest-Algorithms: SHA1 SHA256 +SHA1-Digest: gO96ZggerANLr/y5PZAOlQA5llc= +SHA256-Digest: 9JY77ZX1b8zxeCJBBWrsG1K/FWJTwkNFQdY2InYbaqo= + +Name: META-INF/cose.sig +Digest-Algorithms: SHA1 SHA256 +SHA1-Digest: 2IW2783wdc49TwbvnjvRJ8sfW5E= +SHA256-Digest: Cualpja8+9v8KBgYoKIfaC7qCKRo3CT1Mtj4EFS3OvM= + diff --git a/data/extensions/torproxy@icecat.gnu/META-INF/mozilla.rsa b/data/extensions/torproxy@icecat.gnu/META-INF/mozilla.rsa Binary files differnew file mode 100644 index 0000000..a62fb90 --- /dev/null +++ b/data/extensions/torproxy@icecat.gnu/META-INF/mozilla.rsa diff --git a/data/extensions/torproxy@icecat.gnu/META-INF/mozilla.sf b/data/extensions/torproxy@icecat.gnu/META-INF/mozilla.sf new file mode 100644 index 0000000..e8dfcd7 --- /dev/null +++ b/data/extensions/torproxy@icecat.gnu/META-INF/mozilla.sf @@ -0,0 +1,4 @@ +Signature-Version: 1.0 +SHA1-Digest-Manifest: XjlJha4UffyHXIfl6oiV88clQQQ= +SHA256-Digest-Manifest: UsuiDWtMby2Eo7ESWqMa+92iSdPyY+o01Suox9uqEu0= + diff --git a/data/extensions/torproxy@icecat.gnu/background.js b/data/extensions/torproxy@icecat.gnu/background.js new file mode 100644 index 0000000..8a27219 --- /dev/null +++ b/data/extensions/torproxy@icecat.gnu/background.js @@ -0,0 +1,149 @@ +const DEBUG = 0;
+const DIRECT_PROXY = {
+ type: 'direct'
+};
+const DEFAULT_PROXY_SETTINGS = {
+ type: 'socks',
+ host: '127.0.0.1',
+ port: 9050,
+ username: '',
+ password: '',
+ proxyDNS: true
+};
+let proxies = [ DIRECT_PROXY, DIRECT_PROXY ];
+var skipLocal = 1;
+var pendingRequests = [];
+var currentProxy = 0;
+
+function buttonClicked() {
+ currentProxy = (currentProxy ? 0 : 1);
+ browser.storage.local.set({ currentProxy: currentProxy });
+ updateState();
+}
+
+function updateState() {
+ if(currentProxy==0)
+ {
+ if (DEBUG)
+ console.log('Update state (proxy off)');
+ browser.browserAction.setIcon({path: "icons/p1.svg"});
+ browser.browserAction.setTitle({title: "Tor Proxy (disabled)"});
+ }
+ else
+ {
+ if (DEBUG)
+ console.log('Update state (proxy on)');
+ browser.browserAction.setIcon({path: "icons/p2.svg"});
+ browser.browserAction.setTitle({title: "Tor Proxy (enabled)"});
+ }
+}
+
+function settingsChanged(settings) {
+ if ("proxySettings" in settings)
+ proxies[1] = settings.proxySettings.newValue;
+ if ("skipLocal" in settings)
+ skipLocal = settings.skipLocal.newValue;
+}
+
+function completed(requestDetails) {
+ if (DEBUG) {
+ console.log("completed request: " + requestDetails.requestId);
+ }
+ var index = pendingRequests.indexOf(requestDetails.requestId);
+ if (index > -1) {
+ pendingRequests.splice(index, 1);
+ }
+}
+
+function provideCredentialsSync(requestDetails) {
+ if (!requestDetails.isProxy)
+ return;
+ if (!currentProxy == 1)
+ return;
+ if (pendingRequests.indexOf(requestDetails.requestId) != -1) {
+ //if we've seen the request before, assume bad credentials and give up
+ console.log("Bad proxy credentials for request: " + requestDetails.requestId);
+ return {cancel:true};
+ }
+ var credentials = {
+ username: proxies[1].username,
+ password: proxies[1].password
+ }
+ pendingRequests.push(requestDetails.requestId);
+ if (DEBUG) {
+ console.log(`Providing proxy credentials for request: ${requestDetails.requestId} username: ${credentials.username}`);
+ }
+ return {authCredentials: credentials};
+}
+
+function isLocalIPv4(host)
+{
+ var octets = /^(\d+)\.(\d+)\.(\d+)\.(\d+)$/.exec(host);
+ if(!octets)
+ return false;
+ if(octets[1]>255||octets[2]>255||octets[3]>255||octets[4]>255)
+ return false;
+ if(octets[1]==10||octets[1]==127) //class A or local loopback
+ return true;
+ if(octets[1]==172&&octets[2]>=16&&octets[2]<=31) //class B
+ return true;
+ if(octets[1]==192&&octets[2]==168) //class C
+ return true;
+ return false;
+}
+
+function isLocal(host)
+{
+ if(host.indexOf('.') == -1)
+ return true;
+ if(host.endsWith(".local"))
+ return true;
+ if(host=="::1")
+ return true;
+ return(isLocalIPv4(host));
+}
+
+function handleProxyRequest(requestInfo) {
+ const url = new URL(requestInfo.url);
+ var host = url.hostname;
+ var proxyNum = currentProxy;
+ if (skipLocal) {
+ if(isLocal(host)) {
+ if (DEBUG)
+ console.log(`Local host detected: ${host}`);
+ proxyNum = 0;
+ }
+ }
+ if (DEBUG) {
+ console.log(`Proxying: ${url.hostname}`);
+ console.log(proxies[proxyNum]);
+ }
+ return(proxies[proxyNum]);
+}
+
+browser.storage.local.get({ currentProxy: 0, skipLocal: true, proxySettings: DEFAULT_PROXY_SETTINGS }, items=>{
+ currentProxy = items.currentProxy;
+ skipLocal = items.skipLocal;
+ proxies[1] = items.proxySettings;
+ updateState();
+});
+
+browser.storage.onChanged.addListener(settingsChanged);
+browser.browserAction.onClicked.addListener(buttonClicked);
+browser.proxy.onRequest.addListener(handleProxyRequest, {urls: ["<all_urls>"]});
+browser.proxy.onError.addListener(error => {
+ console.error(`Proxy error: ${error.message}`);
+});
+browser.webRequest.onAuthRequired.addListener(
+ provideCredentialsSync,
+ {urls: ["<all_urls>"]},
+ ["blocking"]
+);
+browser.webRequest.onCompleted.addListener(
+ completed,
+ {urls: ["<all_urls>"]}
+);
+browser.webRequest.onErrorOccurred.addListener(
+ completed,
+ {urls: ["<all_urls>"]}
+);
diff --git a/data/extensions/torproxy@icecat.gnu/icons/p1.svg b/data/extensions/torproxy@icecat.gnu/icons/p1.svg new file mode 100644 index 0000000..a18de5b --- /dev/null +++ b/data/extensions/torproxy@icecat.gnu/icons/p1.svg @@ -0,0 +1,91 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<svg + width="56" + height="56.007179" + version="1" + id="svg16" + sodipodi:docname="tor-off.svg" + inkscape:version="1.1.2 (0a00cf5339, 2022-02-04)" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns="http://www.w3.org/2000/svg" + xmlns:svg="http://www.w3.org/2000/svg"> + <defs + id="defs20" /> + <sodipodi:namedview + id="namedview18" + pagecolor="#ffffff" + bordercolor="#666666" + borderopacity="1.0" + inkscape:pageshadow="2" + inkscape:pageopacity="0.0" + inkscape:pagecheckerboard="0" + showgrid="false" + inkscape:zoom="9.1176157" + inkscape:cx="7.6226068" + inkscape:cy="35.700123" + inkscape:window-width="2560" + inkscape:window-height="1335" + inkscape:window-x="0" + inkscape:window-y="0" + inkscape:window-maximized="1" + inkscape:current-layer="g34670" + showguides="true" + inkscape:guide-bbox="true" + fit-margin-top="0" + fit-margin-left="0" + fit-margin-right="0" + fit-margin-bottom="0"> + <sodipodi:guide + position="-47.113152,51.478372" + orientation="0.70710678,-0.70710678" + id="guide34459" /> + </sodipodi:namedview> + <g + id="g34670" + transform="translate(-2.2782477,-1.5195852)"> + <path + style="fill:#989898;fill-opacity:1" + d="m 58.278248,29.519585 a 28,28 0 0 0 -28,-27.9999998 A 28,28 0 0 0 2.2782482,29.519585 Z m -4.858984,15.758202 c -0.138178,0.202514 -0.296926,0.389238 -0.440235,0.587892 a 28,28 0 0 0 0.440235,-0.587892 z m -1.648828,2.179298 c -0.219478,0.262688 -0.460267,0.505768 -0.689063,0.760156 a 28,28 0 0 0 0.689063,-0.760156 z m -1.856641,2.009766 c -0.256606,0.252614 -0.532285,0.484704 -0.798438,0.727344 a 28,28 0 0 0 0.798438,-0.727344 z m -2.069922,1.842968 c -0.280066,0.226048 -0.577993,0.42999 -0.866797,0.645314 a 28,28 0 0 0 0.866797,-0.645314 z m -2.201172,1.60508 c -0.315657,0.207732 -0.646316,0.392758 -0.970703,0.587888 a 28,28 0 0 0 0.970703,-0.587888 z m -2.414453,1.416404 c -0.300752,0.1573 -0.611696,0.2964 -0.91875,0.442968 a 28,28 0 0 0 0.91875,-0.442968 z m -2.526564,1.16211 c -0.304364,0.12228 -0.617408,0.227284 -0.926952,0.339062 a 28,28 0 0 0 0.926952,-0.339062 z m -2.630468,0.905078 c -0.331718,0.09604 -0.669582,0.17578 -1.00625,0.259766 a 28,28 0 0 0 1.00625,-0.259766 z m -2.961328,0.697266 c -0.0447,0.0078 -0.0892,0.017 -0.13398,0.02462 a 28,28 0 0 0 0.13398,-0.02462 z m -2.717968,0.336328 c -0.09304,0.007 -0.18564,0.0158 -0.278906,0.02188 a 28,28 0 0 0 0.278906,-0.02188 z M 14.520046,52.660601 c -0.202514,-0.13818 -0.389238,-0.296926 -0.587892,-0.440234 a 28,28 0 0 0 0.587892,0.440234 z m -2.179298,-1.64883 C 12.07806,50.792295 11.83498,50.551507 11.580592,50.322709 a 28,28 0 0 0 0.760156,0.689062 z M 10.330982,49.155133 C 10.078368,48.898527 9.8462776,48.622847 9.6036376,48.356695 a 28,28 0 0 0 0.7273444,0.798438 z M 8.4880136,47.085209 c -0.226048,-0.280064 -0.42999,-0.577992 -0.645314,-0.866796 a 28,28 0 0 0 0.645314,0.866796 z m -1.60508,-2.201172 C 6.6752016,44.568381 6.4901756,44.237721 6.2950461,43.913335 a 28,28 0 0 0 0.5878875,0.970702 z M 5.4665302,42.469585 c -0.1573,-0.300752 -0.2964,-0.611696 -0.442968,-0.91875 a 28,28 0 0 0 0.442968,0.91875 z m -1.16211,-2.526564 c -0.12228,-0.304364 -0.227284,-0.617408 -0.339062,-0.926952 a 28,28 0 0 0 0.339062,0.926952 z m -0.905078,-2.630468 c -0.09604,-0.331718 -0.17578,-0.669582 -0.259766,-1.00625 a 28,28 0 0 0 0.259766,1.00625 z m -0.697266,-2.961328 c -0.0078,-0.0447 -0.017,-0.0892 -0.02462,-0.13398 a 28,28 0 0 0 0.02462,0.13398 z m -0.336328,-2.717968 c -0.007,-0.09302 -0.0158,-0.18564 -0.02188,-0.278906 a 28,28 0 0 0 0.02188,0.278906 z" + id="path4" /> + <circle + style="opacity:1;fill:#ffffff;fill-opacity:1" + cx="29.519585" + cy="-30.278248" + r="22" + id="circle6" + transform="rotate(90)" /> + <circle + style="opacity:1;fill:#989898;fill-opacity:1" + cx="29.519585" + cy="-30.278248" + r="16" + id="circle8" + transform="rotate(90)" /> + <circle + style="opacity:1;fill:#ffffff;fill-opacity:1" + cx="29.519585" + cy="-30.278248" + r="10" + id="circle10" + transform="rotate(90)" /> + <path + style="fill:#989898;stroke:none;fill-opacity:1" + d="m 30.278248,57.519585 c -15.463972,0 -28.0000003,-12.536028 -28.0000003,-28 H 58.278248 c 0,15.463972 -12.536027,28 -28,28 z" + id="path12" /> + <rect + style="opacity:1;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:0.117141" + id="rect34377" + width="34.520412" + height="7.3703346" + x="-57.526764" + y="26.593081" + transform="rotate(-90)" /> + <circle + style="opacity:1;fill:none;fill-opacity:1;stroke:#000000;stroke-width:1.17097;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + id="path34993" + cx="30.278248" + cy="29.523174" + r="27.469069" /> + </g> +</svg> diff --git a/data/extensions/torproxy@icecat.gnu/icons/p2.svg b/data/extensions/torproxy@icecat.gnu/icons/p2.svg new file mode 100644 index 0000000..83632e8 --- /dev/null +++ b/data/extensions/torproxy@icecat.gnu/icons/p2.svg @@ -0,0 +1,85 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<svg + width="56" + height="56.007179" + version="1" + id="svg16" + sodipodi:docname="tor-on.svg" + inkscape:version="1.1.2 (0a00cf5339, 2022-02-04)" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns="http://www.w3.org/2000/svg" + xmlns:svg="http://www.w3.org/2000/svg"> + <defs + id="defs20" /> + <sodipodi:namedview + id="namedview18" + pagecolor="#ffffff" + bordercolor="#666666" + borderopacity="1.0" + inkscape:pageshadow="2" + inkscape:pageopacity="0.0" + inkscape:pagecheckerboard="0" + showgrid="false" + inkscape:zoom="9.1176157" + inkscape:cx="7.6226068" + inkscape:cy="35.700123" + inkscape:window-width="2560" + inkscape:window-height="1335" + inkscape:window-x="0" + inkscape:window-y="0" + inkscape:window-maximized="1" + inkscape:current-layer="svg16" + showguides="true" + inkscape:guide-bbox="true" + fit-margin-top="0" + fit-margin-left="0" + fit-margin-right="0" + fit-margin-bottom="0"> + <sodipodi:guide + position="-47.113152,51.478372" + orientation="0.70710678,-0.70710678" + id="guide34459" /> + </sodipodi:namedview> + <g + id="g34670" + transform="translate(-2.2782477,-1.5195852)"> + <path + style="fill:#7d4698;fill-opacity:1" + d="m 58.278248,29.519585 a 28,28 0 0 0 -28,-27.9999998 A 28,28 0 0 0 2.2782482,29.519585 Z m -4.858984,15.758202 c -0.138178,0.202514 -0.296926,0.389238 -0.440235,0.587892 a 28,28 0 0 0 0.440235,-0.587892 z m -1.648828,2.179298 c -0.219478,0.262688 -0.460267,0.505768 -0.689063,0.760156 a 28,28 0 0 0 0.689063,-0.760156 z m -1.856641,2.009766 c -0.256606,0.252614 -0.532285,0.484704 -0.798438,0.727344 a 28,28 0 0 0 0.798438,-0.727344 z m -2.069922,1.842968 c -0.280066,0.226048 -0.577993,0.42999 -0.866797,0.645314 a 28,28 0 0 0 0.866797,-0.645314 z m -2.201172,1.60508 c -0.315657,0.207732 -0.646316,0.392758 -0.970703,0.587888 a 28,28 0 0 0 0.970703,-0.587888 z m -2.414453,1.416404 c -0.300752,0.1573 -0.611696,0.2964 -0.91875,0.442968 a 28,28 0 0 0 0.91875,-0.442968 z m -2.526564,1.16211 c -0.304364,0.12228 -0.617408,0.227284 -0.926952,0.339062 a 28,28 0 0 0 0.926952,-0.339062 z m -2.630468,0.905078 c -0.331718,0.09604 -0.669582,0.17578 -1.00625,0.259766 a 28,28 0 0 0 1.00625,-0.259766 z m -2.961328,0.697266 c -0.0447,0.0078 -0.0892,0.017 -0.13398,0.02462 a 28,28 0 0 0 0.13398,-0.02462 z m -2.717968,0.336328 c -0.09304,0.007 -0.18564,0.0158 -0.278906,0.02188 a 28,28 0 0 0 0.278906,-0.02188 z M 14.520046,52.660601 c -0.202514,-0.13818 -0.389238,-0.296926 -0.587892,-0.440234 a 28,28 0 0 0 0.587892,0.440234 z m -2.179298,-1.64883 C 12.07806,50.792295 11.83498,50.551507 11.580592,50.322709 a 28,28 0 0 0 0.760156,0.689062 z M 10.330982,49.155133 C 10.078368,48.898527 9.8462776,48.622847 9.6036376,48.356695 a 28,28 0 0 0 0.7273444,0.798438 z M 8.4880136,47.085209 c -0.226048,-0.280064 -0.42999,-0.577992 -0.645314,-0.866796 a 28,28 0 0 0 0.645314,0.866796 z m -1.60508,-2.201172 C 6.6752016,44.568381 6.4901756,44.237721 6.2950461,43.913335 a 28,28 0 0 0 0.5878875,0.970702 z M 5.4665302,42.469585 c -0.1573,-0.300752 -0.2964,-0.611696 -0.442968,-0.91875 a 28,28 0 0 0 0.442968,0.91875 z m -1.16211,-2.526564 c -0.12228,-0.304364 -0.227284,-0.617408 -0.339062,-0.926952 a 28,28 0 0 0 0.339062,0.926952 z m -0.905078,-2.630468 c -0.09604,-0.331718 -0.17578,-0.669582 -0.259766,-1.00625 a 28,28 0 0 0 0.259766,1.00625 z m -0.697266,-2.961328 c -0.0078,-0.0447 -0.017,-0.0892 -0.02462,-0.13398 a 28,28 0 0 0 0.02462,0.13398 z m -0.336328,-2.717968 c -0.007,-0.09302 -0.0158,-0.18564 -0.02188,-0.278906 a 28,28 0 0 0 0.02188,0.278906 z" + id="path4" /> + <circle + style="opacity:1;fill:#ffffff;fill-opacity:1" + cx="29.519585" + cy="-30.278248" + r="22" + id="circle6" + transform="rotate(90)" /> + <circle + style="opacity:1;fill:#7d4698;fill-opacity:1" + cx="29.519585" + cy="-30.278248" + r="16" + id="circle8" + transform="rotate(90)" /> + <circle + style="opacity:1;fill:#ffffff;fill-opacity:1" + cx="29.519585" + cy="-30.278248" + r="10" + id="circle10" + transform="rotate(90)" /> + <path + style="fill:#7d4698;stroke:none" + d="m 30.278248,57.519585 c -15.463972,0 -28.0000003,-12.536028 -28.0000003,-28 H 58.278248 c 0,15.463972 -12.536027,28 -28,28 z" + id="path12" /> + <rect + style="opacity:1;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:0.117141" + id="rect34377" + width="34.520412" + height="7.3703346" + x="-57.526764" + y="26.593081" + transform="rotate(-90)" /> + </g> +</svg> diff --git a/data/extensions/torproxy@icecat.gnu/manifest.json b/data/extensions/torproxy@icecat.gnu/manifest.json new file mode 100644 index 0000000..f03ee3e --- /dev/null +++ b/data/extensions/torproxy@icecat.gnu/manifest.json @@ -0,0 +1,45 @@ +{
+ "manifest_version": 2,
+ "name": "Tor Proxy Toggle",
+ "version": "1.2.1",
+ "description": "Toggle between direct connection and using Tor routing from a local daemon (requires a Tor service installed an running, separately of IceCat). Based on 'Proxy toggle' extension",
+ "icons": {
+ "48": "icons/p1.svg",
+ "96": "icons/p1.svg"
+ },
+ "permissions": [
+ "storage",
+ "proxy",
+ "<all_urls>",
+ "webRequest",
+ "webRequestBlocking"
+ ],
+ "browser_action": {
+ "browser_style": true,
+ "default_icon": "icons/p1.svg",
+ "default_title": "Tor Proxy Toggle"
+ },
+ "commands": {
+ "_execute_browser_action": {
+ "suggested_key": {
+ "default": "Ctrl+Shift+Y"
+ },
+ "description": "Toggle Tor proxy on/off"
+ }
+ },
+ "background": {
+ "scripts": [
+ "background.js"
+ ]
+ },
+ "options_ui": {
+ "page": "settings.html",
+ "browser_style": true
+ },
+ "applications": {
+ "gecko": {
+ "strict_min_version": "60.0",
+ "id": "torproxy@icecat.gnu"
+ }
+ }
+}
diff --git a/data/extensions/torproxy@icecat.gnu/settings.css b/data/extensions/torproxy@icecat.gnu/settings.css new file mode 100644 index 0000000..0fe75e2 --- /dev/null +++ b/data/extensions/torproxy@icecat.gnu/settings.css @@ -0,0 +1,30 @@ +#dnsrow{
+ display: none;
+}
+.configtable {
+ border-collapse:collapse;
+ margin: 6px;
+ font-size: 11pt;
+ min-width: 400px;
+ border: 2px solid black;
+ box-shadow: 3px 3px 2px #000
+}
+.configtable th,.configtable td {
+ border: 1px solid black;
+ padding: 10px;
+}
+.configtable th {
+ color: #000;
+ font-size: 18px;
+ text-align: left;
+}
+.configtable td {
+ width: 50%;
+}
+.configtable tr {
+ background-color: lavender;
+ transition: background-color 0.5s ease;
+}
+.configtable tr:hover {
+ background-color: #fff;
+}
diff --git a/data/extensions/torproxy@icecat.gnu/settings.html b/data/extensions/torproxy@icecat.gnu/settings.html new file mode 100644 index 0000000..1fe61c9 --- /dev/null +++ b/data/extensions/torproxy@icecat.gnu/settings.html @@ -0,0 +1,63 @@ +<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf-8">
+ <link rel="stylesheet" href="settings.css" />
+ </head>
+ <body>
+ <form>
+ <table class="configtable">
+ <tr>
+ <th colspan="2">
+ Proxy configuration
+ </th>
+ </tr>
+ <tr>
+ <td colspan="2">The default values to use with a Tor service are:<br/>type=socks5, host=127.0.0.1, port=9050, RemoteDNS=true.<br/>The Tor service needs to be installed and running, separately of IceCat.</td>
+ </tr>
+ <tr>
+ <td>Type</td>
+ <td>
+ <select id="type">
+ <option value="direct" selected>Select proxy type</option>
+ <option value="http">HTTP</option>
+ <option value="https">HTTPS</option>
+ <option value="socks">SOCKS5</option>
+ <option value="socks4">SOCKS4</option>
+ </select>
+ </td>
+ </tr>
+ <tr>
+ <td>Host</td>
+ <td><input type="text" id="host"></td>
+ </tr>
+ <tr>
+ <td>Port</td>
+ <td><input type="number" min="1" max="65535" id="port"></td>
+ </tr>
+ <tr id="usernamerow">
+ <td>Username (optional)</td>
+ <td><input type="text" id="username"></td>
+ </tr>
+ <tr id="passwordrow">
+ <td>Password (optional)</td>
+ <td><input type="password" id="password"></td>
+ </tr>
+ <tr id="dnsrow">
+ <td>Remote DNS</td>
+ <td><input type="checkbox" id="dns"></td>
+ </tr>
+ <tr>
+ <th colspan="2">
+ General settings
+ </th>
+ </tr>
+ <tr id="skiplocalrow">
+ <td>Don't use proxy for hosts we can detect as local (e.g. LAN IPs)</td>
+ <td><input type="checkbox" id="skiplocal"></td>
+ </tr>
+ </table>
+ </form>
+ <script src="settings.js"></script>
+ </body>
+</html>
diff --git a/data/extensions/torproxy@icecat.gnu/settings.js b/data/extensions/torproxy@icecat.gnu/settings.js new file mode 100644 index 0000000..d227763 --- /dev/null +++ b/data/extensions/torproxy@icecat.gnu/settings.js @@ -0,0 +1,53 @@ +function saveOptions(e) {
+ e.preventDefault();
+ browser.storage.local.set({
+ proxySettings: {
+ type: document.querySelector("#type").value,
+ host: document.querySelector("#host").value,
+ port: document.querySelector("#port").value,
+ username: document.querySelector("#username").value,
+ password: document.querySelector("#password").value,
+ proxyDNS: document.querySelector("#dns").checked
+ },
+ skipLocal: document.querySelector("#skiplocal").checked
+ });
+}
+
+function restoreOptions(e) {
+ function onGot(item) {
+ document.querySelector("#host").value = item.proxySettings.host;
+ document.querySelector("#port").value = item.proxySettings.port;
+ document.querySelector('#type [value="' + item.proxySettings.type + '"]').selected = true;
+ document.querySelector("#username").value = item.proxySettings.username;
+ document.querySelector("#password").value = item.proxySettings.password;
+ document.querySelector("#dns").checked = item.proxySettings.proxyDNS;
+ document.querySelector("#skiplocal").checked = item.skipLocal;
+ typeChanged(e);
+ }
+ function onError(error) {
+ console.log(`Error: ${error}`);
+ }
+ var gettingItem = browser.storage.local.get({ skipLocal: true, proxySettings: {type: 'socks', host: '127.0.0.1', port: 9050, username: '', password: '', proxyDNS: true}});
+ gettingItem.then(onGot, onError);
+}
+
+function typeChanged(e) {
+ var type = document.querySelector("#type").value;
+ var dnsDisplay = 'none';
+ if(type=="socks"||type=="socks4")
+ dnsDisplay = 'table-row';
+ else
+ document.querySelector("#dns").checked = false;
+ document.querySelector("#dnsrow").style.display = dnsDisplay;
+ saveOptions(e);
+}
+
+document.addEventListener("DOMContentLoaded", restoreOptions);
+document.querySelector("#type").addEventListener("change", typeChanged);
+document.querySelector("#host").addEventListener("blur", saveOptions);
+document.querySelector("#port").addEventListener("blur", saveOptions);
+document.querySelector("#port").addEventListener("change", saveOptions);
+document.querySelector("#username").addEventListener("blur", saveOptions);
+document.querySelector("#password").addEventListener("blur", saveOptions);
+document.querySelector("#dns").addEventListener("change", saveOptions);
+document.querySelector("#skiplocal").addEventListener("change", saveOptions);
|