diff --git a/Makefile b/Makefile index fc08f28..68e0863 100644 --- a/Makefile +++ b/Makefile @@ -79,7 +79,7 @@ moz-version: sed -i 's|$(shell grep "\"version_name\": " manifest.json)| \"version_name\": \"$(MOZ_VERSION)\",|g' manifest.json rhz-version: - sed -i 's|$(shell grep "\"version\": " manifest.json)| \"version\": \"$(VERSION)\",|g' manifest.json + sed -i 's|$(shell grep "\"version\": " manifest.json)| \"version\": \"$(VERSION)1\",|g' manifest.json sed -i 's|$(shell grep "\"version_name\": " manifest.json)| \"version_name\": \"$(VERSION)1-rhizome\",|g' manifest.json sed -i 's|7657|7647|g' *.js* */*.js* @@ -95,7 +95,7 @@ zip: version --exclude="./.git" -r -FS ../i2psetproxy.js.zip * release: - cat desc debian/changelog | gothub release -p -u eyedeekay -r i2psetproxy.js -t $(VERSION) -n $(VERSION) -d - + cat desc debian/changelog | gothub release -p -u eyedeekay -r i2psetproxy.js -t $(VERSION) -n $(VERSION) -d -; true delete-release: gothub delete -u eyedeekay -r i2psetproxy.js -t $(VERSION); true @@ -104,6 +104,7 @@ recreate-release: delete-release release upload upload: upload-xpi upload-deb +full-release: release submit deb upload WEB_EXT_API_KEY=AMO_KEY WEB_EXT_API_SECRET=AMO_SECRET @@ -117,7 +118,7 @@ tk: submit: moz-sign rhz-submit moz-submit clean-artifacts: - rm web-ext-artifacts/* + rm -fr web-ext-artifacts/* ##ODD NUMBERED, SELF-DISTRIBUTED VERSIONS HERE! moz-sign: version clean-artifacts @@ -125,7 +126,7 @@ moz-sign: version clean-artifacts @echo "requires a JWT API Key and Secret from addons.mozilla.org to be made available" @echo "to the Makefile under the variables WEB_EXT_API_KEY and WEB_EXT_API_SECRET." web-ext-submit --channel unlisted --config-discovery false --api-key $(WEB_EXT_API_KEY) --api-secret $(WEB_EXT_API_SECRET); true - cp web-ext-artifacts/*.xpi ./i2ppb@eyedeekay.github.io.xpi + cp web-ext-artifacts/*.xpi ./i2ppb@eyedeekay.github.io.xpi; true ##EVEN NUMBERED, MOZILLA-DISTRIBUTED VERSIONS HERE! moz-submit: moz-version @@ -141,6 +142,12 @@ rhz-submit: rhz-version web-ext-submit --channel unlisted --config-discovery false --api-key $(WEB_EXT_API_KEY) --api-secret $(WEB_EXT_API_SECRET); true #cp web-ext-artifacts/*.xpi ./i2ppb@eyedeekay.github.io.xpi +gettorrent: + wget "http://127.0.0.1:7657/i2psnark/i2ppb@eyedeekay.github.io.xpi.torrent" + +upload-torrent: + gothub upload -R -u eyedeekay -r i2psetproxy.js -t $(VERSION) -n "i2ppb@eyedeekay.github.io.xpi.torrent" -f "./i2ppb@eyedeekay.github.io.xpi.torrent" + upload-xpi: gothub upload -R -u eyedeekay -r i2psetproxy.js -t $(VERSION) -n "i2ppb@eyedeekay.github.io.xpi" -f "./i2ppb@eyedeekay.github.io.xpi" @@ -159,11 +166,12 @@ fmt: find . -path ./node_modules -prune -o -name '*.js*' -exec prettier --write {} \; lint: - eslint --fix *.js + eslint --color *.js -deborig: +deborig: version rm -rf ../i2psetproxy.js-$(VERSION) cp -r . ../i2psetproxy.js-$(VERSION) + cd ../i2psetproxy.js-$(VERSION) rm -rf *.xpi web-ext-artifacts tar \ -cvz \ @@ -173,6 +181,7 @@ deborig: --exclude=web-ext-artifacts \ --exclude=*.xpi \ --exclude=*/*.xpi \ + --exclude=*.pdf \ -f ../i2psetproxy.js_$(VERSION).orig.tar.gz \ . diff --git a/README.md b/README.md index 2a0ffa1..ed4de22 100644 --- a/README.md +++ b/README.md @@ -1,15 +1,14 @@ i2psetproxy.js ============== -WebExtension that does extended configuration of a dedicated I2P browser. While -**experimental**, it's capable of enforcing the use of the I2P Proxy without -needing to touch about:config and disables several -fingerprinting/de-anonymization vectors on it's own. It is also the easiest way -to configure an I2P browser on Android without requiring the user to root their -device, although this support may be somewhat spotty in recent versions it it -beginning to improve again. It aims to be as similar to a fully-fledged I2P -Rhizome as possible and borrows some code from I2P Rhizome(Which it is also -compatible with). +This is an **Experimental** webextension which introduces a set of new "Private +Browsing" modes to Firefox-based browsers(Supporting webextensions) that makes +it easier to configure a browser to use I2P securely and adds features for +making I2P applications easier to use. It does this by isolating I2P-specific +settings to Contextual Identities within Firefox, then loading them +automatically when the user requests them. It also adds convenience and +management features specific to I2P like protocol handlers and native messaging +systems. The Old Version --------------- diff --git a/background.js b/background.js index 4899c95..1a19a66 100644 --- a/background.js +++ b/background.js @@ -19,58 +19,58 @@ function onContextsGot(contexts) { } console.log("Checking new contexts"); if (ids.indexOf(titlepref) == -1) { - browser.contextualIdentities - .create({ + browser.contextualIdentities. + create({ name: titlepref, color: "orange", icon: "fingerprint" - }) - .then(onCreated, onError); + }). + then(onCreated, onError); } if (ids.indexOf(webpref) == -1) { - browser.contextualIdentities - .create({ + browser.contextualIdentities. + create({ name: webpref, color: "red", icon: "circle" - }) - .then(onCreated, onError); + }). + then(onCreated, onError); } if (ids.indexOf(routerpref) == -1) { - browser.contextualIdentities - .create({ + browser.contextualIdentities. + create({ name: routerpref, color: "blue", icon: "briefcase" - }) - .then(onCreated, onError); + }). + then(onCreated, onError); } if (ids.indexOf(tunnelpref) == -1) { - browser.contextualIdentities - .create({ + browser.contextualIdentities. + create({ name: tunnelpref, color: "green", icon: "tree" - }) - .then(onCreated, onError); + }). + then(onCreated, onError); } if (ids.indexOf(mailpref) == -1) { - browser.contextualIdentities - .create({ + browser.contextualIdentities. + create({ name: mailpref, color: "yellow", icon: "briefcase" - }) - .then(onCreated, onError); + }). + then(onCreated, onError); } if (ids.indexOf(torrentpref) == -1) { - browser.contextualIdentities - .create({ + browser.contextualIdentities. + create({ name: torrentpref, color: "purple", icon: "chill" - }) - .then(onCreated, onError); + }). + then(onCreated, onError); } } @@ -211,9 +211,9 @@ function themeWindow(window) { tabInfo[0].cookieStoreId != "firefox-default" && tabInfo[0].cookieStoreId != "firefox-private" ) { - browser.contextualIdentities - .get(tabInfo[0].cookieStoreId) - .then(onContextGotTheme, onError); + browser.contextualIdentities. + get(tabInfo[0].cookieStoreId). + then(onContextGotTheme, onError); } else { browser.theme.reset(window.id); } @@ -308,11 +308,10 @@ function setTitle(window) { tabInfo[0].cookieStoreId != "firefox-default" && tabInfo[0].cookieStoreId != "firefox-private" ) { - browser.contextualIdentities - .get(tabInfo[0].cookieStoreId) - .then(onContextGotTitle, onError); - } else { - if (window.incognito) { + browser.contextualIdentities. + get(tabInfo[0].cookieStoreId). + then(onContextGotTitle, onError); + } else if (window.incognito) { browser.windows.update(window.id, { titlePreface: "" }); @@ -321,7 +320,6 @@ function setTitle(window) { titlePreface: "" }); } - } } var querying = browser.tabs.query({ @@ -375,7 +373,7 @@ function handleUpdated(updateInfo) { if (updateInfo.theme.colors) { console.log(`Theme was applied: ${updateInfo.theme}`); } else { - console.log(`Theme was removed`); + console.log("Theme was removed"); } } diff --git a/bookmarks.js b/bookmarks.js index 05262b7..e191a2a 100644 --- a/bookmarks.js +++ b/bookmarks.js @@ -25,9 +25,7 @@ gettingInfo.then(got => { } console.log("(bookmarks) adding home page bookmark"); } - console.log( - "(bookmarks) checking if we're running in an I2P Browser" - ); + console.log("(bookmarks) checking if we're running in an I2P Browser"); var gettingInfo = browser.proxy.settings.get({}); gettingInfo.then(gotProxyInfo); } @@ -54,9 +52,7 @@ gettingInfo.then(got => { createBookmark.then(onCreated); } } - console.log( - "(bookmarks) checking if we're running in an I2P Browser" - ); + console.log("(bookmarks) checking if we're running in an I2P Browser"); var gettingInfo = browser.proxy.settings.get({}); gettingInfo.then(gotProxyInfo); } @@ -83,9 +79,7 @@ gettingInfo.then(got => { } console.log("(bookmarks) adding webmail bookmark"); } - console.log( - "(bookmarks) checking if we're running in an I2P Browser" - ); + console.log("(bookmarks) checking if we're running in an I2P Browser"); var gettingInfo = browser.proxy.settings.get({}); gettingInfo.then(gotProxyInfo); } @@ -117,9 +111,7 @@ gettingInfo.then(got => { } console.log("(bookmarks) adding i2ptunnel bookmark"); } - console.log( - "(bookmarks) checking if we're running in an I2P Browser" - ); + console.log("(bookmarks) checking if we're running in an I2P Browser"); var gettingInfo = browser.proxy.settings.get({}); gettingInfo.then(gotProxyInfo); } diff --git a/browser.pdf b/browser.pdf new file mode 100644 index 0000000..defba50 Binary files /dev/null and b/browser.pdf differ diff --git a/context.js b/context.js index b1712dc..0c3a9c9 100644 --- a/context.js +++ b/context.js @@ -21,11 +21,11 @@ function eventHandler(event) { creating.then(onCreated, onError); } if (event.target.dataset.action == "close-all") { - browser.tabs - .query({ + browser.tabs. + query({ cookieStoreId: event.target.dataset.identity - }) - .then(tabs => { + }). + then(tabs => { browser.tabs.remove(tabs.map(i => i.id)); }); } @@ -33,7 +33,10 @@ function eventHandler(event) { } function createOptions(node, identity) { - for (let option of ["Create", "Close All"]) { + for (let option of [ +"Create", +"Close All" +]) { let a = document.createElement("a"); a.href = "#"; a.innerText = option; @@ -50,11 +53,11 @@ if (browser.contextualIdentities === undefined) { div.innerText = "browser.contextualIdentities not available. Check that the privacy.userContext.enabled pref is set to true, and reload the add-on."; } else { - browser.contextualIdentities - .query({ + browser.contextualIdentities. + query({ name: titlepref - }) - .then(identities => { + }). + then(identities => { if (!identities.length) { div.innerText = "No identities returned from the API."; return; diff --git a/debian/changelog b/debian/changelog index 3df20c5..113deb3 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,10 +1,16 @@ +i2psetproxy.js (0.53-1) UNRELEASED; urgency=low + + * Quick Fix + + -- idk Sat, 23 NOV 2019 20:11:30 -0400 + i2psetproxy.js (0.51-1) UNRELEASED; urgency=low * Numerous code cleanups, compatibility fixes * enable-disable history * better homepage, better control panel, saner options - -- idk Sat, 23 NOV 2019 22:51:11 -0400 + -- idk Sat, 23 NOV 2019 20:10:30 -0400 i2psetproxy.js (0.49-1) UNRELEASED; urgency=low diff --git a/handler.js b/handler.js index 379d77d..b3178b2 100644 --- a/handler.js +++ b/handler.js @@ -40,6 +40,6 @@ var handlerSetup = async function(requestDetails) { browser.webRequest.onBeforeRequest.addListener( handlerSetup, - { urls: [""] }, + {urls: [""]}, ["blocking"] ); diff --git a/info.js b/info.js index 90d908c..255b6c3 100644 --- a/info.js +++ b/info.js @@ -13,7 +13,9 @@ function checkHistory() { var getting = browser.storage.local.get("disable_history"); getting.then(got => { disable_history = got.disable_history; - if (disable_history == undefined) disable_history = false; + if (disable_history == undefined) { +disable_history = false; +} console.log("checking history", disable_history); document.getElementById("disable-history").checked = disable_history; }); @@ -71,17 +73,17 @@ document.addEventListener("click", e => { echo("I2P Router Detected", "panel-section-i2pcontrol-check"); } else if (e.target.id === "enable-web-rtc") { if (e.target.checked) { - browser.runtime.sendMessage({ rtc: "enableWebRTC" }); + browser.runtime.sendMessage({rtc: "enableWebRTC"}); } else { - browser.runtime.sendMessage({ rtc: "disableWebRTC" }); + browser.runtime.sendMessage({rtc: "disableWebRTC"}); } //checkPeerConnection() return; } else if (e.target.id === "disable-history") { if (e.target.checked) { - browser.runtime.sendMessage({ history: "disableHistory" }); + browser.runtime.sendMessage({history: "disableHistory"}); } else { - browser.runtime.sendMessage({ history: "enableHistory" }); + browser.runtime.sendMessage({history: "enableHistory"}); } //checkHistory() return; @@ -166,8 +168,9 @@ function onVisited(historyItem) { searching.then(onCleaned); } if (!history) { - if (i2pHost(historyItem.url)) - var deletingUrl = browser.history.deleteUrl(historyItem.url); + if (i2pHost(historyItem.url)) { +var deletingUrl = browser.history.deleteUrl(historyItem.url); +} deletingUrl.then(onRemoved); } } diff --git a/manifest.json b/manifest.json index 3d64bce..5df4b48 100644 --- a/manifest.json +++ b/manifest.json @@ -23,8 +23,8 @@ ], "manifest_version": 2, "name": "__MSG_extensionName__", - "version": "0.51", - "version_name": "0.51", + "version": "0.52", + "version_name": "0.52", "description": "__MSG_extensionDescription__", "homepage_url": "https://github.com/eyedeekay/i2psetproxy.js", "icons": { diff --git a/privacy.js b/privacy.js index 320ef57..ba6bb37 100644 --- a/privacy.js +++ b/privacy.js @@ -208,7 +208,13 @@ function EnableSavePasswords() { var defaultSettings = { since: "forever", - dataTypes: ["downloads", "passwords", "formData", "localStorage", "history"] + dataTypes: [ +"downloads", +"passwords", +"formData", +"localStorage", +"history" +] }; var appSettings = { @@ -268,33 +274,33 @@ function forgetBrowsingData(storedSettings) { }); browser.browsingData.removeCache({}); console.log("cleared Cache"); - browser.browsingData - .removePasswords({ + browser.browsingData. + removePasswords({ hostnames: [i2pHostName(item.url)], since - }) - .then(onContextGotLog); + }). + then(onContextGotLog); console.log("cleared Passwords"); - browser.browsingData - .removeDownloads({ + browser.browsingData. + removeDownloads({ hostnames: [i2pHostName(item.url)], since - }) - .then(onContextGotLog); + }). + then(onContextGotLog); console.log("cleared Downloads"); - browser.browsingData - .removeFormData({ + browser.browsingData. + removeFormData({ hostnames: [i2pHostName(item.url)], since - }) - .then(onContextGotLog); + }). + then(onContextGotLog); console.log("cleared Form Data"); - browser.browsingData - .removeLocalStorage({ + browser.browsingData. + removeLocalStorage({ hostnames: [i2pHostName(item.url)], since - }) - .then(onContextGotLog); + }). + then(onContextGotLog); console.log("cleared Local Storage"); contexts = browser.contextualIdentities.query({ diff --git a/proxy.js b/proxy.js index c1e4dc9..bf09409 100644 --- a/proxy.js +++ b/proxy.js @@ -235,9 +235,7 @@ function SetupSettings() { console.log("Initialising Control Host", storedSettings.control_host); setupProxy(); } - var gettingControlHostStoredSettings = browser.storage.local.get( - "control_host" - ); + var gettingControlHostStoredSettings = browser.storage.local.get("control_host"); gettingControlHostStoredSettings.then( checkControlHostStoredSettings, onError @@ -254,9 +252,7 @@ function SetupSettings() { console.log("Initialising Control Port", storedSettings.control_port); setupProxy(); } - var gettingControlPortStoredSettings = browser.storage.local.get( - "control_port" - ); + var gettingControlPortStoredSettings = browser.storage.local.get("control_port"); gettingControlPortStoredSettings.then( checkControlPortStoredSettings, onError @@ -276,9 +272,7 @@ function SetupSettings() { ); setupProxy(); } - var gettingHistoryStoredSettings = browser.storage.local.get( - "disable_history" - ); + var gettingHistoryStoredSettings = browser.storage.local.get("disable_history"); gettingHistoryStoredSettings.then(checkHistoryStoredSettings, onError); } @@ -333,11 +327,11 @@ function getControlPort() { } function setupProxy() { - //var controlHost = getControlHost(); - //var controlPort = getControlPort(); - //var Host = getHost(); - //var Port = getPort(); - //var Scheme = getScheme(); + /* var controlHost = getControlHost(); + var controlPort = getControlPort(); + var Host = getHost(); + var Port = getPort(); + var Scheme = getScheme(); */ /**/ console.log("Setting up Firefox WebExtension proxy"); diff --git a/scrub.js b/scrub.js index 8e9aab8..72d69c2 100644 --- a/scrub.js +++ b/scrub.js @@ -59,7 +59,9 @@ var contextScrub = async function(requestDetails) { try { console.log("(scrub)Tab ID from Request", tabId); let ostype = await browser.runtime.getPlatformInfo(); - if (ostype == android) tabId += 1; + if (ostype == android) { + tabId += 1; +} let tabInfo = await browser.tabs.get(tabId); return tabInfo; } catch (error) { @@ -350,12 +352,15 @@ var contextSetup = async function(requestDetails) { browser.webRequest.onBeforeRequest.addListener( contextSetup, - { urls: [""] }, + {urls: [""]}, ["blocking"] ); browser.webRequest.onBeforeSendHeaders.addListener( contextScrub, - { urls: [""] }, - ["blocking", "requestHeaders"] + {urls: [""]}, + [ +"blocking", +"requestHeaders" +] ); diff --git a/smartlander.pdf b/smartlander.pdf new file mode 100644 index 0000000..4e16306 Binary files /dev/null and b/smartlander.pdf differ