Well that was easy.

This commit is contained in:
idk
2019-02-05 10:53:26 -05:00
parent f7e453b56f
commit e086d02974
6 changed files with 76 additions and 2 deletions

2
.gitignore vendored Normal file
View File

@@ -0,0 +1,2 @@
README.md.asc

0
Makefile Normal file
View File

View File

@@ -1,2 +1,14 @@
# i2psetproxy.js
WebExtension that automatically sets up a browser to use the proxy into i2p
i2psetproxy.js
==============
WebExtension that automatically sets up a browser to use the proxy into i2p.
This extension shouldn't be used on it's own, and the extension it should be
used with aren't quite done yet. In conjunction with a hardened user.js or
installed in a TBB, it's probably pretty safe. It doesn't contain any
fingerprintable resources.
Features
--------
* [done] **Set** the http proxy to use the local i2p proxy
* [done] **Change** the color of the browser window to indicate that i2p is in use

35
background.js Normal file
View File

@@ -0,0 +1,35 @@
browser.windows.onCreated.addListener(themeWindow);
// Theme all currently open windows
browser.windows.getAll().then(wins => wins.forEach(themeWindow));
function themeWindow(window) {
// Check if the window is in private browsing
if (window.incognito) {
browser.theme.update(window.id, {
images: {
headerURL: "",
},
colors: {
accentcolor: "#A0A0DE",
textcolor: "white",
toolbar: "#A0A0DE",
toolbar_text: "white"
}
});
}
// Reset to the default theme otherwise
else {
browser.theme.update(window.id, {
images: {
headerURL: "",
},
colors: {
accentcolor: "#BFA0DE",
textcolor: "white",
toolbar: "#BFA0DE",
toolbar_text: "white"
}
});
}
}

16
manifest.json Normal file
View File

@@ -0,0 +1,16 @@
{
"manifest_version": 2,
"name": "I2P Proxy",
"version": "2.0",
"description": "Set up a browser to use the i2p http proxy automatically",
"background": {
"scripts": ["background.js", "proxy.js"]
},
"permissions": ["theme", "proxy"],
"applications": {
"gecko": {
"id": "i2psetproxy.js@eyedeekay.github.io",
"strict_min_version": "60.0"
}
}
}

9
proxy.js Normal file
View File

@@ -0,0 +1,9 @@
var proxySettings = {
proxyType: "manual",
http: "http://127.0.0.1:4444"
passthrough: ""
httpProxyAll: true
};
browser.proxy.settings.set({value:proxySettings});