Compare commits
71 Commits
secure-mar
...
innet-upda
Author | SHA1 | Date | |
---|---|---|---|
80c66ba2f7 | |||
4d317eac4c | |||
4755637206 | |||
b84d8945aa | |||
7e1428310b | |||
7cc6dbfdf0 | |||
e95d67db4b | |||
a261f7875a | |||
78141f2839 | |||
75d23a752c | |||
03cc374c54 | |||
89f8496bb8 | |||
15489b7f10 | |||
3a67d00741 | |||
d5a0edfd68 | |||
1853292b99 | |||
f575f95ee2 | |||
97146391e8 | |||
31af292a47 | |||
ac548b58b0 | |||
aa6a9a0da8 | |||
7bfc4f8c66 | |||
ffc29deb8e | |||
78a01f6cc1 | |||
d09bb59a1f | |||
e2f8a439b6 | |||
95a282c07f | |||
02f3cc871d | |||
5d260c5a3e | |||
b5758839e1 | |||
a473da6a8e | |||
75b4ff4b60 | |||
d3cf9e8686 | |||
7bd7701aeb | |||
87c3a62f25 | |||
4bc984a72d | |||
7b6438dce5 | |||
80d5367fed | |||
a7902632bc | |||
199e6577bb | |||
00fd0aed62 | |||
daaebe027d | |||
3d39e75ffd | |||
e013c093d8 | |||
5b51fc2c27 | |||
65e43abe02 | |||
7f810f86d0 | |||
899974c339 | |||
6f30aeaf06 | |||
d285063b4f | |||
ffa282671b | |||
e9acc1fe35 | |||
04ebfedb84 | |||
23d451cf92 | |||
44628a1358 | |||
04782aa099 | |||
ff4302eb2b | |||
9185a4daf2 | |||
6b6a73dbdb | |||
1729656189 | |||
08b31efbfc | |||
e124d61115 | |||
e6e914cefe | |||
4d2e68f79d | |||
b5bb8ec694 | |||
f0651edb06 | |||
49ce0162d1 | |||
153a49e18f | |||
88cc54217c | |||
83bb92c0cb | |||
f337e64b81 |
45
Makefile
@ -37,11 +37,11 @@ clean: rc clean-artifacts
|
||||
## EVEN RELEASES are AMO RELEASES
|
||||
## ODD RELEASES are SELFHOSTED RELEASES
|
||||
|
||||
MOZ_VERSION=0.98
|
||||
VERSION=0.97
|
||||
MOZ_VERSION=0.128
|
||||
VERSION=0.127
|
||||
|
||||
## INCREMENT THIS EVERY TIME YOU DO A RELEASE
|
||||
LAST_VERSION=0.95
|
||||
LAST_VERSION=0.125
|
||||
|
||||
YELLOW=F7E59A
|
||||
ORANGE=FFC56D
|
||||
@ -64,7 +64,7 @@ amo-readme:
|
||||
sed 's|</h3>|</strong>|g' | \
|
||||
grep -v '<img' > amo-index.html
|
||||
|
||||
MAGNET=`torrent2magnet i2ppb@eyedeekay.github.io.xpi.torrent`
|
||||
MAGNET=`rhash --magnet i2ppb@eyedeekay.github.io.xpi.torrent`
|
||||
|
||||
index:
|
||||
@echo "<!DOCTYPE html>" > index.html
|
||||
@ -98,15 +98,15 @@ version:
|
||||
sed -i 's|7647|7657|g' *.js* torrent/*.js*
|
||||
sed -i 's|$(shell grep "\"version\": " manifest.json)| \"version\": \"$(VERSION)\",|g' manifest.json
|
||||
# sed -i 's|$(shell grep "\"version_name\": " manifest.json)| \"version_name\": \"$(VERSION)\",|g' manifest.json
|
||||
sed -si 's|$(shell grep $(LAST_VERSION) _locales/en/messages.json)| "message": "$(VERSION)",|g' _locales/en/messages.json; true
|
||||
sed -si 's|$(shell grep $(MOZ_VERSION) _locales/en/messages.json)| "message": "$(VERSION)",|g' _locales/en/messages.json; true
|
||||
find . -name 'messages.json' -exec sed -i 's|$(LAST_VERSION)|$(VERSION)|g' {} \;
|
||||
find . -name 'messages.json' -exec sed -i 's|$(MOZ_VERSION)|$(VERSION)|g' {} \;
|
||||
|
||||
moz-version:
|
||||
sed -i 's|7647|7657|g' *.js* torrent/*.js*
|
||||
sed -i 's|$(shell grep "\"version\": " manifest.json)| \"version\": \"$(MOZ_VERSION)\",|g' manifest.json
|
||||
# sed -i 's|$(shell grep "\"version_name\": " manifest.json)| \"version_name\": \"$(MOZ_VERSION)\",|g' manifest.json
|
||||
sed -si 's|$(shell grep $(LAST_VERSION) _locales/en/messages.json)| "message": "$(MOZ_VERSION)",|g' _locales/en/messages.json; true
|
||||
sed -si 's|$(shell grep $(VERSION) _locales/en/messages.json)| "message": "$(MOZ_VERSION)",|g' _locales/en/messages.json; true
|
||||
find . -name 'messages.json' -exec sed -i 's|$(LAST_VERSION)|$(MOZ_VERSION)|g' {} \;
|
||||
find . -name 'messages.json' -exec sed -i 's|$(VERSION)|$(MOZ_VERSION)|g' {} \;
|
||||
|
||||
rhz-version:
|
||||
sed -i 's|$(shell grep "\"version\": " manifest.json)| \"version\": \"$(VERSION)1\",|g' manifest.json
|
||||
@ -147,7 +147,10 @@ recreate-release: delete-release release upload
|
||||
|
||||
upload: upload-xpi upload-deb
|
||||
|
||||
full-release: release submit upload-xpi torrent upload-torrent deb upload-deb upload-rss seed
|
||||
moz-release: release moz-submit
|
||||
#upload-xpi torrent upload-torrent deb upload-deb upload-rss seed
|
||||
|
||||
full-sign: moz-sign upload-xpi torrent upload-torrent deb upload-deb upload-rss seed
|
||||
|
||||
WEB_EXT_API_KEY=AMO_KEY
|
||||
WEB_EXT_API_SECRET=AMO_SECRET
|
||||
@ -168,7 +171,7 @@ moz-sign: version clean-artifacts
|
||||
@echo "Using the 'sign' target to instantly sign an extension for self-distribution"
|
||||
@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."
|
||||
$(HOME)/node_modules/web-ext-submit/extender.sh --channel unlisted --config-discovery false --api-key $(WEB_EXT_API_KEY) --api-secret $(WEB_EXT_API_SECRET)
|
||||
$(HOME)/web-ext/bin/web-ext sign --channel unlisted --config-discovery false --api-key $(WEB_EXT_API_KEY) --api-secret $(WEB_EXT_API_SECRET) --timeout 900000 #--api-url-prefix http://localhost:3000/api/v4
|
||||
make copyss
|
||||
sleep 5
|
||||
|
||||
@ -182,7 +185,7 @@ moz-submit: moz-version
|
||||
@echo "to the Makefile under the variables WEB_EXT_API_KEY and WEB_EXT_API_SECRET."
|
||||
mv manifest.json .manifest.json
|
||||
grep -v update_url .manifest.json > manifest.json
|
||||
web-ext sign --channel listed --config-discovery false --api-key $(WEB_EXT_API_KEY) --api-secret $(WEB_EXT_API_SECRET); true
|
||||
$(HOME)/web-ext/bin/web-ext sign --channel listed --config-discovery false --api-key $(WEB_EXT_API_KEY) --api-secret $(WEB_EXT_API_SECRET) --timeout 900000 --verbose; true #--api-url-prefix http://localhost:3000/api/v4
|
||||
sleep 5
|
||||
mv .manifest.json manifest.json
|
||||
|
||||
@ -284,6 +287,8 @@ fmt-js:
|
||||
fixjsstyle torrent/*.js
|
||||
fixjsstyle i2pcontrol/*.js
|
||||
fixjsstyle manifest.json
|
||||
#work around fixjsstyle issue
|
||||
sed -i 's|= >|=>|g' *.js */*.js
|
||||
#find . -path ./node_modules -prune -o -name '*.json' -exec fixjsstyle --write {} \;
|
||||
|
||||
fmt-prettier:
|
||||
@ -328,7 +333,7 @@ upload-updatemanifest:
|
||||
gothub upload -R -u eyedeekay -r I2P-in-Private-Browsing-Mode-Firefox -t docs -n "updateManifest.json" -f updateManifest.json
|
||||
|
||||
webext:
|
||||
web-ext run -u "about:devtools-toolbox?type=extension&id=i2ppb%40eyedeekay.github.io"
|
||||
$(HOME)/web-ext/bin/web-ext run --firefox /usr/bin/firefox -u "about:devtools-toolbox?type=extension&id=i2ppb%40eyedeekay.github.io"
|
||||
|
||||
snark-mirror:
|
||||
http_proxy=http://127.0.0.1:4444 wget -c -O ../i2psnark-rpc.su3 http://stats.i2p/i2p/plugins/i2psnark-rpc.su3
|
||||
@ -345,7 +350,7 @@ wire:
|
||||
cp -v "../i2ppb-$(VERSION)@eyedeekay.github.io.xpi" "$(HOME)/i2p/MuWireDownloads/"
|
||||
|
||||
ndtest:
|
||||
web-ext run -u about:debugging \
|
||||
$(HOME)/web-ext/bin/web-ext run --firefox /usr/bin/firefox -u about:debugging \
|
||||
-u http://127.0.0.1:7657/home \
|
||||
-u http://127.0.0.1:7657/i2ptunnel \
|
||||
-u http://127.0.0.1:7657/i2psnark \
|
||||
@ -359,10 +364,22 @@ ndtest:
|
||||
-u https://ramble.pw/f/i2p \
|
||||
|
||||
lht-test:
|
||||
web-ext run -u about:debugging \
|
||||
$(HOME)/web-ext/bin/web-ext run --firefox /usr/bin/firefox -u about:debugging \
|
||||
-u http://localhost:7657/home \
|
||||
-u http://localhost:7657/i2ptunnel \
|
||||
-u http://localhost:7657/i2psnark \
|
||||
-u http://localhost:7657/webmail \
|
||||
-u http://localhost:7657/MuWire/ \
|
||||
-u http://idk.i2p
|
||||
|
||||
android:
|
||||
$(HOME)/web-ext/bin/web-ext run --target firefox-android \
|
||||
--android-device NE1GAM7780819544 \
|
||||
--browser-console
|
||||
|
||||
run:
|
||||
$(HOME)/web-ext/bin/web-ext run --firefox /usr/bin/firefox -u about:debugging
|
||||
|
||||
chromium:
|
||||
$(HOME)/web-ext/bin/web-ext run --target chromium
|
||||
|
30
README.md
@ -2,13 +2,14 @@ I2P in Private Browsing Mode(Firefox-Only)
|
||||
==========================================
|
||||
|
||||
This is an 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, like an
|
||||
embedded I2P console and Bittorrent integration with clients using the
|
||||
transmission-rpc API.
|
||||
to Firefox-based browsers(Supporting webextensions, must be current ESR or
|
||||
greater) 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, like an embedded I2P console and Bittorrent integration
|
||||
with clients using the transmission-rpc API and via in-browser protocol handling
|
||||
integrations.
|
||||
|
||||
Privacy Policy
|
||||
--------------
|
||||
@ -115,15 +116,16 @@ Usage:
|
||||
the use of I2PSnark as a peer-to-peer delivery mechanism for media files.
|
||||
* 
|
||||
* 
|
||||
* 
|
||||
* [Started] **Indicate** the level of authenticity provided by TLS. TLS is
|
||||
optional on I2P for now, but some sites offer it anyway. TLS support is
|
||||
experimental and in the works.
|
||||
* [Started] **Provide** alternate, in-I2P destinations for web sites that want to
|
||||
mirror their content within I2P.
|
||||
* [Started] **Enhance** the I2P browsing experience by allowing site developers
|
||||
* [Done] **Enhance** the I2P browsing experience by allowing site developers
|
||||
distribute some or all of their resources as torrents, allowing the torrents to
|
||||
be treated effectively as a CDN.
|
||||
* 
|
||||
* [Done] **Indicate** the level of authenticity provided by TLS. TLS is
|
||||
optional on I2P for now, but some sites offer it anyway. TLS support is
|
||||
experimental and in the works.
|
||||
* 
|
||||
* [Done] **Provide** alternate, in-I2P destinations for web sites that want to
|
||||
mirror their content within I2P.
|
||||
* [barely started] **Isolate** traffic by contextual identity to it's own HTTP
|
||||
Proxy tunnel, each reflecting it's own pseudonymous identity within I2P. The
|
||||
contextual identities. For now, the contextual identities used to manage
|
||||
|
@ -3,6 +3,10 @@
|
||||
"message": "I2P In Private Browsing",
|
||||
"description": "Name of the extension."
|
||||
},
|
||||
"extensionNameVariant": {
|
||||
"message": "I2P In Private Browsing - Rhizome Variant",
|
||||
"description": "Name of the extension."
|
||||
},
|
||||
"toopieName": {
|
||||
"message": "toopie.html",
|
||||
"description": "Name of the sidebar."
|
||||
@ -16,7 +20,7 @@
|
||||
"description": "Description of the extension."
|
||||
},
|
||||
"extensionVersion": {
|
||||
"message": "0.77",
|
||||
"message": "1.28",
|
||||
"description": "Version of the extension."
|
||||
},
|
||||
"proxyFailedStatus": {
|
||||
@ -167,6 +171,14 @@
|
||||
"message": "Dispatch IRC (Private)",
|
||||
"description": "Preface for the browser titlebar"
|
||||
},
|
||||
"blogPreface": {
|
||||
"message": "Blog",
|
||||
"description": "Preface for the browser titlebar"
|
||||
},
|
||||
"blogPrefacePrivate": {
|
||||
"message": "Blog (Private)",
|
||||
"description": "Preface for the browser titlebar"
|
||||
},
|
||||
"botePreface": {
|
||||
"message": "I2P-Bote Mail",
|
||||
"description": "Preface for the browser titlebar"
|
||||
|
@ -3,6 +3,10 @@
|
||||
"message": "I2P en navegación privada",
|
||||
"description": "Nombre de la extensión."
|
||||
},
|
||||
"extensionNameVariant": {
|
||||
"message": "I2P en navegación privada - Rhizome",
|
||||
"description": "Nombre de la extensión."
|
||||
},
|
||||
"toopieName": {
|
||||
"message": "toopie.html",
|
||||
"description": "Nombre de la barra lateral."
|
||||
@ -16,7 +20,7 @@
|
||||
"description": "Descripción de la extensión."
|
||||
},
|
||||
"extensionVersion": {
|
||||
"message": "0,77",
|
||||
"message": "1.28",
|
||||
"description": "Versión de la extensión."
|
||||
},
|
||||
"proxyFailedStatus": {
|
||||
@ -167,6 +171,14 @@
|
||||
"message": "Despacho de IRC (privado)",
|
||||
"description": "Prefacio de la barra de título del navegador"
|
||||
},
|
||||
"blogPreface": {
|
||||
"message": "Blog",
|
||||
"description": "Prefacio de la barra de título del navegador"
|
||||
},
|
||||
"blogPrefacePrivate": {
|
||||
"message": "Blog (Private)",
|
||||
"description": "Prefacio de la barra de título del navegador"
|
||||
},
|
||||
"botePreface": {
|
||||
"message": "I2P-Bote Mail",
|
||||
"description": "Prefacio de la barra de título del navegador"
|
||||
|
Before Width: | Height: | Size: 314 KiB After Width: | Height: | Size: 309 KiB |
151
background.js
@ -16,6 +16,8 @@ var extensionpref = chrome.i18n.getMessage("extensionPreface");
|
||||
var muwirepref = chrome.i18n.getMessage("muwirePreface");
|
||||
var muwireprefpriv = chrome.i18n.getMessage("muwirePrefacePrivate");
|
||||
var botepref = chrome.i18n.getMessage("botePreface");
|
||||
var blogpref = chrome.i18n.getMessage("blogPreface");
|
||||
var blogprefpriv = chrome.i18n.getMessage("blogPrefacePrivate");
|
||||
|
||||
function onError(err) {
|
||||
console.log("(background)", err);
|
||||
@ -43,6 +45,15 @@ function onContextsGot(contexts) {
|
||||
})
|
||||
.then(onCreated, onNotCreated);
|
||||
}
|
||||
if (ids.indexOf(blogpref) == -1) {
|
||||
browser.contextualIdentities
|
||||
.create({
|
||||
name: blogpref,
|
||||
color: "pink",
|
||||
icon: "pet",
|
||||
})
|
||||
.then(onCreated, onNotCreated);
|
||||
}
|
||||
if (ids.indexOf(webpref) == -1) {
|
||||
browser.contextualIdentities
|
||||
.create({
|
||||
@ -192,7 +203,8 @@ let dtheme = {
|
||||
function themeWindow(window) {
|
||||
// Check if the window is in private browsing
|
||||
function onThemeError() {
|
||||
console.log("theme color set error");
|
||||
console.log("(theme) color set error");
|
||||
browserTheme();
|
||||
}
|
||||
|
||||
function dynamicTheme() {
|
||||
@ -204,39 +216,50 @@ function themeWindow(window) {
|
||||
}
|
||||
|
||||
function browserTheme() {
|
||||
console.log("Active in I2P window");
|
||||
console.log("(theme)Active in I2P window");
|
||||
if (window.incognito) {
|
||||
browser.theme.update(window.id, btheme);
|
||||
} else {
|
||||
browser.theme.update(window.id, btheme);
|
||||
}
|
||||
}
|
||||
|
||||
function unsetTheme() {
|
||||
console.log("(theme)Resetting theme window");
|
||||
browser.theme.reset(window.id);
|
||||
}
|
||||
function logTabs(tabInfo) {
|
||||
function onContextGotTheme(context) {
|
||||
if (context.name == titlepref) {
|
||||
browserTheme();
|
||||
browser.pageAction.show(tabInfo[0].id);
|
||||
} else if (context.name == routerpref) {
|
||||
console.log("Active in Router Console window");
|
||||
console.log("(theme) Active in Router Console window");
|
||||
dynamicTheme();
|
||||
} else if (context.name == tunnelpref) {
|
||||
console.log("Active in Hidden Services Manager window");
|
||||
console.log("(theme) Active in Hidden Services Manager window");
|
||||
dynamicTheme();
|
||||
} else if (context.name == mailpref) {
|
||||
console.log("Active in Web Mail window");
|
||||
console.log("(theme) Active in Web Mail window");
|
||||
dynamicTheme();
|
||||
} else if (context.name == torrentpref) {
|
||||
console.log("Active in Bittorrent window");
|
||||
console.log("(theme) Active in Bittorrent window");
|
||||
dynamicTheme();
|
||||
} else if (context.name == botepref) {
|
||||
console.log("Active in Bote window");
|
||||
console.log("(theme) Active in Bote window");
|
||||
dynamicTheme();
|
||||
} else if (context.name == ircpref) {
|
||||
console.log("Active in IRC window");
|
||||
console.log("(theme) Active in IRC window");
|
||||
dynamicTheme();
|
||||
} else if (context.name == blogpref) {
|
||||
console.log("(theme) (theme) Active in Blog window");
|
||||
dynamicTheme();
|
||||
} else if (context.name == muwirepref) {
|
||||
console.log("Active in MuWire window");
|
||||
console.log("(theme) Active in MuWire window");
|
||||
dynamicTheme();
|
||||
} else {
|
||||
console.log("(theme) Not active in I2P Window");
|
||||
unsetTheme();
|
||||
}
|
||||
}
|
||||
if (
|
||||
@ -247,23 +270,8 @@ function themeWindow(window) {
|
||||
.get(tabInfo[0].cookieStoreId)
|
||||
.then(onContextGotTheme, onThemeError);
|
||||
} else {
|
||||
console.log("Not active in I2P window");
|
||||
function unSetTheme(them) {
|
||||
console.log("unsetting theme", them);
|
||||
if (Object.keys(them).length > 0) {
|
||||
try {
|
||||
browser.theme.update(window.id, them.originalTheme);
|
||||
} catch (e) {
|
||||
console.log(
|
||||
"Original theme set error. Your theme must have an SVG in it.",
|
||||
e
|
||||
);
|
||||
}
|
||||
} else {
|
||||
browser.theme.update(window.id, { colors: null });
|
||||
}
|
||||
}
|
||||
browser.storage.local.get("originalTheme").then(unSetTheme, onError);
|
||||
console.log("(theme) Not active in I2P window");
|
||||
unsetTheme();
|
||||
}
|
||||
}
|
||||
|
||||
@ -310,6 +318,9 @@ function setTitle(window) {
|
||||
} else if (context.name == mailpref) {
|
||||
console.log("Active in I2P Web Mail window");
|
||||
setTitle(mailpref, mailprefpriv);
|
||||
} else if (context.name == blogpref) {
|
||||
console.log("Active in I2P Blog window");
|
||||
setTitle(blogpref, blogprefpriv);
|
||||
} else if (context.name == torrentpref) {
|
||||
console.log("Active in I2P Torrent window");
|
||||
setTitle(torrentpref, torrentprefpriv);
|
||||
@ -365,52 +376,6 @@ gettingListenerInfo.then((got) => {
|
||||
}
|
||||
});
|
||||
|
||||
function handleUpdated(updateInfo) {
|
||||
function maybeSet(them) {
|
||||
console.log("original theme found:", them, Object.keys(them).length);
|
||||
try {
|
||||
if (updateInfo.theme.colors != null) {
|
||||
console.log(
|
||||
"testing theme",
|
||||
updateInfo.theme.colors.toolbar,
|
||||
"!=",
|
||||
btheme.colors.toolbar
|
||||
);
|
||||
console.log(
|
||||
"testing theme",
|
||||
updateInfo.theme.colors.toolbar,
|
||||
"!=",
|
||||
dtheme.colors.toolbar
|
||||
);
|
||||
if (
|
||||
updateInfo.theme.colors.toolbar != dtheme.colors.toolbar &&
|
||||
updateInfo.theme.colors.toolbar != btheme.colors.toolbar
|
||||
) {
|
||||
function onSet() {
|
||||
console.log("stored theme:", updateInfo.theme);
|
||||
}
|
||||
/*if (
|
||||
updateInfo.theme.colors != null &&
|
||||
updateInfo.theme.images != null &&
|
||||
updateInfo.theme.properties != null
|
||||
) {*/
|
||||
console.log("storing theme:", updateInfo.theme);
|
||||
browser.storage.local
|
||||
.set({ originalTheme: updateInfo.theme })
|
||||
.then(onSet, onError);
|
||||
//}
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
console.log("theme storage error", e);
|
||||
}
|
||||
}
|
||||
console.log("Handling theme", updateInfo);
|
||||
browser.storage.local.get("originalTheme").then(maybeSet, onError);
|
||||
}
|
||||
|
||||
browser.theme.onUpdated.addListener(handleUpdated);
|
||||
|
||||
function handleClick() {
|
||||
console.log("Opening page action");
|
||||
browser.pageAction.openPopup();
|
||||
@ -464,20 +429,42 @@ browser.webRequest.onHeadersReceived.addListener(
|
||||
function onClosedWindowCheck() {
|
||||
var getContext = browser.contextualIdentities.query({ name: titlepref });
|
||||
function checkTabs(ctx) {
|
||||
function conditionallyDelete(tabs) {
|
||||
if (tabs.length == 0) {
|
||||
browser.contextualIdentities.remove(ctx[0].cookieStoreId);
|
||||
browser.contextualIdentities
|
||||
.query({})
|
||||
.then(onContextsGot, onContextsError);
|
||||
for (let context in ctx) {
|
||||
function conditionallyDelete(tabs) {
|
||||
if (tabs.length == 0) {
|
||||
browser.contextualIdentities.remove(context.cookieStoreId);
|
||||
}
|
||||
}
|
||||
var tabs = browser.tabs.query({ cookieStoreId: context.cookieStoreId });
|
||||
tabs.then(conditionallyDelete, onError);
|
||||
}
|
||||
var tabs = browser.tabs.query({ cookieStoreId: ctx[0].cookieStoreId });
|
||||
tabs.then(conditionallyDelete, onError);
|
||||
}
|
||||
getContext.then(checkTabs, onError);
|
||||
}
|
||||
|
||||
function onOpenedWindowCheck() {
|
||||
var getContext = browser.contextualIdentities.query({ name: titlepref });
|
||||
function checkTabs(ctx) {
|
||||
for (let context in ctx) {
|
||||
function conditionallyDelete(tabs) {
|
||||
if (tabs.length == 0 && context != 0) {
|
||||
console.log(context);
|
||||
browser.contextualIdentities.remove(context.cookieStoreId);
|
||||
}
|
||||
}
|
||||
var tabs = browser.tabs.query({ cookieStoreId: context.cookieStoreId });
|
||||
tabs.then(conditionallyDelete, onError);
|
||||
}
|
||||
}
|
||||
getContext.then(checkTabs, onError);
|
||||
}
|
||||
|
||||
onOpenedWindowCheck();
|
||||
|
||||
browser.tabs.onRemoved.addListener(onClosedWindowCheck);
|
||||
browser.windows.onRemoved.addListener(onClosedWindowCheck);
|
||||
browser.windows.onCreated.addListener(onClosedWindowCheck);
|
||||
|
||||
if (browser.windows != undefined) {
|
||||
console.log("windows unavailable on android", browser.runtime.PlatformOs);
|
||||
browser.windows.onRemoved.addListener(onClosedWindowCheck);
|
||||
browser.windows.onCreated.addListener(onOpenedWindowCheck);
|
||||
}
|
||||
|
@ -235,8 +235,10 @@ function conditionalBookmarksSetup(obj) {
|
||||
}
|
||||
|
||||
if (browser != null) {
|
||||
let gettingStorage = browser.storage.local.get("bookmarks_state");
|
||||
gettingStorage.then(conditionalBookmarksSetup, bookmarksSetup);
|
||||
if (browser.windows != undefined) {
|
||||
let gettingStorage = browser.storage.local.get("bookmarks_state");
|
||||
gettingStorage.then(conditionalBookmarksSetup, bookmarksSetup);
|
||||
}
|
||||
}
|
||||
|
||||
const bookmarksButton = document.getElementById("bookmarksButton");
|
||||
|
BIN
clearweb.png
Before Width: | Height: | Size: 126 KiB After Width: | Height: | Size: 215 KiB |
39
content.js
@ -50,4 +50,43 @@ contentUpdateById("releases", "releases");
|
||||
|
||||
fetch("http://proxy.i2p").then((myJson) => {
|
||||
contentUpdateById("proxy-check", "proxySuccessStatus");
|
||||
let readyness = document.querySelectorAll(".readyness");
|
||||
if (readyness != null) {
|
||||
hide(readyness);
|
||||
}
|
||||
});
|
||||
|
||||
function hide(elements) {
|
||||
elements = elements.length ? elements : [elements];
|
||||
for (var index = 0; index < elements.length; index++) {
|
||||
elements[index].style.display = "none";
|
||||
}
|
||||
}
|
||||
|
||||
function unhide(elements) {
|
||||
elements = elements.length ? elements : [elements];
|
||||
for (var index = 0; index < elements.length; index++) {
|
||||
elements[index].style.display = "inline-block";
|
||||
}
|
||||
}
|
||||
|
||||
//TODO: Don't hard-code this.
|
||||
fetch("http://127.0.0.1:7657/themes/console/light/images/i2plogo.png")
|
||||
.then((myJson) => {
|
||||
var consoleLinks = document.querySelectorAll(".application-info");
|
||||
unhide(consoleLinks);
|
||||
})
|
||||
.catch((error) => {
|
||||
var consoleLinks = document.querySelectorAll(".application-info");
|
||||
hide(consoleLinks);
|
||||
});
|
||||
|
||||
fetch("http://127.0.0.1:7657/jsonrpc/")
|
||||
.then((myJson) => {
|
||||
var toopieLinks = document.querySelectorAll(".window-visit-toopie");
|
||||
unhide(toopieLinks);
|
||||
})
|
||||
.catch((error) => {
|
||||
var toopieLinks = document.querySelectorAll(".window-visit-toopie");
|
||||
hide(toopieLinks);
|
||||
});
|
||||
|
97
debian/changelog
vendored
@ -1,3 +1,100 @@
|
||||
i2psetproxy.js (0.125-1) UNRELEASED; urgency=low
|
||||
|
||||
* Bump and resubmit to mozilla.
|
||||
|
||||
-- idk <hankhill19580@gmail.com> Wed, 3 Nov 2021 00:20:33 -0400
|
||||
|
||||
i2psetproxy.js (0.123-1) UNRELEASED; urgency=low
|
||||
|
||||
* Bump and resubmit to mozilla.
|
||||
* I am not going to optionally keep cookies.
|
||||
* That would be introducing a pointless security issue.
|
||||
|
||||
-- idk <hankhill19580@gmail.com> Wed, 30 Oct 2021 10:11:51 -0400
|
||||
|
||||
i2psetproxy.js (0.121-1) UNRELEASED; urgency=low
|
||||
|
||||
* switch to browser_specific_settings manifest key
|
||||
|
||||
-- idk <hankhill19580@gmail.com> Wed, 13 Oct 2021 21:28:28 -0400
|
||||
|
||||
i2psetproxy.js (0.119-1) UNRELEASED; urgency=low
|
||||
|
||||
* Fixes to ease releasing via AMO
|
||||
|
||||
-- idk <hankhill19580@gmail.com> Wed, 13 Oct 2021 20:37:30 -0400
|
||||
|
||||
i2psetproxy.js (0.117-1) UNRELEASED; urgency=low
|
||||
|
||||
* Switch to legwork for search provider.
|
||||
* admin isn't answering, but the service is up unlike yacy.idk.i2p.
|
||||
|
||||
-- idk <hankhill19580@gmail.com> Mon, 4 Oct 2021 20:38:59 -0400
|
||||
|
||||
i2psetproxy.js (0.115-1) UNRELEASED; urgency=low
|
||||
|
||||
* Improve functionality of X-I2P-Location and X-I2P-Torrentlocation
|
||||
* Fix usage of browser.theme.reset()
|
||||
* Add checks to disable features that are broken on Android
|
||||
|
||||
-- idk <hankhill19580@gmail.com> Fri, 1 Oct 2021 15:29:22 -0400
|
||||
|
||||
i2psetproxy.js (0.113-1) UNRELEASED; urgency=low
|
||||
|
||||
* Fix checks on BRB, railroad containers
|
||||
|
||||
-- idk <hankhill19580@gmail.com> Sun, 26 Sep 2021 00:37:22 -0400
|
||||
|
||||
i2psetproxy.js (0.111-1) UNRELEASED; urgency=low
|
||||
|
||||
* simplify background theme issue fix
|
||||
|
||||
-- idk <hankhill19580@gmail.com> Wed, 07 Jul 2021 23:27:27 -0400
|
||||
|
||||
i2psetproxy.js (0.109-1) UNRELEASED; urgency=low
|
||||
|
||||
* connection interrupted mid release, retry failed validation. Bump and retry
|
||||
|
||||
-- idk <hankhill19580@gmail.com> Wed, 07 Jul 2021 22:00:25 -0400
|
||||
|
||||
connection interrupted mid release, retry failed validation. Bump and retry
|
||||
|
||||
i2psetproxy.js (0.107-1) UNRELEASED; urgency=low
|
||||
|
||||
* Small code fixes
|
||||
* Fix for interference with non-I2P containers
|
||||
|
||||
-- idk <hankhill19580@gmail.com> Wed, 07 Jul 2021 22:00:25 -0400
|
||||
|
||||
i2psetproxy.js (0.105-1) UNRELEASED; urgency=low
|
||||
|
||||
* Add help page for configuring i2pcontrol
|
||||
* Add help page for configuring i2psnark-rpc
|
||||
* Update the icons
|
||||
|
||||
-- idk <hankhill19580@gmail.com> Wed, 26 May 2021 12:56:56 -0400
|
||||
|
||||
i2psetproxy.js (0.103-1) UNRELEASED; urgency=low
|
||||
|
||||
* Fix for double-test issue on /home.html page in the extension
|
||||
* Fix for broken options menu
|
||||
|
||||
-- idk <hankhill19580@gmail.com> Wed, 26 May 2021 12:56:56 -0400
|
||||
|
||||
i2psetproxy.js (0.101-1) UNRELEASED; urgency=low
|
||||
|
||||
* Sweeping changes to styles
|
||||
* fix for issue when using noscript and visiting susimail
|
||||
|
||||
-- idk <hankhill19580@gmail.com> Mon, 24 May 2021 3:41:35 -0400
|
||||
|
||||
i2psetproxy.js (0.99-1) UNRELEASED; urgency=low
|
||||
|
||||
* Sweeping changes to styles
|
||||
* fix for issue when using noscript and visiting susimail
|
||||
|
||||
-- idk <hankhill19580@gmail.com> Mon, 24 May 2021 2:05:21 -0400
|
||||
|
||||
i2psetproxy.js (0.97-1) UNRELEASED; urgency=low
|
||||
|
||||
* Fix theme issue, add x-i2p-torrentlocation HEADER support
|
||||
|
@ -19,8 +19,10 @@ function routerHost(url) {
|
||||
console.log("(urlcheck) Torrent application path", final);
|
||||
return "i2psnark";
|
||||
} else if (final === "webmail" || final === "susimail") {
|
||||
console.log("(urlcheck) Mail application path", final);
|
||||
return "webmail";
|
||||
if (!url.includes(".css")) {
|
||||
console.log("(urlcheck) Mail application path", final);
|
||||
return "webmail";
|
||||
}
|
||||
} else if (final.startsWith("MuWire")) {
|
||||
if (!url.includes(".png")) {
|
||||
console.log("(urlcheck) MuWire application path", final);
|
||||
@ -35,6 +37,8 @@ function routerHost(url) {
|
||||
final === "home" ||
|
||||
final === "console" ||
|
||||
final === "dns" ||
|
||||
final === "susidns" ||
|
||||
final.startsWith("susidns") ||
|
||||
final === "sitemap" ||
|
||||
final.startsWith("config")
|
||||
) {
|
||||
|
170
home.css
@ -1,23 +1,19 @@
|
||||
|
||||
|
||||
* {
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
margin: 0
|
||||
}
|
||||
|
||||
html {
|
||||
margin: 0 4%;
|
||||
padding: 0 20px;
|
||||
min-height: 100%;
|
||||
background: #9ab;
|
||||
background: repeating-linear-gradient(to bottom, #9ab, #89a 2px);
|
||||
scrollbar-color: #bcd #789;
|
||||
scrollbar-color: #bcd #789
|
||||
}
|
||||
|
||||
body {
|
||||
margin: 0;
|
||||
padding: 20px 40px;
|
||||
font-family: Open Sans, Noto Sans, Segoe UI, sans-serif;
|
||||
font-family: Open Sans,Noto Sans,Segoe UI,sans-serif;
|
||||
font-size: 12pt;
|
||||
color: #495057;
|
||||
text-decoration: none;
|
||||
@ -25,51 +21,46 @@ body {
|
||||
border-left: 1px solid #495057;
|
||||
border-right: 1px solid #495057;
|
||||
box-shadow: 0 0 2px 2px rgba(0, 0, 0, .1);
|
||||
background: #f2f2f2;
|
||||
background: #f2f2f2
|
||||
}
|
||||
|
||||
h1, h2, h3, h4 {
|
||||
h1,
|
||||
h2,
|
||||
h3,
|
||||
h4 {
|
||||
display: block;
|
||||
font-weight: 700;
|
||||
font-weight: 700
|
||||
}
|
||||
|
||||
h1 {
|
||||
text-transform: uppercase;
|
||||
font-weight: 900;
|
||||
font-size: 200%;
|
||||
font-size: 200%
|
||||
}
|
||||
|
||||
h2 {
|
||||
font-size: 140%;
|
||||
font-size: 140%
|
||||
}
|
||||
|
||||
h3 {
|
||||
font-size: 120%;
|
||||
font-size: 120%
|
||||
}
|
||||
|
||||
h4 {
|
||||
margin-bottom: 5px;
|
||||
text-align: right;
|
||||
text-transform: none;
|
||||
font-size: 90%;
|
||||
font-weight: 600;
|
||||
font-style: italic;
|
||||
font-style: italic
|
||||
}
|
||||
|
||||
p {
|
||||
margin-bottom: 15px;
|
||||
width: 100%;
|
||||
line-height: 1.4;
|
||||
word-wrap: break-word;
|
||||
text-align: justify;
|
||||
text-decoration: none;
|
||||
text-decoration: none
|
||||
}
|
||||
|
||||
ul {
|
||||
margin: 10px 20px;
|
||||
list-style: none;
|
||||
list-style: none
|
||||
}
|
||||
|
||||
li {
|
||||
margin-left: 0;
|
||||
padding: 12px 15px 15px 20px;
|
||||
@ -78,63 +69,58 @@ li {
|
||||
border: 1px solid #9ab;
|
||||
border-radius: 2px;
|
||||
box-shadow: inset 0 0 0 1px #fff;
|
||||
background: #dee2e6;
|
||||
background: #dee2e6
|
||||
}
|
||||
|
||||
li li {
|
||||
padding-bottom: 0;
|
||||
width: calc(100% - 40px);
|
||||
text-align: left;
|
||||
border: none;
|
||||
border-top: 1px solid #9ab;
|
||||
box-shadow: none;
|
||||
box-shadow: none
|
||||
}
|
||||
|
||||
li li:first-of-type {
|
||||
margin-top: 15px;
|
||||
border-top: none;
|
||||
border-top: none
|
||||
}
|
||||
|
||||
li a:first-of-type {
|
||||
display: block;
|
||||
width: 100%;
|
||||
width: 100%
|
||||
}
|
||||
|
||||
#applicationExplain {
|
||||
float: unset;
|
||||
float: unset
|
||||
}
|
||||
|
||||
li+li {
|
||||
margin-top: 15px;
|
||||
margin-top: 15px
|
||||
}
|
||||
|
||||
h3+ul, ul+h3, ul+h2 {
|
||||
margin-top: 20px;
|
||||
h3+ul,
|
||||
ul+h2,
|
||||
ul+h3 {
|
||||
margin-top: 20px
|
||||
}
|
||||
|
||||
a, button {
|
||||
a,
|
||||
button {
|
||||
color: #3b6bbf;
|
||||
text-decoration: none;
|
||||
font-weight: 700;
|
||||
word-wrap: break-word;
|
||||
outline: 0;
|
||||
outline: 0
|
||||
}
|
||||
|
||||
.applicationDesc {
|
||||
color: #81888f;
|
||||
text-decoration: none;
|
||||
font-weight: 700;
|
||||
word-wrap: break-word;
|
||||
outline: 0;
|
||||
outline: 0
|
||||
}
|
||||
|
||||
.applicationDesc:hover, a:hover, button:hover {
|
||||
.applicationDesc:hover,
|
||||
a:hover,
|
||||
button:hover {
|
||||
text-decoration: none;
|
||||
font-weight: 700;
|
||||
word-wrap: break-word;
|
||||
outline: 0;
|
||||
outline: 0
|
||||
}
|
||||
|
||||
button {
|
||||
border: none;
|
||||
cursor: pointer;
|
||||
@ -142,14 +128,12 @@ button {
|
||||
text-decoration: none;
|
||||
font-weight: 700;
|
||||
word-wrap: break-word;
|
||||
outline: 0;
|
||||
outline: 0
|
||||
}
|
||||
|
||||
.background {
|
||||
background-color: #f8f8ff;
|
||||
height: 100%;
|
||||
height: 100%
|
||||
}
|
||||
|
||||
.content {
|
||||
margin: 1.5rem;
|
||||
padding: 1rem;
|
||||
@ -158,11 +142,14 @@ button {
|
||||
display: inline-block;
|
||||
border: 1px solid #d9d9d6;
|
||||
border-radius: 2px;
|
||||
box-shadow: inset 0 0 0 1px #fff, 0 0 1px #ccc;
|
||||
background: #f8f8ff;
|
||||
box-shadow: inset 0 0 0 1px #fff,0 0 1px #ccc;
|
||||
background: #f8f8ff
|
||||
}
|
||||
|
||||
#header, .application-info, .browser-info, .extended-info, .search-info {
|
||||
#header,
|
||||
.application-info,
|
||||
.browser-info,
|
||||
.extended-info,
|
||||
.search-info {
|
||||
margin-top: 1.5rem;
|
||||
padding: 1rem;
|
||||
min-height: 3rem;
|
||||
@ -170,15 +157,14 @@ button {
|
||||
display: inline-block;
|
||||
border: 1px solid #d9d9d6;
|
||||
border-radius: 2px;
|
||||
box-shadow: inset 0 0 0 1px #fff, 0 0 1px #ccc;
|
||||
background: #f8f8ff;
|
||||
box-shadow: inset 0 0 0 1px #fff,0 0 1px #ccc;
|
||||
background: #f8f8ff
|
||||
}
|
||||
|
||||
.showhider {
|
||||
margin-right: auto;
|
||||
padding: 0!important;
|
||||
text-transform: uppercase;
|
||||
background: none !important;
|
||||
background: none!important;
|
||||
border: none;
|
||||
width: 90%;
|
||||
color: #3b6bbf;
|
||||
@ -186,19 +172,16 @@ button {
|
||||
font-weight: 700;
|
||||
word-wrap: break-word;
|
||||
outline: 0;
|
||||
text-align: left;
|
||||
text-align: left
|
||||
}
|
||||
|
||||
#links .showhider {
|
||||
font-size: 25px;
|
||||
font-size: 25px
|
||||
}
|
||||
|
||||
.section-header {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
margin-bottom: 80px;
|
||||
margin-bottom: 80px
|
||||
}
|
||||
|
||||
#readyness {
|
||||
padding-top: 1rem;
|
||||
padding-bottom: 1rem;
|
||||
@ -209,10 +192,9 @@ button {
|
||||
text-align: center!important;
|
||||
border: 1px solid #dee2e6;
|
||||
border-radius: 2px;
|
||||
box-shadow: inset 0 0 0 1px #fff, 0 0 1px #ccc;
|
||||
display: inline-block;
|
||||
box-shadow: inset 0 0 0 1px #fff,0 0 1px #ccc;
|
||||
display: inline-block
|
||||
}
|
||||
|
||||
#onboarding {
|
||||
min-height: 5rem;
|
||||
padding: .5rem;
|
||||
@ -225,9 +207,8 @@ button {
|
||||
text-align: center!important;
|
||||
border: 1px solid #a48fe1;
|
||||
border-radius: 2px;
|
||||
box-shadow: inset 0 0 0 1px #fff, 0 0 1px #ccc;
|
||||
box-shadow: inset 0 0 0 1px #fff,0 0 1px #ccc
|
||||
}
|
||||
|
||||
#i2pbrowser-description {
|
||||
padding-top: 1rem;
|
||||
padding-bottom: 1rem;
|
||||
@ -237,9 +218,8 @@ button {
|
||||
background: #dee2e6;
|
||||
border: 1px solid #dee2e6;
|
||||
border-radius: 2px;
|
||||
box-shadow: inset 0 0 0 1px #fff, 0 0 1px #ccc;
|
||||
box-shadow: inset 0 0 0 1px #fff,0 0 1px #ccc
|
||||
}
|
||||
|
||||
#linksExplain {
|
||||
min-height: 5rem;
|
||||
padding: .5rem;
|
||||
@ -250,10 +230,10 @@ button {
|
||||
text-align: center!important;
|
||||
border: 1px solid #dee2e6;
|
||||
border-radius: 2px;
|
||||
box-shadow: inset 0 0 0 1px #fff, 0 0 1px #ccc;
|
||||
box-shadow: inset 0 0 0 1px #fff,0 0 1px #ccc
|
||||
}
|
||||
|
||||
#applicationExplain, #controlExplain {
|
||||
#applicationExplain,
|
||||
#controlExplain {
|
||||
min-height: 5rem;
|
||||
padding: .5rem;
|
||||
margin: .5rem;
|
||||
@ -263,10 +243,9 @@ button {
|
||||
text-align: center!important;
|
||||
border: 1px solid #dee2e6;
|
||||
border-radius: 2px;
|
||||
box-shadow: inset 0 0 0 1px #fff, 0 0 1px #ccc;
|
||||
float: left;
|
||||
box-shadow: inset 0 0 0 1px #fff,0 0 1px #ccc;
|
||||
float: left
|
||||
}
|
||||
|
||||
#proxyReady {
|
||||
min-height: 3rem;
|
||||
padding: .5rem;
|
||||
@ -279,9 +258,8 @@ button {
|
||||
text-align: center!important;
|
||||
border: 1px solid #d9d9d6;
|
||||
border-radius: 2px;
|
||||
box-shadow: inset 0 0 0 1px #fff, 0 0 1px #ccc;
|
||||
box-shadow: inset 0 0 0 1px #fff,0 0 1px #ccc
|
||||
}
|
||||
|
||||
#proxyUnready {
|
||||
min-height: 3rem;
|
||||
padding: .5rem;
|
||||
@ -294,9 +272,8 @@ button {
|
||||
border: 1px solid #ffc56d;
|
||||
border-radius: 2px;
|
||||
background: #ffc56d;
|
||||
box-shadow: inset 0 0 0 1px #fff, 0 0 1px #ccc;
|
||||
box-shadow: inset 0 0 0 1px #fff,0 0 1px #ccc
|
||||
}
|
||||
|
||||
#consoleOn {
|
||||
min-height: 3rem;
|
||||
padding: .5rem;
|
||||
@ -309,49 +286,42 @@ button {
|
||||
border: 1px solid #f7e59a;
|
||||
border-radius: 2px;
|
||||
background: #f7e59a;
|
||||
box-shadow: inset 0 0 0 1px #fff, 0 0 1px #ccc;
|
||||
box-shadow: inset 0 0 0 1px #fff,0 0 1px #ccc
|
||||
}
|
||||
|
||||
.onboardingContent {
|
||||
font-size: .8rem!important;
|
||||
text-align: left;
|
||||
display: none;
|
||||
display: none
|
||||
}
|
||||
|
||||
#info-content {
|
||||
display: none;
|
||||
display: none
|
||||
}
|
||||
|
||||
.consoleOn:hover #proxy-check, .proxyReady:hover #proxy-check {
|
||||
.consoleOn:hover #proxy-check,
|
||||
.proxyReady:hover #proxy-check {
|
||||
visibility: visible;
|
||||
opacity: 1;
|
||||
opacity: 1
|
||||
}
|
||||
|
||||
img {
|
||||
max-width: 100%;
|
||||
max-width: 100%
|
||||
}
|
||||
|
||||
img.readyness {
|
||||
height: 100%;
|
||||
width: auto;
|
||||
width: auto
|
||||
}
|
||||
|
||||
@media only screen and (max-width: 399px) {
|
||||
.application-info {
|
||||
display: none;
|
||||
display: none
|
||||
}
|
||||
}
|
||||
|
||||
@media screen and (max-width: 1200px) {
|
||||
body {
|
||||
font-size: 10.5pt;
|
||||
font-size: 10.5pt
|
||||
}
|
||||
}
|
||||
|
||||
video {
|
||||
width: 100%
|
||||
}
|
||||
|
||||
.hidden {
|
||||
visibility: none;
|
||||
display: none
|
||||
}
|
@ -86,8 +86,8 @@
|
||||
</div>
|
||||
</li>-->
|
||||
|
||||
<li class="application">
|
||||
<a class="applicationName" href="toopie.html" id="window-visit-toopie">Toopie</a> <span class="applicationDesc" id="toopie">For information about your I2P router status, go here:</span>
|
||||
<li class="application window-visit-toopie">
|
||||
<a class="applicationName window-visit-toopie" href="toopie.html" id="window-visit-toopie">Toopie</a> <span class="applicationDesc window-visit-toopie" id="toopie">For information about your I2P router status, go here:</span>
|
||||
</li>
|
||||
|
||||
<li class="application">
|
||||
@ -147,5 +147,7 @@
|
||||
</div>
|
||||
<script src="home.js" type="text/javascript"></script>
|
||||
<script src="content.js" type="text/javascript"></script> <!--</div>-->
|
||||
|
||||
<script src="i2pcontrol/i2pcontrol.js" type="text/javascript"></script> <!--</div>-->
|
||||
</body>
|
||||
</html>
|
||||
|
37
host.js
@ -24,24 +24,42 @@ function localHost(url) {
|
||||
hostname = url.split("/")[0];
|
||||
}
|
||||
hostname = hostname.split(":")[0];
|
||||
console.log("(urlcheck) hostname localhost", hostname);
|
||||
console.log("(urlcheck) url localhost", url);
|
||||
if (hostname === "127.0.0.1") {
|
||||
return true;
|
||||
if (url.indexOf(":8084") != -1) return "blog";
|
||||
if (url.indexOf(":7669") != -1) return "irc";
|
||||
} else if (hostname === "localhost") {
|
||||
return true;
|
||||
if (url.indexOf(":8084") != -1) return "blog";
|
||||
if (url.indexOf(":7669") != -1) return "irc";
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
function extensionHost(url) {
|
||||
var prefix = browser.runtime
|
||||
.getURL("")
|
||||
.replace("moz-extension://", "")
|
||||
.replace("/", "");
|
||||
if (url.originUrl !== undefined) {
|
||||
var res = url.originUrl.startsWith(browser.runtime.getURL(""));
|
||||
var originUrl = url.originUrl
|
||||
.replace("moz-extension://", "")
|
||||
.replace("/", "");
|
||||
// console.log("(urlcheck) Extension application path", originUrl);
|
||||
// console.log("(urlcheck) Extension application path", prefix);
|
||||
var res = originUrl.startsWith(prefix);
|
||||
// console.log("(urlcheck) Extension application path", res);
|
||||
if (res) return res;
|
||||
}
|
||||
if (url.url !== undefined) {
|
||||
var res = url.url.startsWith(browser.runtime.getURL(""));
|
||||
if (url.documentUrl !== undefined) {
|
||||
// console.log("(urlcheck) Extension application path", originUrl);
|
||||
// console.log("(urlcheck) Extension application path", prefix);
|
||||
var res = originUrl.startsWith(prefix);
|
||||
// console.log("(urlcheck) Extension application path", res);
|
||||
if (res) return res;
|
||||
}
|
||||
console.log("(urlcheck) Extension application path", url);
|
||||
}
|
||||
|
||||
function i2pHostName(url) {
|
||||
@ -77,7 +95,8 @@ function i2pHostName(url) {
|
||||
|
||||
function i2pHost(url) {
|
||||
let hostname = i2pHostName(url);
|
||||
return hostname.endsWith(".i2p");
|
||||
let postname = hostname.split(":")[0]
|
||||
return postname.endsWith(".i2p");
|
||||
}
|
||||
|
||||
function routerHost(url) {
|
||||
@ -100,8 +119,10 @@ function routerHost(url) {
|
||||
console.log("(urlcheck) Torrent application path", final);
|
||||
return "i2psnark";
|
||||
} else if (final === "webmail" || final === "susimail") {
|
||||
console.log("(urlcheck) Mail application path", final);
|
||||
return "webmail";
|
||||
if (!url.includes(".css")) {
|
||||
console.log("(urlcheck) Mail application path", final);
|
||||
return "webmail";
|
||||
}
|
||||
} else if (final.startsWith("MuWire")) {
|
||||
if (!url.includes(".png")) {
|
||||
console.log("(urlcheck) MuWire application path", final);
|
||||
|
BIN
i2p-https.png
Normal file
After Width: | Height: | Size: 184 KiB |
@ -1,5 +1,8 @@
|
||||
i2pcontrol.js
|
||||
=============
|
||||
toopie.html/i2pcontrol.js
|
||||
=========================
|
||||
|
||||
This is inside of the webextension for now, but it's actually a fully-fledged,
|
||||
standalone library for talking to i2pcontrol.
|
||||
To enable toopie.html, the built in I2P monitoring system in this webextension,
|
||||
go to the [Web App Configuration page in the I2P Router and start I2PControl](http://127.0.0.1:7657/configwebapps).
|
||||
Click the "Start" button next to the menu item that says `jsonrpc`.
|
||||
|
||||
- 
|
||||
|
@ -1,391 +1,420 @@
|
||||
var hello = "hello i2pcontrol";
|
||||
if (browser.windows != undefined) {
|
||||
var hello = "hello i2pcontrol";
|
||||
|
||||
function makeid(length) {
|
||||
var result = "";
|
||||
var characters =
|
||||
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
|
||||
var charactersLength = characters.length;
|
||||
for (var i = 0; i < length; i++) {
|
||||
result += characters.charAt(Math.floor(Math.random() * charactersLength));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
function send(
|
||||
message,
|
||||
control_host = "127.0.0.1",
|
||||
control_port = "7657",
|
||||
control_path = "jsonrpc"
|
||||
) {
|
||||
async function postData(url = "", data = {}) {
|
||||
// Default options are marked with *
|
||||
let requestBody = JSON.stringify(data);
|
||||
//console.log("(i2pcontrol) sending request", requestBody);
|
||||
let opts = {
|
||||
method: "POST", // *GET, POST, PUT, DELETE, etc.
|
||||
mode: "cors", // no-cors, *cors, same-origin
|
||||
cache: "no-cache", // *default, no-cache, reload, force-cache, only-if-cached
|
||||
credentials: "same-origin", // include, *same-origin, omit
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
redirect: "follow", // manual, *follow, error
|
||||
referrerPolicy: "no-referrer", // no-referrer, *client
|
||||
body: requestBody, // body data type must match "Content-Type" header
|
||||
};
|
||||
const response = await fetch(url, opts);
|
||||
return await response.json(); // parses JSON response into native JavaScript objects
|
||||
function makeid(length) {
|
||||
var result = "";
|
||||
var characters =
|
||||
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
|
||||
var charactersLength = characters.length;
|
||||
for (var i = 0; i < length; i++) {
|
||||
result += characters.charAt(Math.floor(Math.random() * charactersLength));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
//console.log("http://" + control_host + ":" + control_port + "/" + control_path)
|
||||
return postData(
|
||||
"http://" + control_host + ":" + control_port + "/" + control_path + "/",
|
||||
message
|
||||
);
|
||||
}
|
||||
function send(
|
||||
message,
|
||||
control_host = "127.0.0.1",
|
||||
control_port = "7657",
|
||||
control_path = "jsonrpc"
|
||||
) {
|
||||
async function postData(url = "", data = {}) {
|
||||
// Default options are marked with *
|
||||
let requestBody = JSON.stringify(data);
|
||||
//console.log("(i2pcontrol) sending request", requestBody);
|
||||
let opts = {
|
||||
method: "POST", // *GET, POST, PUT, DELETE, etc.
|
||||
mode: "cors", // no-cors, *cors, same-origin
|
||||
cache: "no-cache", // *default, no-cache, reload, force-cache, only-if-cached
|
||||
credentials: "same-origin", // include, *same-origin, omit
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
redirect: "follow", // manual, *follow, error
|
||||
referrerPolicy: "no-referrer", // no-referrer, *client
|
||||
body: requestBody, // body data type must match "Content-Type" header
|
||||
};
|
||||
const response = await fetch(url, opts);
|
||||
return await response.json(); // parses JSON response into native JavaScript objects
|
||||
}
|
||||
|
||||
async function authenticate(
|
||||
password = "itoopie",
|
||||
control_host = "127.0.0.1",
|
||||
control_port = "7657",
|
||||
control_path = "jsonrpc"
|
||||
) {
|
||||
var json = new Object();
|
||||
json["id"] = makeid(6);
|
||||
json["jsonrpc"] = "2.0";
|
||||
json["method"] = "Authenticate";
|
||||
json["params"] = new Object();
|
||||
json["params"]["API"] = 1;
|
||||
json["params"]["Password"] = password;
|
||||
return send(json, control_host, control_port, control_path);
|
||||
}
|
||||
|
||||
async function GetToken(
|
||||
password = "itoopie",
|
||||
control_host = "127.0.0.1",
|
||||
control_port = "7657",
|
||||
control_path = "jsonrpc"
|
||||
) {
|
||||
function gettoken(authtoken) {
|
||||
return authtoken.result.Token;
|
||||
//console.log("http://" + control_host + ":" + control_port + "/" + control_path)
|
||||
return postData(
|
||||
"http://" + control_host + ":" + control_port + "/" + control_path + "/",
|
||||
message
|
||||
);
|
||||
}
|
||||
let me = authenticate(password, control_host, control_port, control_path);
|
||||
return await me.then(gettoken);
|
||||
}
|
||||
|
||||
async function Echo(
|
||||
message,
|
||||
control_host = "127.0.0.1",
|
||||
control_port = "7657",
|
||||
control_path = "jsonrpc",
|
||||
password = "itoopie"
|
||||
) {
|
||||
function echo(token) {
|
||||
console.log("(i2pcontrol) testing I2PControl connection");
|
||||
async function authenticate(
|
||||
password = "itoopie",
|
||||
control_host = "127.0.0.1",
|
||||
control_port = "7657",
|
||||
control_path = "jsonrpc"
|
||||
) {
|
||||
var json = new Object();
|
||||
json["id"] = makeid(6);
|
||||
json["jsonrpc"] = "2.0";
|
||||
json["method"] = "Echo";
|
||||
json["method"] = "Authenticate";
|
||||
json["params"] = new Object();
|
||||
json["params"]["Token"] = token;
|
||||
json["params"]["Echo"] = message;
|
||||
json["params"]["API"] = 1;
|
||||
json["params"]["Password"] = password;
|
||||
return send(json, control_host, control_port, control_path);
|
||||
}
|
||||
let token = GetToken(password, control_host, control_port, control_path);
|
||||
let done = await token.then(echo);
|
||||
return done;
|
||||
}
|
||||
|
||||
function UpdateEchoElementByID(
|
||||
Query,
|
||||
ID,
|
||||
control_host = "127.0.0.1",
|
||||
control_port = "7657",
|
||||
control_path = "jsonrpc"
|
||||
) {
|
||||
function updateelement(update) {
|
||||
//console.log("(i2pcontrol)", update);
|
||||
if (document.getElementById(ID) !== null)
|
||||
document.getElementById(ID).innerText = update;
|
||||
async function GetToken(
|
||||
password = "itoopie",
|
||||
control_host = "127.0.0.1",
|
||||
control_port = "7657",
|
||||
control_path = "jsonrpc"
|
||||
) {
|
||||
function gettoken(authtoken) {
|
||||
return authtoken.result.Token;
|
||||
}
|
||||
let me = authenticate(password, control_host, control_port, control_path);
|
||||
return await me.then(gettoken);
|
||||
}
|
||||
let net = Echo(Query, control_host, control_port, control_path, password);
|
||||
net.then(updateleement);
|
||||
}
|
||||
|
||||
async function GetRate(
|
||||
Query,
|
||||
control_host = "127.0.0.1",
|
||||
control_port = "7657",
|
||||
control_path = "jsonrpc",
|
||||
password = "itoopie"
|
||||
) {
|
||||
function getrate(token) {
|
||||
var json = new Object();
|
||||
json["id"] = makeid(6);
|
||||
json["jsonrpc"] = "2.0";
|
||||
json["method"] = "I2PControl";
|
||||
json["params"] = new Object();
|
||||
json["params"]["Token"] = token;
|
||||
json["params"]["Stat"] = Query;
|
||||
json["params"]["Period"] = 2000;
|
||||
return send(json, control_host, control_port, control_path);
|
||||
async function Echo(
|
||||
message,
|
||||
control_host = "127.0.0.1",
|
||||
control_port = "7657",
|
||||
control_path = "jsonrpc",
|
||||
password = "itoopie"
|
||||
) {
|
||||
function echo(token) {
|
||||
console.log("(i2pcontrol) testing I2PControl connection");
|
||||
var json = new Object();
|
||||
json["id"] = makeid(6);
|
||||
json["jsonrpc"] = "2.0";
|
||||
json["method"] = "Echo";
|
||||
json["params"] = new Object();
|
||||
json["params"]["Token"] = token;
|
||||
json["params"]["Echo"] = message;
|
||||
return send(json, control_host, control_port, control_path);
|
||||
}
|
||||
let token = GetToken(password, control_host, control_port, control_path);
|
||||
let done = await token.then(echo);
|
||||
return done;
|
||||
}
|
||||
let token = GetToken(password, control_host, control_port, control_path);
|
||||
let done = await token.then(getrate);
|
||||
return done;
|
||||
}
|
||||
|
||||
function UpdateGetRateElementByID(
|
||||
Query,
|
||||
ID,
|
||||
control_host = "127.0.0.1",
|
||||
control_port = "7657",
|
||||
control_path = "jsonrpc"
|
||||
) {
|
||||
function updateelement(update) {
|
||||
//console.log("(i2pcontrol)", update);
|
||||
if (document.getElementById(ID) !== null)
|
||||
document.getElementById(ID).innerText = update;
|
||||
}
|
||||
let net = GetRate(Query, control_host, control_port, control_path, password);
|
||||
net.then(updateleement);
|
||||
}
|
||||
|
||||
async function I2PControl(
|
||||
Query,
|
||||
control_host = "127.0.0.1",
|
||||
control_port = "7657",
|
||||
control_path = "jsonrpc",
|
||||
password = "itoopie"
|
||||
) {
|
||||
function i2pcontrol(token) {
|
||||
var json = new Object();
|
||||
json["id"] = makeid(6);
|
||||
json["jsonrpc"] = "2.0";
|
||||
json["method"] = "I2PControl";
|
||||
json["params"] = new Object();
|
||||
json["params"]["Token"] = token;
|
||||
json["params"][Query] = null;
|
||||
return send(json, control_host, control_port, control_path);
|
||||
}
|
||||
let token = GetToken(password, control_host, control_port, control_path);
|
||||
let done = await token.then(i2pcontrol);
|
||||
return done;
|
||||
}
|
||||
|
||||
function UpdateI2PControlElementByID(
|
||||
Query,
|
||||
ID,
|
||||
control_host = "127.0.0.1",
|
||||
control_port = "7657",
|
||||
control_path = "jsonrpc"
|
||||
) {
|
||||
function updateelement(update) {
|
||||
//console.log("(i2pcontrol)", update);
|
||||
if (document.getElementById(ID) !== null)
|
||||
document.getElementById(ID).innerText = update;
|
||||
}
|
||||
let net = I2PControl(
|
||||
function UpdateEchoElementByID(
|
||||
Query,
|
||||
control_host,
|
||||
control_port,
|
||||
control_path,
|
||||
password
|
||||
);
|
||||
net.then(updateleement);
|
||||
}
|
||||
|
||||
async function RouterInfo(
|
||||
Query,
|
||||
control_host = "127.0.0.1",
|
||||
control_port = "7657",
|
||||
control_path = "jsonrpc",
|
||||
password = "itoopie"
|
||||
) {
|
||||
function routerinfo(token) {
|
||||
var json = new Object();
|
||||
json["id"] = makeid(6);
|
||||
json["jsonrpc"] = "2.0";
|
||||
json["method"] = "RouterInfo";
|
||||
json["params"] = new Object();
|
||||
json["params"]["Token"] = token;
|
||||
json["params"][Query] = null;
|
||||
return send(json, control_host, control_port, control_path);
|
||||
ID,
|
||||
control_host = "127.0.0.1",
|
||||
control_port = "7657",
|
||||
control_path = "jsonrpc"
|
||||
) {
|
||||
function updateelement(update) {
|
||||
//console.log("(i2pcontrol)", update);
|
||||
if (document.getElementById(ID) !== null)
|
||||
document.getElementById(ID).innerText = update;
|
||||
}
|
||||
let net = Echo(Query, control_host, control_port, control_path, password);
|
||||
net.then(updateleement);
|
||||
}
|
||||
let token = GetToken(password, control_host, control_port, control_path);
|
||||
let done = await token.then(routerinfo);
|
||||
return done;
|
||||
}
|
||||
|
||||
function UpdateRouterInfoElementByID(
|
||||
Query,
|
||||
ID,
|
||||
control_host = "127.0.0.1",
|
||||
control_port = "7657",
|
||||
control_path = "jsonrpc",
|
||||
password = "itoopie"
|
||||
) {
|
||||
function updateelement(update) {
|
||||
/*console.log(
|
||||
async function GetRate(
|
||||
Query,
|
||||
control_host = "127.0.0.1",
|
||||
control_port = "7657",
|
||||
control_path = "jsonrpc",
|
||||
password = "itoopie"
|
||||
) {
|
||||
function getrate(token) {
|
||||
var json = new Object();
|
||||
json["id"] = makeid(6);
|
||||
json["jsonrpc"] = "2.0";
|
||||
json["method"] = "I2PControl";
|
||||
json["params"] = new Object();
|
||||
json["params"]["Token"] = token;
|
||||
json["params"]["Stat"] = Query;
|
||||
json["params"]["Period"] = 2000;
|
||||
return send(json, control_host, control_port, control_path);
|
||||
}
|
||||
let token = GetToken(password, control_host, control_port, control_path);
|
||||
let done = await token.then(getrate);
|
||||
return done;
|
||||
}
|
||||
|
||||
function UpdateGetRateElementByID(
|
||||
Query,
|
||||
ID,
|
||||
control_host = "127.0.0.1",
|
||||
control_port = "7657",
|
||||
control_path = "jsonrpc"
|
||||
) {
|
||||
function updateelement(update) {
|
||||
//console.log("(i2pcontrol)", update);
|
||||
if (document.getElementById(ID) !== null)
|
||||
document.getElementById(ID).innerText = update;
|
||||
}
|
||||
let net = GetRate(
|
||||
Query,
|
||||
control_host,
|
||||
control_port,
|
||||
control_path,
|
||||
password
|
||||
);
|
||||
net.then(updateleement);
|
||||
}
|
||||
|
||||
async function I2PControl(
|
||||
Query,
|
||||
control_host = "127.0.0.1",
|
||||
control_port = "7657",
|
||||
control_path = "jsonrpc",
|
||||
password = "itoopie"
|
||||
) {
|
||||
function i2pcontrol(token) {
|
||||
var json = new Object();
|
||||
json["id"] = makeid(6);
|
||||
json["jsonrpc"] = "2.0";
|
||||
json["method"] = "I2PControl";
|
||||
json["params"] = new Object();
|
||||
json["params"]["Token"] = token;
|
||||
json["params"][Query] = null;
|
||||
return send(json, control_host, control_port, control_path);
|
||||
}
|
||||
let token = GetToken(password, control_host, control_port, control_path);
|
||||
let done = await token.then(i2pcontrol);
|
||||
return done;
|
||||
}
|
||||
|
||||
function UpdateI2PControlElementByID(
|
||||
Query,
|
||||
ID,
|
||||
control_host = "127.0.0.1",
|
||||
control_port = "7657",
|
||||
control_path = "jsonrpc"
|
||||
) {
|
||||
function updateelement(update) {
|
||||
//console.log("(i2pcontrol)", update);
|
||||
if (document.getElementById(ID) !== null)
|
||||
document.getElementById(ID).innerText = update;
|
||||
}
|
||||
let net = I2PControl(
|
||||
Query,
|
||||
control_host,
|
||||
control_port,
|
||||
control_path,
|
||||
password
|
||||
);
|
||||
net.then(updateleement);
|
||||
}
|
||||
|
||||
async function RouterInfo(
|
||||
Query,
|
||||
control_host = "127.0.0.1",
|
||||
control_port = "7657",
|
||||
control_path = "jsonrpc",
|
||||
password = "itoopie"
|
||||
) {
|
||||
function routerinfo(token) {
|
||||
var json = new Object();
|
||||
json["id"] = makeid(6);
|
||||
json["jsonrpc"] = "2.0";
|
||||
json["method"] = "RouterInfo";
|
||||
json["params"] = new Object();
|
||||
json["params"]["Token"] = token;
|
||||
json["params"][Query] = null;
|
||||
return send(json, control_host, control_port, control_path);
|
||||
}
|
||||
let token = GetToken(password, control_host, control_port, control_path);
|
||||
let done = await token.then(routerinfo);
|
||||
return done;
|
||||
}
|
||||
|
||||
function UpdateRouterInfoElementByID(
|
||||
Query,
|
||||
ID,
|
||||
control_host = "127.0.0.1",
|
||||
control_port = "7657",
|
||||
control_path = "jsonrpc",
|
||||
password = "itoopie"
|
||||
) {
|
||||
function updateelement(update) {
|
||||
/*console.log(
|
||||
"(i2pcontrol) element",
|
||||
update.result[Query],
|
||||
ID,
|
||||
document.getElementById(ID)
|
||||
);*/
|
||||
if (document.getElementById(ID) !== null)
|
||||
document.getElementById(ID).innerText = update.result[Query];
|
||||
if (document.getElementById(ID) !== null)
|
||||
document.getElementById(ID).innerText = update.result[Query];
|
||||
}
|
||||
|
||||
let net = RouterInfo(
|
||||
Query,
|
||||
control_host,
|
||||
control_port,
|
||||
control_path,
|
||||
password
|
||||
);
|
||||
net.then(updateelement);
|
||||
}
|
||||
|
||||
let net = RouterInfo(
|
||||
async function RouterManager(
|
||||
Query,
|
||||
control_host,
|
||||
control_port,
|
||||
control_path,
|
||||
password
|
||||
);
|
||||
net.then(updateelement);
|
||||
}
|
||||
|
||||
async function RouterManager(
|
||||
Query,
|
||||
control_host = "127.0.0.1",
|
||||
control_port = "7657",
|
||||
control_path = "jsonrpc",
|
||||
password = "itoopie"
|
||||
) {
|
||||
function routermanager(token) {
|
||||
var json = new Object();
|
||||
json["id"] = makeid(6);
|
||||
json["jsonrpc"] = "2.0";
|
||||
json["method"] = "RouterManager";
|
||||
json["params"] = new Object();
|
||||
json["params"]["Token"] = token;
|
||||
json["params"][Query] = null;
|
||||
return send(json, control_host, control_port, control_path);
|
||||
control_host = "127.0.0.1",
|
||||
control_port = "7657",
|
||||
control_path = "jsonrpc",
|
||||
password = "itoopie"
|
||||
) {
|
||||
function routermanager(token) {
|
||||
var json = new Object();
|
||||
json["id"] = makeid(6);
|
||||
json["jsonrpc"] = "2.0";
|
||||
json["method"] = "RouterManager";
|
||||
json["params"] = new Object();
|
||||
json["params"]["Token"] = token;
|
||||
json["params"][Query] = null;
|
||||
return send(json, control_host, control_port, control_path);
|
||||
}
|
||||
let token = GetToken(password, control_host, control_port, control_path);
|
||||
let done = await token.then(routermanager);
|
||||
return done;
|
||||
}
|
||||
let token = GetToken(password, control_host, control_port, control_path);
|
||||
let done = await token.then(routermanager);
|
||||
return done;
|
||||
}
|
||||
|
||||
function UpdateRouterManagerElementByID(
|
||||
Query,
|
||||
ID,
|
||||
control_host = "127.0.0.1",
|
||||
control_port = "7657",
|
||||
control_path = "jsonrpc",
|
||||
password = "itoopie"
|
||||
) {
|
||||
function updateelement(update) {
|
||||
//console.log("(i2pcontrol)", update);
|
||||
if (document.getElementById(ID) !== null)
|
||||
function UpdateRouterManagerElementByID(
|
||||
Query,
|
||||
ID,
|
||||
control_host = "127.0.0.1",
|
||||
control_port = "7657",
|
||||
control_path = "jsonrpc",
|
||||
password = "itoopie"
|
||||
) {
|
||||
function updateelement(update) {
|
||||
//console.log("(i2pcontrol)", update);
|
||||
if (document.getElementById(ID) !== null)
|
||||
document.getElementById(ID).innerText = update;
|
||||
}
|
||||
let net = RouterManager(
|
||||
Query,
|
||||
control_host,
|
||||
control_port,
|
||||
control_path,
|
||||
password
|
||||
);
|
||||
net.then(updateleement);
|
||||
}
|
||||
|
||||
async function NetworkSetting(
|
||||
Query,
|
||||
control_host = "127.0.0.1",
|
||||
control_port = "7657",
|
||||
control_path = "jsonrpc",
|
||||
password = "itoopie"
|
||||
) {
|
||||
function networksetting(token) {
|
||||
var json = new Object();
|
||||
json["id"] = makeid(6);
|
||||
json["jsonrpc"] = "2.0";
|
||||
json["method"] = "NetworkSetting";
|
||||
json["params"] = new Object();
|
||||
json["params"]["Token"] = token;
|
||||
json["params"][Query] = null;
|
||||
return send(json, control_host, control_port, control_path);
|
||||
}
|
||||
let token = GetToken(password, control_host, control_port, control_path);
|
||||
let done = await token.then(networksetting);
|
||||
return done;
|
||||
}
|
||||
|
||||
function UpdateNetworkSettingElementByID(
|
||||
Query,
|
||||
ID,
|
||||
control_host = "127.0.0.1",
|
||||
control_port = "7657",
|
||||
control_path = "jsonrpc",
|
||||
password = "itoopie"
|
||||
) {
|
||||
function updateelement(update) {
|
||||
//console.log("(i2pcontrol)", update);
|
||||
document.getElementById(ID).innerText = update;
|
||||
}
|
||||
let net = NetworkSetting(
|
||||
Query,
|
||||
control_host,
|
||||
control_port,
|
||||
control_path,
|
||||
password
|
||||
);
|
||||
net.then(updateleement);
|
||||
}
|
||||
let net = RouterManager(
|
||||
Query,
|
||||
control_host,
|
||||
control_port,
|
||||
control_path,
|
||||
password
|
||||
);
|
||||
net.then(updateleement);
|
||||
}
|
||||
|
||||
async function NetworkSetting(
|
||||
Query,
|
||||
control_host = "127.0.0.1",
|
||||
control_port = "7657",
|
||||
control_path = "jsonrpc",
|
||||
password = "itoopie"
|
||||
) {
|
||||
function networksetting(token) {
|
||||
var json = new Object();
|
||||
json["id"] = makeid(6);
|
||||
json["jsonrpc"] = "2.0";
|
||||
json["method"] = "NetworkSetting";
|
||||
json["params"] = new Object();
|
||||
json["params"]["Token"] = token;
|
||||
json["params"][Query] = null;
|
||||
return send(json, control_host, control_port, control_path);
|
||||
function UpdateContents() {
|
||||
UpdateRouterInfoElementByID("i2p.router.status", "router-status");
|
||||
UpdateRouterInfoElementByID("i2p.router.uptime", "router-uptime");
|
||||
UpdateRouterInfoElementByID("i2p.router.version", "router-version");
|
||||
UpdateRouterInfoElementByID(
|
||||
"i2p.router.net.bw.inbound.1s",
|
||||
"router-net-bw-inbound-1s"
|
||||
);
|
||||
UpdateRouterInfoElementByID(
|
||||
"i2p.router.net.bw.inbound.15s",
|
||||
"router-net-bw-inbound-15s"
|
||||
);
|
||||
UpdateRouterInfoElementByID(
|
||||
"i2p.router.net.bw.outbound.1s",
|
||||
"router-net-bw-outbound-1s"
|
||||
);
|
||||
UpdateRouterInfoElementByID(
|
||||
"i2p.router.net.bw.outbound.15s",
|
||||
"router-net-bw-outbound-15s"
|
||||
);
|
||||
UpdateRouterInfoElementByID("i2p.router.net.status", "router-net-status");
|
||||
UpdateRouterInfoElementByID(
|
||||
"i2p.router.net.tunnels.participating",
|
||||
"router-net-tunnels-participating"
|
||||
);
|
||||
UpdateRouterInfoElementByID(
|
||||
"i2p.router.netdb.activepeers",
|
||||
"router-netdb-activepeers"
|
||||
);
|
||||
UpdateRouterInfoElementByID(
|
||||
"i2p.router.netdb.fastpeers",
|
||||
"router-netdb-fastpeers"
|
||||
);
|
||||
UpdateRouterInfoElementByID(
|
||||
"i2p.router.netdb.highcapacitypeers",
|
||||
"router-netdb-highcapacitypeers"
|
||||
);
|
||||
UpdateRouterInfoElementByID(
|
||||
"i2p.router.netdb.isreseeding",
|
||||
"router-netdb-isreseeding"
|
||||
);
|
||||
UpdateRouterInfoElementByID(
|
||||
"i2p.router.netdb.knownpeers",
|
||||
"router-netdb-knownpeers"
|
||||
);
|
||||
}
|
||||
let token = GetToken(password, control_host, control_port, control_path);
|
||||
let done = await token.then(networksetting);
|
||||
return done;
|
||||
}
|
||||
|
||||
function UpdateNetworkSettingElementByID(
|
||||
Query,
|
||||
ID,
|
||||
control_host = "127.0.0.1",
|
||||
control_port = "7657",
|
||||
control_path = "jsonrpc",
|
||||
password = "itoopie"
|
||||
) {
|
||||
function updateelement(update) {
|
||||
//console.log("(i2pcontrol)", update);
|
||||
document.getElementById(ID).innerText = update;
|
||||
var done = Echo(hello);
|
||||
done.then(Done).catch(Done);
|
||||
|
||||
function Done(output) {
|
||||
function hide(elements) {
|
||||
elements = elements.length ? elements : [elements];
|
||||
for (var index = 0; index < elements.length; index++) {
|
||||
elements[index].style.display = "none";
|
||||
}
|
||||
}
|
||||
|
||||
function unhide(elements) {
|
||||
elements = elements.length ? elements : [elements];
|
||||
for (var index = 0; index < elements.length; index++) {
|
||||
elements[index].style.display = "inline-block";
|
||||
}
|
||||
}
|
||||
|
||||
console.log("(i2pcontrol) I2PControl connection tested,", output);
|
||||
if (output == hello) {
|
||||
var toopieLinks = document.querySelectorAll(".window-visit-toopie");
|
||||
unhide(toopieLinks);
|
||||
} else {
|
||||
var toopieLinks = document.querySelectorAll(".window-visit-toopie");
|
||||
hide(toopieLinks);
|
||||
}
|
||||
return output;
|
||||
}
|
||||
let net = NetworkSetting(
|
||||
Query,
|
||||
control_host,
|
||||
control_port,
|
||||
control_path,
|
||||
password
|
||||
);
|
||||
net.then(updateleement);
|
||||
}
|
||||
|
||||
function UpdateContents() {
|
||||
UpdateRouterInfoElementByID("i2p.router.status", "router-status");
|
||||
UpdateRouterInfoElementByID("i2p.router.uptime", "router-uptime");
|
||||
UpdateRouterInfoElementByID("i2p.router.version", "router-version");
|
||||
UpdateRouterInfoElementByID(
|
||||
"i2p.router.net.bw.inbound.1s",
|
||||
"router-net-bw-inbound-1s"
|
||||
);
|
||||
UpdateRouterInfoElementByID(
|
||||
"i2p.router.net.bw.inbound.15s",
|
||||
"router-net-bw-inbound-15s"
|
||||
);
|
||||
UpdateRouterInfoElementByID(
|
||||
"i2p.router.net.bw.outbound.1s",
|
||||
"router-net-bw-outbound-1s"
|
||||
);
|
||||
UpdateRouterInfoElementByID(
|
||||
"i2p.router.net.bw.outbound.15s",
|
||||
"router-net-bw-outbound-15s"
|
||||
);
|
||||
UpdateRouterInfoElementByID("i2p.router.net.status", "router-net-status");
|
||||
UpdateRouterInfoElementByID(
|
||||
"i2p.router.net.tunnels.participating",
|
||||
"router-net-tunnels-participating"
|
||||
);
|
||||
UpdateRouterInfoElementByID(
|
||||
"i2p.router.netdb.activepeers",
|
||||
"router-netdb-activepeers"
|
||||
);
|
||||
UpdateRouterInfoElementByID(
|
||||
"i2p.router.netdb.fastpeers",
|
||||
"router-netdb-fastpeers"
|
||||
);
|
||||
UpdateRouterInfoElementByID(
|
||||
"i2p.router.netdb.highcapacitypeers",
|
||||
"router-netdb-highcapacitypeers"
|
||||
);
|
||||
UpdateRouterInfoElementByID(
|
||||
"i2p.router.netdb.isreseeding",
|
||||
"router-netdb-isreseeding"
|
||||
);
|
||||
UpdateRouterInfoElementByID(
|
||||
"i2p.router.netdb.knownpeers",
|
||||
"router-netdb-knownpeers"
|
||||
);
|
||||
}
|
||||
|
||||
var done = Echo(hello);
|
||||
done.then(Done);
|
||||
|
||||
function Done(output) {
|
||||
console.log("(i2pcontrol) I2PControl connection tested,", output);
|
||||
return output;
|
||||
}
|
||||
|
BIN
i2pcontrol/i2pcontrol.png
Normal file
After Width: | Height: | Size: 109 KiB |
17
i2pcontrol/index.html
Normal file
@ -0,0 +1,17 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>I2P in Private Browsing Mode</title>
|
||||
<link rel="stylesheet" type="text/css" href="../home.css" />
|
||||
<link rel="stylesheet" type="text/css" href="../sidebar.css" />
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<h1 id="toopie.htmli2pcontrol.js">toopie.html/i2pcontrol.js</h1>
|
||||
<p>To enable toopie.html, the built in I2P monitoring system in this webextension, go to the <a href="http://127.0.0.1:7657/configwebapps">Web App Configuration page in the I2P Router and start I2PControl</a>. Click the "Start" button next to the menu item that says <code>jsonrpc</code>.</p>
|
||||
<ul>
|
||||
<li><img src="i2pcontrol.png" title="fig:" alt="i2pcontrol.png" /></li>
|
||||
</ul>
|
||||
|
||||
</body>
|
||||
</html>
|
Before Width: | Height: | Size: 213 KiB After Width: | Height: | Size: 327 KiB |
BIN
i2psnark-integrate.png
Normal file
After Width: | Height: | Size: 222 KiB |
BIN
i2psnark.png
Before Width: | Height: | Size: 123 KiB After Width: | Height: | Size: 100 KiB |
BIN
i2ptunnel.png
Before Width: | Height: | Size: 209 KiB After Width: | Height: | Size: 197 KiB |
BIN
icons/browse.png
Before Width: | Height: | Size: 2.6 KiB After Width: | Height: | Size: 3.5 KiB |
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 17 KiB |
Before Width: | Height: | Size: 73 KiB After Width: | Height: | Size: 6.8 KiB |
Before Width: | Height: | Size: 32 KiB After Width: | Height: | Size: 8.2 KiB |
Before Width: | Height: | Size: 73 KiB After Width: | Height: | Size: 6.8 KiB |
Before Width: | Height: | Size: 50 KiB After Width: | Height: | Size: 7.3 KiB |
Before Width: | Height: | Size: 3.6 KiB After Width: | Height: | Size: 6.3 KiB |
BIN
images/gear.png
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 2.1 KiB |
369
index.html
@ -1,222 +1,235 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>I2P in Private Browsing Mode</title>
|
||||
<link href="home.css" rel="stylesheet" type="text/css">
|
||||
<link href="sidebar.css" rel="stylesheet" type="text/css">
|
||||
<title>I2P in Private Browsing Mode</title>
|
||||
<link rel="stylesheet" type="text/css" href="home.css" />
|
||||
<link rel="stylesheet" type="text/css" href="sidebar.css" />
|
||||
</head>
|
||||
<body>
|
||||
<h1>I2P in Private Browsing Mode(Firefox-Only)</h1>
|
||||
<h1>I2P in Private Browsing Mode(Firefox-Only)</h1>
|
||||
|
||||
<p>This is an 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, like an embedded I2P console and Bittorrent integration with clients using the transmission-rpc API.</p>
|
||||
<p>This is an webextension which introduces a set of new "Private Browsing" modes
|
||||
to Firefox-based browsers(Supporting webextensions, must be current ESR or
|
||||
greater) 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, like an embedded I2P console and Bittorrent integration
|
||||
with clients using the transmission-rpc API and via in-browser protocol handling
|
||||
integrations.</p>
|
||||
|
||||
<h2>Privacy Policy</h2>
|
||||
<h2>Privacy Policy</h2>
|
||||
|
||||
<p>This browser extension does not collect any personal information. It requires access to local storage and browsing data permissions in order to delete them when directed to by the user. This browser extension does not transmit any information to any third party, nor will it, ever.</p>
|
||||
<p>This browser extension does not collect any personal information. It requires
|
||||
access to local storage and browsing data permissions in order to delete them
|
||||
when directed to by the user. This browser extension does not transmit any
|
||||
information to any third party, nor will it, ever.</p>
|
||||
|
||||
<p>This browser extension cannot influence telemetry carried out by browser vendors to determine performance in their distribution channels, nor can it mitigate any other browser vendor telemetry.</p>
|
||||
<p>This browser extension cannot influence telemetry carried out by browser vendors
|
||||
to determine performance in their distribution channels, nor can it mitigate any
|
||||
other browser vendor telemetry. </p>
|
||||
|
||||
<p>This browser extension is entirely Free, Open-Source software.</p>
|
||||
<p>This browser extension is entirely Free, Open-Source software.</p>
|
||||
|
||||
<h2>Installation(Cross-Platform):</h2>
|
||||
<h2>Installation(Cross-Platform):</h2>
|
||||
|
||||
<p>For desktop users this addon is available from addons.mozilla.org, where you will be able to recive automatic updates: <a href="https://addons.mozilla.org/en-US/firefox/addon/i2p-in-private-browsing/">I2P in Private Browsing</a>.</p>
|
||||
<p>For desktop users this addon is available from addons.mozilla.org, where you
|
||||
will be able to recive automatic updates:
|
||||
<a href="https://addons.mozilla.org/en-US/firefox/addon/i2p-in-private-browsing/">I2P in Private Browsing</a>.</p>
|
||||
|
||||
<h2>Debian Installation:</h2>
|
||||
<h2>Debian Installation:</h2>
|
||||
|
||||
<p>Should you prefer, it is possible to install this extension system-wide by side-loading it into Debian. You can generate your own deb file by running the command:</p>
|
||||
<p>Should you prefer, it is possible to install this extension system-wide by
|
||||
side-loading it into Debian. You can generate your own deb file by running the
|
||||
command:</p>
|
||||
|
||||
<pre><code> make deb
|
||||
<pre><code> make deb
|
||||
</code></pre>
|
||||
<p>and then you can install it with:</p>
|
||||
|
||||
<pre><code> sudo apt install ../i2psetproxy.js_*.deb
|
||||
<p>and then you can install it with:</p>
|
||||
|
||||
<pre><code> sudo apt install ../i2psetproxy.js_*.deb
|
||||
</code></pre>
|
||||
<h2>Bittorrent Download:</h2>
|
||||
|
||||
<p>The self-hosted plugin is available from bittorrent both within the I2P and Clearnet Bittorrent network(With a web seed to support it in case one goes dead).</p>
|
||||
<h2>Bittorrent Download:</h2>
|
||||
|
||||
<ul>
|
||||
<li>
|
||||
<a href="magnet:?xt=urn:btih:7ec361c3ddc3fb904e369a19cdf4259af94af624">Magnet Link</a>
|
||||
</li>
|
||||
<p>The self-hosted plugin is available from bittorrent both within the I2P and
|
||||
Clearnet Bittorrent network(With a web seed to support it in case one goes
|
||||
dead).</p>
|
||||
|
||||
<li>
|
||||
<a href="./i2ppb@eyedeekay.github.io.xpi.torrent">Get the .torrent file</a>
|
||||
</li>
|
||||
</ul>
|
||||
<ul>
|
||||
<li><a href="magnet:?xl=2485magnetsubdn=i2ppb%40eyedeekay.github.io.xpi.torrentmagnetsubxt=urn:tree:tiger:w6kewvpw25bnau2rwkczbnryrjdzn54ietse3zimagnetsubxt=urn:ed2k:1cd9743fb664404298b7f2ad7ee45db0magnetsubxt=urn:aich:4vhcsp6t3c2mkjzds2etixyinyj7xtkp">Magnet Link</a></li>
|
||||
<li><a href="./i2ppb@eyedeekay.github.io.xpi.torrent">Get the .torrent file</a></li>
|
||||
</ul>
|
||||
|
||||
<h2>Usage:</h2>
|
||||
<h2>Usage:</h2>
|
||||
|
||||
<ul>
|
||||
<li>Basically, it "Just Works." After you install the plugin, browsing to an I2P domain will automatically stop the current tab and re-open the I2P site in an I2P Browser tab.</li>
|
||||
<ul>
|
||||
<li>Basically, it "Just Works." After you install the plugin, browsing to an I2P
|
||||
domain will automatically stop the current tab and re-open the I2P site in an
|
||||
I2P Browser tab.</li>
|
||||
<li>Besides that, four bookmarks are added to the "Bookmarks Toolbar," which
|
||||
will take you to visit your Java I2P applications, or the "Simplified I2P
|
||||
Landing Page" embedded in the plugin:</li>
|
||||
<li><img src="lander.png" alt="Landing page" title="" /></li>
|
||||
<li>Also, there's a menu for accessing I2P functionality while you're browsing.
|
||||
It lets you control a few settings in a granular way.</li>
|
||||
<li><img src="menu.png" alt="Menu" title="" /></li>
|
||||
<li>You can re-enable WebRTC but force it to always use the proxy that is
|
||||
enforced by the tab.</li>
|
||||
<li>You can either force the browser to delete all history for I2P sites
|
||||
immediately, or you can close all your I2P Browser tabs at once and delete
|
||||
the history for I2P browsing when you're done.</li>
|
||||
<li>That's all there is to it! Your browser is configured to safely use and
|
||||
administer I2P.</li>
|
||||
<li>Optionally, you can add I2PSnark-RPC and use Bittorrent-over-I2P via the
|
||||
transmission-rpc interface. To do this, have a look at the torrent guide:
|
||||
<a href="torrent/index.html">Torrent guide</a></li>
|
||||
</ul>
|
||||
|
||||
<li>Besides that, four bookmarks are added to the "Bookmarks Toolbar," which will take you to visit your Java I2P applications, or the "Simplified I2P Landing Page" embedded in the plugin:</li>
|
||||
<h3>Features</h3>
|
||||
|
||||
<li><img alt="Landing page" src="lander.png" title="">
|
||||
</li>
|
||||
<ul>
|
||||
<li>[done] <strong>Provide</strong> a way to launch into an I2P-Specific contextual identity
|
||||
(container). Intercept requests to .i2p domains and automatically route them
|
||||
to the I2P container. Isolate the router console from other local
|
||||
applications by automatically intercepting requests to the router console to
|
||||
another container.</li>
|
||||
<li><img src="i2psetproxy.js.png" alt="Visiting i2p-projekt.i2p" title="" /></li>
|
||||
<li>[done] <strong>Indicate</strong> the I2P browser is in use visually. Find an
|
||||
acceptable way to indicate it on Android.</li>
|
||||
<li><img src="susimail.png" alt="Visiting webmail" title="" /></li>
|
||||
<li>[done] <strong>Set</strong> the http proxy to use the local I2P proxy automatically.
|
||||
Provide specific configuration for other types of I2P proxies(SOCKS,
|
||||
isolating HTTP)</li>
|
||||
<li>[done] <strong>Disable</strong> risky webRTC features/offer the option to re-enable
|
||||
them with the proxy enforced.</li>
|
||||
<li>[done] <strong>Change</strong> the color of the browser window to indicate that I2P is in
|
||||
use</li>
|
||||
<li><img src="i2ptunnel.png" alt="Visiting i2ptunnel" title="" /></li>
|
||||
<li>[ready] <strong>Provide</strong> help in a variety of languages.</li>
|
||||
<li>[done] <strong>Monitor</strong> the health and readiness of the I2P router it is
|
||||
instructed to use. Currently the plugin checks whether the HTTP Proxy is
|
||||
working by fetching an image from "http://proxy.i2p" and displaying a result.
|
||||
A work-in-progress binding to i2pcontrol is available in ./i2pcontrol, it is
|
||||
inert at this time.</li>
|
||||
<li><img src="toopie.png" alt="Visiting toopie.html" title="" /></li>
|
||||
<li>[Done] <strong>Handle</strong> router console applications under their own origins and
|
||||
within their own contextual identity. (1) The router console is automatically
|
||||
confined to it's own container tab. (2) Use a custom protocol handler to
|
||||
place each i2p application/plugin under it's own origin, shortening router
|
||||
console URL's and placing applications under their own origin.</li>
|
||||
<li><img src="routerconsole.png" alt="Visiting routerconsole" title="" /></li>
|
||||
<li>[Done] <strong>Handle Torrents</strong> by talking to i2psnark-rpc plugin and then
|
||||
adding them directly into the Firefox downloads drop-downs, menus, etc. Enable
|
||||
the use of I2PSnark as a peer-to-peer delivery mechanism for media files.</li>
|
||||
<li><img src="i2psnark.png" alt="Visiting i2psnark" title="" /></li>
|
||||
<li><img src="transmissionrpc.png" alt="Monitoring torrents" title="" /></li>
|
||||
<li>[Done] <strong>Enhance</strong> the I2P browsing experience by allowing site developers
|
||||
distribute some or all of their resources as torrents, allowing the torrents to
|
||||
be treated effectively as a CDN.</li>
|
||||
<li><img src="x-i2p-torrentlocation.png" alt="Distribute your site as a torrent." title="" /></li>
|
||||
<li>[Done] <strong>Indicate</strong> the level of authenticity provided by TLS. TLS is
|
||||
optional on I2P for now, but some sites offer it anyway. TLS support is
|
||||
experimental and in the works.</li>
|
||||
<li><img src="i2p-https.png" alt="Use HTTPS with your I2P Site." title="" /></li>
|
||||
<li>[Done] <strong>Provide</strong> alternate, in-I2P destinations for web sites that want to
|
||||
mirror their content within I2P.</li>
|
||||
<li>[barely started] <strong>Isolate</strong> traffic by contextual identity to it's own HTTP
|
||||
Proxy tunnel, each reflecting it's own pseudonymous identity within I2P. The
|
||||
contextual identities. For now, the contextual identities used to manage
|
||||
browsing are "I2P Browsing" and "Web Browsing" where I2P Browsing is capable
|
||||
of using an outproxy but in the case of traffic destined for the clearnet
|
||||
does not do header rewriting, and Web Browsing falls back to the Proxy
|
||||
configured in Firefox. The I2P Browsing will be expanded to
|
||||
<ul>
|
||||
<li>I2P Amnesiac Browsing: Use for General Browsing, stores no history and
|
||||
uses an HTTP Proxy with a very short tunnel-close timeout and no key-reuse.</li>
|
||||
<li>I2P Social Networking: Use this for logging into social network accounts,
|
||||
forums, and other interactive asynchronous public communication platforms
|
||||
where your identity is behaviorally linkable. This has a very long
|
||||
tunnel-close timeout and key-reuse until specifically invoked.</li>
|
||||
<li>I2P Blogging: Use this for posting content to the web interface of your
|
||||
blog or to other similar websites that you create content on.</li>
|
||||
</ul></li>
|
||||
<li><img src="clearweb.png" alt="Visiting clearweb" title="" /></li>
|
||||
</ul>
|
||||
|
||||
<li>Also, there's a menu for accessing I2P functionality while you're browsing. It lets you control a few settings in a granular way.</li>
|
||||
<h3>Video</h3>
|
||||
|
||||
<li><img alt="Menu" src="menu.png" title="">
|
||||
</li>
|
||||
<ul>
|
||||
<li><img src="i2psetproxy.js.gif" alt="Video of the plugin in action" title="" /></li>
|
||||
</ul>
|
||||
|
||||
<li>You can re-enable WebRTC but force it to always use the proxy that is enforced by the tab.</li>
|
||||
<h2>Documents</h2>
|
||||
|
||||
<li>You can either force the browser to delete all history for I2P sites immediately, or you can close all your I2P Browser tabs at once and delete the history for I2P browsing when you're done.</li>
|
||||
<ul>
|
||||
<li><strong><a href="https://github.com/eyedeekay/I2P-in-Private-Browsing-Mode-Firefox/releases/download/docs/Browser.Design.Documentation.pdf">Browser Outline</a></strong>: This document is an outline of each of
|
||||
the browser extension's feature panels in presentation form.</li>
|
||||
<li><strong><a href="https://github.com/eyedeekay/I2P-in-Private-Browsing-Mode-Firefox/releases/download/docs/Landing.Page.Documentation.pdf">Smart Lander Design</a></strong>: This is the original outline of
|
||||
the smart landing page which became the I2P home page within the browser and
|
||||
the drop-down control panel.</li>
|
||||
<li><strong><a href="https://github.com/eyedeekay/I2P-in-Private-Browsing-Mode-Firefox/wiki/Other-Extensions">Other extensions</a></strong>: and how they work with this one.</li>
|
||||
</ul>
|
||||
|
||||
<li>That's all there is to it! Your browser is configured to safely use and administer I2P.</li>
|
||||
<h2>Super Extra Important Background Info:</h2>
|
||||
|
||||
<li>Optionally, you can add I2PSnark-RPC and use Bittorrent-over-I2P via the transmission-rpc interface. To do this, have a look at the torrent guide: <a href="torrent/index.html">Torrent guide</a>
|
||||
</li>
|
||||
</ul>
|
||||
<p>This plugin's viability is directly related to the viability of Mozilla and
|
||||
Tor's work on hardening Firefox itself and of particular interest are the
|
||||
"Uplift" and "Fusion(Firefox Using Onions)" projects.</p>
|
||||
|
||||
<h3>Features</h3>
|
||||
<h3>Links about Project Uplift</h3>
|
||||
|
||||
<ul>
|
||||
<li>[done] <strong>Provide</strong> a way to launch into an I2P-Specific contextual identity (container). Intercept requests to .i2p domains and automatically route them to the I2P container. Isolate the router console from other local applications by automatically intercepting requests to the router console to another container.</li>
|
||||
<ul>
|
||||
<li><a href="https://wiki.mozilla.org/Security/Tor_Uplift">Tor Uplift</a> is a project which
|
||||
brings important features of the Tor Browser to the mainstream of Firefox
|
||||
users by including patches from Tor Browser Bundle into Firefox where it is
|
||||
appropriate.</li>
|
||||
<li><a href="https://wiki.mozilla.org/Security/FirstPartyIsolation">First Party Isolation</a>
|
||||
is a feature in Firefox and other browsers which keeps information from
|
||||
leaking across first-party domains.</li>
|
||||
<li><a href="https://wiki.mozilla.org/Security/Fingerprinting">Fingerprinting</a> is a
|
||||
technique where a tracker attempts to extract unique information about a user
|
||||
from a side-channel in order to create an identifier that can be used to
|
||||
correlate the user across many sites.</li>
|
||||
<li><a href="https://wiki.mozilla.org/Security/Fennec%2BTor_Project">Fennec</a> is Firefox
|
||||
for Android and this link has some analysis of the privacy consequences of the
|
||||
Android platform.</li>
|
||||
<li><a href="https://wiki.mozilla.org/Security/Tor_Uplift/Tracking">Tracking</a> in Firefox
|
||||
is surveyed here.</li>
|
||||
</ul>
|
||||
|
||||
<li><img alt="Visiting i2p-projekt.i2p" src="i2psetproxy.js.png" title="">
|
||||
</li>
|
||||
<p>Project uplift seems to have largely been accomplished?</p>
|
||||
|
||||
<li>[done] <strong>Indicate</strong> the I2P browser is in use visually. Find an acceptable way to indicate it on Android.</li>
|
||||
<h3>Links about Project Fusion</h3>
|
||||
|
||||
<li><img alt="Visiting webmail" src="susimail.png" title="">
|
||||
</li>
|
||||
<ul>
|
||||
<li><a href="https://wiki.mozilla.org/Security/Fusion">Project Fusion</a> or Firefox using
|
||||
Onions is a joint Mozilla/Tor effort to create an enhanced Private Browsing
|
||||
mode for Firefox which uses Tor.</li>
|
||||
<li><a href="https://trac.torproject.org/projects/tor/wiki/org/meetings/2018Rome/Notes/FusionProject">Notes</a>
|
||||
from a meeting about Fusion.</li>
|
||||
<li><a href="https://blog.torproject.org/tor-heart-firefox">Tor at the Heart: Firefox</a> is
|
||||
a blog about Tor and the relationship they have to Firefox re: TBB, Fusion.</li>
|
||||
</ul>
|
||||
|
||||
<li>[done] <strong>Set</strong> the http proxy to use the local I2P proxy automatically. Provide specific configuration for other types of I2P proxies(SOCKS, isolating HTTP)</li>
|
||||
<h2>The <strong>Other</strong> Version</h2>
|
||||
|
||||
<li>[done] <strong>Disable</strong> risky webRTC features/offer the option to re-enable them with the proxy enforced.</li>
|
||||
<p>New versions of this extension create an I2P in Private Browsing mode instead,
|
||||
using container tabs.</p>
|
||||
|
||||
<li>[done] <strong>Change</strong> the color of the browser window to indicate that I2P is in use</li>
|
||||
<p>Since this is a drastic change to the behavior of the old plugin, and since there
|
||||
is no UI a new entry
|
||||
for the new plugin has been made at a new location on addons.mozilla.org.</p>
|
||||
|
||||
<li><img alt="Visiting i2ptunnel" src="i2ptunnel.png" title="">
|
||||
</li>
|
||||
<ul>
|
||||
<li><p>This is the new version: <a href="https://addons.mozilla.org/en-US/firefox/addon/i2p-in-private-browsing/">[link]</a></p></li>
|
||||
<li><p>This is the old version: <a href="https://addons.mozilla.org/en-US/firefox/addon/I2P-Proxy/">[link]</a></p></li>
|
||||
</ul>
|
||||
|
||||
<li>[ready] <strong>Provide</strong> help in a variety of languages.</li>
|
||||
<h2>Android usage:</h2>
|
||||
|
||||
<li>[done] <strong>Monitor</strong> the health and readiness of the I2P router it is instructed to use. Currently the plugin checks whether the HTTP Proxy is working by fetching an image from "http://proxy.i2p" and displaying a result. A work-in-progress binding to i2pcontrol is available in ./i2pcontrol, it is inert at this time.</li>
|
||||
|
||||
<li><img alt="Visiting toopie.html" src="toopie.png" title="">
|
||||
</li>
|
||||
|
||||
<li>[Done] <strong>Handle</strong> router console applications under their own origins and within their own contextual identity. (1) The router console is automatically confined to it's own container tab. (2) Use a custom protocol handler to place each i2p application/plugin under it's own origin, shortening router console URL's and placing applications under their own origin.</li>
|
||||
|
||||
<li><img alt="Visiting routerconsole" src="routerconsole.png" title="">
|
||||
</li>
|
||||
|
||||
<li>[Done] <strong>Handle Torrents</strong> by talking to i2psnark-rpc plugin and then adding them directly into the Firefox downloads drop-downs, menus, etc. Enable the use of I2PSnark as a peer-to-peer delivery mechanism for media files.</li>
|
||||
|
||||
<li><img alt="Visiting i2psnark" src="i2psnark.png" title="">
|
||||
</li>
|
||||
|
||||
<li><img alt="Monitoring torrents" src="transmissionrpc.png" title="">
|
||||
</li>
|
||||
|
||||
<li><img alt="Distribute your site as a torrent." src="x-i2p-torrentlocation.png" title="">
|
||||
</li>
|
||||
|
||||
<li>[Started] <strong>Indicate</strong> the level of authenticity provided by TLS. TLS is optional on I2P for now, but some sites offer it anyway. TLS support is experimental and in the works.</li>
|
||||
|
||||
<li>[Started] <strong>Provide</strong> alternate, in-I2P destinations for web sites that want to mirror their content within I2P.</li>
|
||||
|
||||
<li>[Started] <strong>Enhance</strong> the I2P browsing experience by allowing site developers distribute some or all of their resources as torrents, allowing the torrents to be treated effectively as a CDN.</li>
|
||||
|
||||
<li>[barely started] <strong>Isolate</strong> traffic by contextual identity to it's own HTTP Proxy tunnel, each reflecting it's own pseudonymous identity within I2P. The contextual identities. For now, the contextual identities used to manage browsing are "I2P Browsing" and "Web Browsing" where I2P Browsing is capable of using an outproxy but in the case of traffic destined for the clearnet does not do header rewriting, and Web Browsing falls back to the Proxy configured in Firefox. The I2P Browsing will be expanded to
|
||||
<ul>
|
||||
<li>I2P Amnesiac Browsing: Use for General Browsing, stores no history and uses an HTTP Proxy with a very short tunnel-close timeout and no key-reuse.</li>
|
||||
|
||||
<li>I2P Social Networking: Use this for logging into social network accounts, forums, and other interactive asynchronous public communication platforms where your identity is behaviorally linkable. This has a very long tunnel-close timeout and key-reuse until specifically invoked.</li>
|
||||
|
||||
<li>I2P Blogging: Use this for posting content to the web interface of your blog or to other similar websites that you create content on.</li>
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
<li><img alt="Visiting clearweb" src="clearweb.png" title="">
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<h3>Video</h3>
|
||||
|
||||
<ul>
|
||||
<li><img alt="Video of the plugin in action" src="i2psetproxy.js.gif" title="">
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<h2>Documents</h2>
|
||||
|
||||
<ul>
|
||||
<li><strong><a href="https://github.com/eyedeekay/I2P-in-Private-Browsing-Mode-Firefox/releases/download/docs/Browser.Design.Documentation.pdf">Browser Outline</a></strong>: This document is an outline of each of the browser extension's feature panels in presentation form.</li>
|
||||
|
||||
<li><strong><a href="https://github.com/eyedeekay/I2P-in-Private-Browsing-Mode-Firefox/releases/download/docs/Landing.Page.Documentation.pdf">Smart Lander Design</a></strong>: This is the original outline of the smart landing page which became the I2P home page within the browser and the drop-down control panel.</li>
|
||||
|
||||
<li><strong><a href="https://github.com/eyedeekay/I2P-in-Private-Browsing-Mode-Firefox/wiki/Other-Extensions">Other extensions</a></strong>: and how they work with this one.</li>
|
||||
</ul>
|
||||
|
||||
<h2>Super Extra Important Background Info:</h2>
|
||||
|
||||
<p>This plugin's viability is directly related to the viability of Mozilla and Tor's work on hardening Firefox itself and of particular interest are the "Uplift" and "Fusion(Firefox Using Onions)" projects.</p>
|
||||
|
||||
<h3>Links about Project Uplift</h3>
|
||||
|
||||
<ul>
|
||||
<li>
|
||||
<a href="https://wiki.mozilla.org/Security/Tor_Uplift">Tor Uplift</a> is a project which brings important features of the Tor Browser to the mainstream of Firefox users by including patches from Tor Browser Bundle into Firefox where it is appropriate.
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="https://wiki.mozilla.org/Security/FirstPartyIsolation">First Party Isolation</a> is a feature in Firefox and other browsers which keeps information from leaking across first-party domains.
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="https://wiki.mozilla.org/Security/Fingerprinting">Fingerprinting</a> is a technique where a tracker attempts to extract unique information about a user from a side-channel in order to create an identifier that can be used to correlate the user across many sites.
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="https://wiki.mozilla.org/Security/Fennec%2BTor_Project">Fennec</a> is Firefox for Android and this link has some analysis of the privacy consequences of the Android platform.
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="https://wiki.mozilla.org/Security/Tor_Uplift/Tracking">Tracking</a> in Firefox is surveyed here.
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<p>Project uplift seems to have largely been accomplished?</p>
|
||||
|
||||
<h3>Links about Project Fusion</h3>
|
||||
|
||||
<ul>
|
||||
<li>
|
||||
<a href="https://wiki.mozilla.org/Security/Fusion">Project Fusion</a> or Firefox using Onions is a joint Mozilla/Tor effort to create an enhanced Private Browsing mode for Firefox which uses Tor.
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="https://trac.torproject.org/projects/tor/wiki/org/meetings/2018Rome/Notes/FusionProject">Notes</a> from a meeting about Fusion.
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="https://blog.torproject.org/tor-heart-firefox">Tor at the Heart: Firefox</a> is a blog about Tor and the relationship they have to Firefox re: TBB, Fusion.
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<h2>The <strong>Other</strong> Version</h2>
|
||||
|
||||
<p>New versions of this extension create an I2P in Private Browsing mode instead, using container tabs.</p>
|
||||
|
||||
<p>Since this is a drastic change to the behavior of the old plugin, and since there is no UI a new entry for the new plugin has been made at a new location on addons.mozilla.org.</p>
|
||||
|
||||
<ul>
|
||||
<li>
|
||||
<p>This is the new version: <a href="https://addons.mozilla.org/en-US/firefox/addon/i2p-in-private-browsing/">[link]</a></p>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<p>This is the old version: <a href="https://addons.mozilla.org/en-US/firefox/addon/I2P-Proxy/">[link]</a></p>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<h2>Android usage:</h2>
|
||||
|
||||
<p>Use the old version, on either an old version of Firefox(pre-68) or by enabling this custom collection: [Recommended Plugins] https://addons.mozilla.org/en-US/firefox/collections/14614396/I2P-Browser-Fork/</p>
|
||||
<p>Use the old version, on either an old version of Firefox(pre-68) or by enabling
|
||||
this custom collection: [Recommended Plugins] https://addons.mozilla.org/en-US/firefox/collections/14614396/I2P-Browser-Fork/</p>
|
||||
</body>
|
||||
</html>
|
||||
|
45
info.js
@ -123,6 +123,12 @@ document.addEventListener("click", (clickEvent) => {
|
||||
} else if (clickEvent.target.id === "window-visit-index") {
|
||||
console.log("attempting to create index tab");
|
||||
goIndex();
|
||||
} else if (clickEvent.target.id === "window-visit-torrent") {
|
||||
console.log("attempting to create torrent tab");
|
||||
goTorrent();
|
||||
} else if (clickEvent.target.id === "window-visit-help") {
|
||||
console.log("attempting to create torrent tab");
|
||||
goHelp();
|
||||
} else if (clickEvent.target.id === "window-visit-homepage") {
|
||||
console.log("attempting to create homepage tab");
|
||||
goHome();
|
||||
@ -197,6 +203,9 @@ function showTorrentsMenu() {
|
||||
}
|
||||
|
||||
function goHome() {
|
||||
function onTabError() {
|
||||
console.log("Help tab created");
|
||||
}
|
||||
function gotProxyInfo(info) {
|
||||
let port = info.value.http.split(":")[1];
|
||||
if (port == "7644") {
|
||||
@ -216,14 +225,16 @@ function goHome() {
|
||||
}
|
||||
console.log("(bookmarks) adding home page bookmark");
|
||||
}
|
||||
console.log("(bookmarks) checking if we're running in an I2P Browser");
|
||||
var gettingProxyInfo = browser.proxy.settings.get({});
|
||||
gettingProxyInfo.then(gotProxyInfo);
|
||||
if (browser.windows != undefined) {
|
||||
console.log("(bookmarks) checking if we're running in an I2P Browser");
|
||||
var gettingProxyInfo = browser.proxy.settings.get({});
|
||||
gettingProxyInfo.then(gotProxyInfo);
|
||||
}
|
||||
}
|
||||
|
||||
function goIndex() {
|
||||
function onTabError() {
|
||||
console.log("Help tab created");
|
||||
console.log("Help tab not created");
|
||||
}
|
||||
let createData = {
|
||||
url: "index.html",
|
||||
@ -233,6 +244,30 @@ function goIndex() {
|
||||
creating.then(onTabCreated, onTabError);
|
||||
}
|
||||
|
||||
function goTorrent() {
|
||||
function onTabError() {
|
||||
console.log("Torrent Help tab not created");
|
||||
}
|
||||
let createData = {
|
||||
url: "torrent/index.html",
|
||||
};
|
||||
console.log("visiting torrent help");
|
||||
let creating = browser.tabs.create(createData);
|
||||
creating.then(onTabCreated, onTabError);
|
||||
}
|
||||
|
||||
function goHelp() {
|
||||
function onTabError() {
|
||||
console.log("Torrent Help tab not created");
|
||||
}
|
||||
let createData = {
|
||||
url: "i2pcontrol/index.html",
|
||||
};
|
||||
console.log("visiting torrent help");
|
||||
let creating = browser.tabs.create(createData);
|
||||
creating.then(onTabCreated, onTabError);
|
||||
}
|
||||
|
||||
function goToopie() {
|
||||
function onTabError() {
|
||||
console.log("Toopie tab created");
|
||||
@ -252,7 +287,7 @@ function goSearch() {
|
||||
}
|
||||
let createData = {
|
||||
url:
|
||||
"http://yacy.idk.i2p/yacysearch.html?" +
|
||||
"http://legwork.i2p/yacysearch.html?" +
|
||||
"query=" +
|
||||
document.getElementById("search-query").value,
|
||||
};
|
||||
|
BIN
lander.png
Before Width: | Height: | Size: 237 KiB After Width: | Height: | Size: 97 KiB |
@ -1,8 +1,9 @@
|
||||
{
|
||||
"applications": {
|
||||
"browser_specific_settings": {
|
||||
"gecko": {
|
||||
"id": "i2ppb@eyedeekay.github.io",
|
||||
"strict_min_version": "60.0"
|
||||
"strict_min_version": "91.1.0",
|
||||
"update_url": "https://thiswillneedtobeaneephttpdbase32address.b32.i2p/updates.json"
|
||||
}
|
||||
},
|
||||
"permissions": [
|
||||
@ -27,7 +28,7 @@
|
||||
],
|
||||
"manifest_version": 2,
|
||||
"name": "__MSG_extensionName__",
|
||||
"version": "0.95",
|
||||
"version": "0.123",
|
||||
"description": "__MSG_extensionDescription__",
|
||||
"homepage_url": "https://github.com/eyedeekay/I2P-in-Private-Browsing-Mode-Firefox",
|
||||
"icons": {
|
||||
@ -49,7 +50,7 @@
|
||||
"page_action": {
|
||||
"browser_style": true,
|
||||
"default_title": "__MSG_toopieTLS__",
|
||||
"default_icon": "icons/toopie.png",
|
||||
"default_icon": "icons/i2plogo.png",
|
||||
"show_matches": [
|
||||
"http://*.i2p/*",
|
||||
"https://*.i2p/*",
|
||||
|
BIN
menu.png
Before Width: | Height: | Size: 97 KiB After Width: | Height: | Size: 300 KiB |
@ -446,10 +446,11 @@ function i2pHostName(url) {
|
||||
|
||||
function i2pHost(url) {
|
||||
let hostname = i2pHostName(url);
|
||||
if (hostname.endsWith(".i2p")) {
|
||||
console.log("(hostname) i2p", hostname);
|
||||
let postname = hostname.split(":")[0];
|
||||
if (postname.endsWith(".i2p")) {
|
||||
console.log("(hostname) i2p", postname);
|
||||
}
|
||||
return hostname.endsWith(".i2p");
|
||||
return postname.endsWith(".i2p");
|
||||
}
|
||||
|
||||
function onContextGotLog(contexts) {
|
||||
|
77
proxy.js
@ -1,10 +1,15 @@
|
||||
var titlepref = chrome.i18n.getMessage("titlePreface");
|
||||
var webpref = chrome.i18n.getMessage("webPreface");
|
||||
var ircpref = chrome.i18n.getMessage("ircPreface");
|
||||
var torrentpref = chrome.i18n.getMessage("torrentPreface");
|
||||
var routerpref = chrome.i18n.getMessage("routerPreface");
|
||||
var routerprefpriv = chrome.i18n.getMessage("routerPrefacePrivate");
|
||||
var mailpref = chrome.i18n.getMessage("mailPreface");
|
||||
var torrentpref = chrome.i18n.getMessage("torrentPreface");
|
||||
var tunnelpref = chrome.i18n.getMessage("i2ptunnelPreface");
|
||||
var ircpref = chrome.i18n.getMessage("ircPreface");
|
||||
var extensionpref = chrome.i18n.getMessage("extensionPreface");
|
||||
var muwirepref = chrome.i18n.getMessage("muwirePreface");
|
||||
var botepref = chrome.i18n.getMessage("botePreface");
|
||||
var blogpref = chrome.i18n.getMessage("blogPreface");
|
||||
var blogprefpriv = chrome.i18n.getMessage("blogPrefacePrivate");
|
||||
|
||||
browser.privacy.network.peerConnectionEnabled.set({
|
||||
value: true,
|
||||
@ -37,6 +42,21 @@ var handleContextProxyRequest = async function (requestDetails) {
|
||||
return proxy;
|
||||
}
|
||||
}
|
||||
function blogProxy() {
|
||||
if (!requestDetails.url.includes("8084")) {
|
||||
proxy = {
|
||||
type: getScheme(),
|
||||
host: getHost(),
|
||||
port: getPort(),
|
||||
};
|
||||
return proxy;
|
||||
}
|
||||
if (requestDetails.url.includes(":8084")) {
|
||||
proxy = null;
|
||||
return proxy;
|
||||
}
|
||||
}
|
||||
|
||||
function btProxy() {
|
||||
proxy = routerProxy();
|
||||
if (requestDetails.url.includes(":7662")) {
|
||||
@ -97,6 +117,9 @@ var handleContextProxyRequest = async function (requestDetails) {
|
||||
if (context.name == ircpref) {
|
||||
proxy = ircProxy();
|
||||
return proxy;
|
||||
} else if (context.name == blogpref) {
|
||||
proxy = blogProxy();
|
||||
return proxy;
|
||||
} else if (context.name == titlepref) {
|
||||
proxy = mainProxy();
|
||||
return proxy;
|
||||
@ -106,8 +129,15 @@ var handleContextProxyRequest = async function (requestDetails) {
|
||||
} else if (context.name == torrentpref) {
|
||||
proxy = btProxy();
|
||||
return proxy;
|
||||
} else if (context.name == mailpref) {
|
||||
return proxy;
|
||||
} else if (context.name == tunnelpref) {
|
||||
return proxy;
|
||||
} else if (context.name == muwirepref) {
|
||||
return proxy;
|
||||
} else if (context.name == botepref) {
|
||||
return proxy;
|
||||
}
|
||||
return proxy;
|
||||
} else {
|
||||
if (!routerHost(requestDetails.url)) {
|
||||
if (localHost(requestDetails.url)) {
|
||||
@ -129,6 +159,8 @@ var handleContextProxyRequest = async function (requestDetails) {
|
||||
host: getHost(),
|
||||
port: getPort(),
|
||||
};
|
||||
} else {
|
||||
proxy = null;
|
||||
}
|
||||
if (requestDetails.url.includes("rpc")) {
|
||||
console.log("(proxy for rpc url)", rpc);
|
||||
@ -143,7 +175,7 @@ var handleContextProxyRequest = async function (requestDetails) {
|
||||
context = await browser.contextualIdentities.get(tabInfo.cookieStoreId);
|
||||
return context;
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
console.warn(error);
|
||||
return "firefox-default";
|
||||
}
|
||||
};
|
||||
@ -175,7 +207,9 @@ var handleContextProxyRequest = async function (requestDetails) {
|
||||
requestDetails.cookieStoreId == "firefox-default" ||
|
||||
requestDetails.cookieStoreId == "firefox-private"
|
||||
) {
|
||||
return browser.proxy.settings.get({});
|
||||
if (browser.windows != undefined) {
|
||||
return browser.proxy.settings.get({});
|
||||
}
|
||||
}
|
||||
if (requestDetails.tabId > 0) {
|
||||
if (requestDetails.url.includes("MuWire")) {
|
||||
@ -188,8 +222,6 @@ var handleContextProxyRequest = async function (requestDetails) {
|
||||
port: getPort(),
|
||||
};
|
||||
return proxy;
|
||||
} else if (extensionHost(requestDetails.url)) {
|
||||
return;
|
||||
} else if (i2pHost(requestDetails.url)) {
|
||||
var tab = tabGet(requestDetails.tabId);
|
||||
requestDetails.tabId = tab;
|
||||
@ -197,6 +229,8 @@ var handleContextProxyRequest = async function (requestDetails) {
|
||||
var proxy = await context.then(handleProxyRequest);
|
||||
//console.log('(proxy)Returning I2P Proxy', proxy);
|
||||
return proxy;
|
||||
} else if (extensionHost(requestDetails)) {
|
||||
return;
|
||||
} else {
|
||||
var tab = tabGet(requestDetails.tabId);
|
||||
var context = tab.then(contextGet);
|
||||
@ -213,7 +247,7 @@ var handleContextProxyRequest = async function (requestDetails) {
|
||||
host: getHost(),
|
||||
port: getPort(),
|
||||
};
|
||||
console.log("(proxy for rpc url)", rpc);
|
||||
//console.log('(proxy for rpc url)', rpc);
|
||||
return proxy;
|
||||
}
|
||||
} catch (error) {
|
||||
@ -271,9 +305,8 @@ 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,
|
||||
onSetupError
|
||||
@ -288,9 +321,8 @@ 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,
|
||||
onSetupError
|
||||
@ -308,9 +340,8 @@ function SetupSettings() {
|
||||
);
|
||||
setupProxy();
|
||||
}
|
||||
var gettingHistoryStoredSettings = browser.storage.local.get(
|
||||
"disable_history"
|
||||
);
|
||||
var gettingHistoryStoredSettings =
|
||||
browser.storage.local.get("disable_history");
|
||||
gettingHistoryStoredSettings.then(checkHistoryStoredSettings, onSetupError);
|
||||
}
|
||||
|
||||
@ -379,9 +410,11 @@ setupProxy();
|
||||
|
||||
var gettingListenerInfo = browser.runtime.getPlatformInfo();
|
||||
gettingListenerInfo.then((got) => {
|
||||
browser.windows.onCreated.addListener(() => {
|
||||
chrome.storage.local.get(function () {
|
||||
setupProxy();
|
||||
if (browser.windows != undefined) {
|
||||
browser.windows.onCreated.addListener(() => {
|
||||
chrome.storage.local.get(function () {
|
||||
setupProxy();
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
|
202
releases.atom
@ -4,13 +4,110 @@
|
||||
<link type="text/html" rel="alternate" href="https://github.com/eyedeekay/I2P-in-Private-Browsing-Mode-Firefox/releases"/>
|
||||
<link type="application/atom+xml" rel="self" href="https://github.com/eyedeekay/I2P-in-Private-Browsing-Mode-Firefox/releases.atom"/>
|
||||
<title>Release notes from I2P-in-Private-Browsing-Mode-Firefox</title>
|
||||
<updated>2020-12-21T23:13:19Z</updated>
|
||||
<updated>2021-05-26T22:32:58Z</updated>
|
||||
<entry>
|
||||
<id>tag:github.com,2008:Repository/169256012/0.105</id>
|
||||
<updated>2021-05-27T20:19:35Z</updated>
|
||||
<link rel="alternate" type="text/html" href="https://github.com/eyedeekay/I2P-in-Private-Browsing-Mode-Firefox/releases/tag/0.105"/>
|
||||
<title>0.105</title>
|
||||
<enclosure url="magnet:?xl=2485<title>0.105</title>dn=i2ppb%40eyedeekay.github.io.xpi.torrent<title>0.105</title>xt=urn:tree:tiger:w6kewvpw25bnau2rwkczbnryrjdzn54ietse3zi<title>0.105</title>xt=urn:ed2k:1cd9743fb664404298b7f2ad7ee45db0<title>0.105</title>xt=urn:aich:4vhcsp6t3c2mkjzds2etixyinyj7xtkp" type="application/x-bittorrent" />
|
||||
<content type="html"><p>Browsing to a single contextual identity, thus creating an I2P in Private<br>
|
||||
Browsing mode. It requires the use of a pre-installed I2P Router.<br>
|
||||
i2psetproxy.js (0.105-1) UNRELEASED; urgency=low</p>
|
||||
<ul>
|
||||
<li>Add help page for configuring i2pcontrol</li>
|
||||
<li>Add help page for configuring i2psnark-rpc</li>
|
||||
<li>Update the icons</li>
|
||||
</ul>
|
||||
<p>-- idk <a href="mailto:hankhill19580@gmail.com">hankhill19580@gmail.com</a> Wed, 26 May 2021 12:56:56 -0400</p>
|
||||
<p>i2psetproxy.js (0.103-1) UNRELEASED; urgency=low</p></content>
|
||||
<author>
|
||||
<name>eyedeekay</name>
|
||||
</author>
|
||||
<media:thumbnail height="30" width="30" url="https://avatars.githubusercontent.com/u/8733713?s=60&v=4"/>
|
||||
</entry>
|
||||
<entry>
|
||||
<id>tag:github.com,2008:Repository/169256012/0.103</id>
|
||||
<updated>2021-05-26T16:59:28Z</updated>
|
||||
<link rel="alternate" type="text/html" href="https://github.com/eyedeekay/I2P-in-Private-Browsing-Mode-Firefox/releases/tag/0.103"/>
|
||||
<title>0.103</title>
|
||||
<content type="html"><p>A simple plugin for configuring a Firefox based web browser to isolate I2P<br>
|
||||
Browsing to a single contextual identity, thus creating an I2P in Private<br>
|
||||
Browsing mode. It requires the use of a pre-installed I2P Router.<br>
|
||||
i2psetproxy.js (0.103-1) UNRELEASED; urgency=low</p>
|
||||
<ul>
|
||||
<li>Fix for double-test issue on /home.html page in the extension</li>
|
||||
<li>Fix for broken options menu</li>
|
||||
</ul>
|
||||
<p>-- idk <a href="mailto:hankhill19580@gmail.com">hankhill19580@gmail.com</a> Wed, 26 May 2021 12:56:56 -0400</p>
|
||||
<p>i2psetproxy.js (0.101-1) UNRELEASED; urgency=low</p></content>
|
||||
<author>
|
||||
<name>eyedeekay</name>
|
||||
</author>
|
||||
<media:thumbnail height="30" width="30" url="https://avatars.githubusercontent.com/u/8733713?s=60&v=4"/>
|
||||
</entry>
|
||||
<entry>
|
||||
<id>tag:github.com,2008:Repository/169256012/0.101</id>
|
||||
<updated>2021-05-24T19:42:29Z</updated>
|
||||
<link rel="alternate" type="text/html" href="https://github.com/eyedeekay/I2P-in-Private-Browsing-Mode-Firefox/releases/tag/0.101"/>
|
||||
<title>0.101</title>
|
||||
<content type="html"><p>-- idk <a href="mailto:hankhill19580@gmail.com">hankhill19580@gmail.com</a> Mon, 24 May 2021 3:41:35 -0400</p>
|
||||
<p>i2psetproxy.js (0.99-1) UNRELEASED; urgency=low</p>
|
||||
<ul>
|
||||
<li>Sweeping changes to styles</li>
|
||||
<li>fix for issue when using noscript and visiting susimail</li>
|
||||
</ul>
|
||||
<p>-- idk <a href="mailto:hankhill19580@gmail.com">hankhill19580@gmail.com</a> Mon, 24 May 2021 2:05:21 -0400</p>
|
||||
<p>i2psetproxy.js (0.97-1) UNRELEASED; urgency=low</p></content>
|
||||
<author>
|
||||
<name>eyedeekay</name>
|
||||
</author>
|
||||
<media:thumbnail height="30" width="30" url="https://avatars.githubusercontent.com/u/8733713?s=60&v=4"/>
|
||||
</entry>
|
||||
<entry>
|
||||
<id>tag:github.com,2008:Repository/169256012/0.99</id>
|
||||
<updated>2021-05-24T18:08:37Z</updated>
|
||||
<link rel="alternate" type="text/html" href="https://github.com/eyedeekay/I2P-in-Private-Browsing-Mode-Firefox/releases/tag/0.99"/>
|
||||
<title>0.99</title>
|
||||
<content type="html"><p>A simple plugin for configuring a Firefox based web browser to isolate I2P<br>
|
||||
Browsing to a single contextual identity, thus creating an I2P in Private<br>
|
||||
Browsing mode. It requires the use of a pre-installed I2P Router.<br>
|
||||
i2psetproxy.js (0.99-1) UNRELEASED; urgency=low</p>
|
||||
<ul>
|
||||
<li>Sweeping changes to styles</li>
|
||||
<li>fix for issue when using noscript and visiting susimail</li>
|
||||
</ul>
|
||||
<p>-- idk <a href="mailto:hankhill19580@gmail.com">hankhill19580@gmail.com</a> Mon, 24 May 2021 2:05:21 -0400</p>
|
||||
<p>i2psetproxy.js (0.97-1) UNRELEASED; urgency=low</p></content>
|
||||
<author>
|
||||
<name>eyedeekay</name>
|
||||
</author>
|
||||
<media:thumbnail height="30" width="30" url="https://avatars.githubusercontent.com/u/8733713?s=60&v=4"/>
|
||||
</entry>
|
||||
<entry>
|
||||
<id>tag:github.com,2008:Repository/169256012/0.97</id>
|
||||
<updated>2021-02-05T18:05:51Z</updated>
|
||||
<link rel="alternate" type="text/html" href="https://github.com/eyedeekay/I2P-in-Private-Browsing-Mode-Firefox/releases/tag/0.97"/>
|
||||
<title>0.97</title>
|
||||
<content type="html"><p>A simple plugin for configuring a Firefox based web browser to isolate I2P<br>
|
||||
Browsing to a single contextual identity, thus creating an I2P in Private<br>
|
||||
Browsing mode. It requires the use of a pre-installed I2P Router.<br>
|
||||
i2psetproxy.js (0.97-1) UNRELEASED; urgency=low</p>
|
||||
<ul>
|
||||
<li>Fix theme issue, add x-i2p-torrentlocation HEADER support</li>
|
||||
</ul>
|
||||
<p>-- idk <a href="mailto:hankhill19580@gmail.com">hankhill19580@gmail.com</a> FRI, 5 FEB 2021 1:02:55 -0400</p>
|
||||
<p>i2psetproxy.js (0.95-1) UNRELEASED; urgency=low</p></content>
|
||||
<author>
|
||||
<name>eyedeekay</name>
|
||||
</author>
|
||||
<media:thumbnail height="30" width="30" url="https://avatars.githubusercontent.com/u/8733713?s=60&v=4"/>
|
||||
</entry>
|
||||
<entry>
|
||||
<id>tag:github.com,2008:Repository/169256012/0.95</id>
|
||||
<updated>2020-12-21T23:21:35Z</updated>
|
||||
<link rel="alternate" type="text/html" href="https://github.com/eyedeekay/I2P-in-Private-Browsing-Mode-Firefox/releases/tag/0.95"/>
|
||||
<title>0.95</title>
|
||||
<enclosure url="magnet:?xt=urn:btih:7ec361c3ddc3fb904e369a19cdf4259af94af624" type="application/x-bittorrent" />
|
||||
<content type="html"><p>A simple plugin for configuring a Firefox based web browser to isolate I2P<br>
|
||||
Browsing to a single contextual identity, thus creating an I2P in Private<br>
|
||||
Browsing mode. It requires the use of a pre-installed I2P Router.<br>
|
||||
@ -23,7 +120,7 @@ i2psetproxy.js (0.95-1) UNRELEASED; urgency=low</p>
|
||||
<author>
|
||||
<name>eyedeekay</name>
|
||||
</author>
|
||||
<media:thumbnail height="30" width="30" url="https://avatars3.githubusercontent.com/u/8733713?s=60&v=4"/>
|
||||
<media:thumbnail height="30" width="30" url="https://avatars.githubusercontent.com/u/8733713?s=60&v=4"/>
|
||||
</entry>
|
||||
<entry>
|
||||
<id>tag:github.com,2008:Repository/169256012/0.93</id>
|
||||
@ -42,7 +139,7 @@ i2psetproxy.js (0.93-1) UNRELEASED; urgency=low</p>
|
||||
<author>
|
||||
<name>eyedeekay</name>
|
||||
</author>
|
||||
<media:thumbnail height="30" width="30" url="https://avatars3.githubusercontent.com/u/8733713?s=60&v=4"/>
|
||||
<media:thumbnail height="30" width="30" url="https://avatars.githubusercontent.com/u/8733713?s=60&v=4"/>
|
||||
</entry>
|
||||
<entry>
|
||||
<id>tag:github.com,2008:Repository/169256012/0.91</id>
|
||||
@ -61,7 +158,7 @@ i2psetproxy.js (0.91-1) UNRELEASED; urgency=low</p>
|
||||
<author>
|
||||
<name>eyedeekay</name>
|
||||
</author>
|
||||
<media:thumbnail height="30" width="30" url="https://avatars3.githubusercontent.com/u/8733713?s=60&v=4"/>
|
||||
<media:thumbnail height="30" width="30" url="https://avatars.githubusercontent.com/u/8733713?s=60&v=4"/>
|
||||
</entry>
|
||||
<entry>
|
||||
<id>tag:github.com,2008:Repository/169256012/0.89</id>
|
||||
@ -81,7 +178,7 @@ i2psetproxy.js (0.89-1) UNRELEASED; urgency=low</p>
|
||||
<author>
|
||||
<name>eyedeekay</name>
|
||||
</author>
|
||||
<media:thumbnail height="30" width="30" url="https://avatars3.githubusercontent.com/u/8733713?s=60&v=4"/>
|
||||
<media:thumbnail height="30" width="30" url="https://avatars.githubusercontent.com/u/8733713?s=60&v=4"/>
|
||||
</entry>
|
||||
<entry>
|
||||
<id>tag:github.com,2008:Repository/169256012/0.87</id>
|
||||
@ -101,97 +198,6 @@ i2psetproxy.js (0.87-1) UNRELEASED; urgency=low</p>
|
||||
<author>
|
||||
<name>eyedeekay</name>
|
||||
</author>
|
||||
<media:thumbnail height="30" width="30" url="https://avatars3.githubusercontent.com/u/8733713?s=60&v=4"/>
|
||||
</entry>
|
||||
<entry>
|
||||
<id>tag:github.com,2008:Repository/169256012/0.85</id>
|
||||
<updated>2020-11-11T06:44:44Z</updated>
|
||||
<link rel="alternate" type="text/html" href="https://github.com/eyedeekay/I2P-in-Private-Browsing-Mode-Firefox/releases/tag/0.85"/>
|
||||
<title>0.85</title>
|
||||
<content type="html"><p>A simple plugin for configuring a Firefox based web browser to isolate I2P<br>
|
||||
Browsing to a single contextual identity, thus creating an I2P in Private<br>
|
||||
Browsing mode. It requires the use of a pre-installed I2P Router.<br>
|
||||
i2psetproxy.js (0.85-1) UNRELEASED; urgency=low</p>
|
||||
<ul>
|
||||
<li>Fix a bug which was causing i2psnark to fail to isolate.</li>
|
||||
</ul>
|
||||
<p>-- idk <a href="mailto:hankhill19580@gmail.com">hankhill19580@gmail.com</a> Sat, 10 NOV 2020 1:33:50 -0400</p>
|
||||
<p>i2psetproxy.js (0.83-1) UNRELEASED; urgency=low</p></content>
|
||||
<author>
|
||||
<name>eyedeekay</name>
|
||||
</author>
|
||||
<media:thumbnail height="30" width="30" url="https://avatars3.githubusercontent.com/u/8733713?s=60&v=4"/>
|
||||
</entry>
|
||||
<entry>
|
||||
<id>tag:github.com,2008:Repository/169256012/0.83</id>
|
||||
<updated>2020-11-11T04:00:27Z</updated>
|
||||
<link rel="alternate" type="text/html" href="https://github.com/eyedeekay/I2P-in-Private-Browsing-Mode-Firefox/releases/tag/0.83"/>
|
||||
<title>0.83</title>
|
||||
<content type="html"><p>A simple plugin for configuring a Firefox based web browser to isolate I2P<br>
|
||||
Browsing to a single contextual identity, thus creating an I2P in Private<br>
|
||||
Browsing mode. It requires the use of a pre-installed I2P Router.<br>
|
||||
i2psetproxy.js (0.83-1) UNRELEASED; urgency=low</p>
|
||||
<ul>
|
||||
<li>Add a tab for I2P-Native Dispatch</li>
|
||||
</ul>
|
||||
<p>-- idk <a href="mailto:hankhill19580@gmail.com">hankhill19580@gmail.com</a> Sat, 10 NOV 2020 22:00:01 -0400</p>
|
||||
<p>i2psetproxy.js (0.81-1) UNRELEASED; urgency=low</p></content>
|
||||
<author>
|
||||
<name>eyedeekay</name>
|
||||
</author>
|
||||
<media:thumbnail height="30" width="30" url="https://avatars3.githubusercontent.com/u/8733713?s=60&v=4"/>
|
||||
</entry>
|
||||
<entry>
|
||||
<id>tag:github.com,2008:Repository/169256012/0.81</id>
|
||||
<updated>2020-11-08T02:44:34Z</updated>
|
||||
<link rel="alternate" type="text/html" href="https://github.com/eyedeekay/I2P-in-Private-Browsing-Mode-Firefox/releases/tag/0.81"/>
|
||||
<title>0.81</title>
|
||||
<content type="html"><p>Browsing mode. It requires the use of a pre-installed I2P Router.<br>
|
||||
i2psetproxy.js (0.81-1) UNRELEASED; urgency=low</p>
|
||||
<ul>
|
||||
<li>X-I2P-TorrentLocation header</li>
|
||||
<li>Visual tweaks</li>
|
||||
<li>Deprecate localhost browser container permanently</li>
|
||||
<li>Isolation rules improvements</li>
|
||||
</ul>
|
||||
<p>-- idk <a href="mailto:hankhill19580@gmail.com">hankhill19580@gmail.com</a> Sat, 07 NOV 2020 21:34:25 -0400</p>
|
||||
<p>i2psetproxy.js (0.79-1) UNRELEASED; urgency=low</p></content>
|
||||
<author>
|
||||
<name>eyedeekay</name>
|
||||
</author>
|
||||
<media:thumbnail height="30" width="30" url="https://avatars3.githubusercontent.com/u/8733713?s=60&v=4"/>
|
||||
</entry>
|
||||
<entry>
|
||||
<id>tag:github.com,2008:Repository/169256012/0.79</id>
|
||||
<updated>2020-09-26T03:36:46Z</updated>
|
||||
<link rel="alternate" type="text/html" href="https://github.com/eyedeekay/I2P-in-Private-Browsing-Mode-Firefox/releases/tag/0.79"/>
|
||||
<title>0.79</title>
|
||||
<content type="html"><p>A simple plugin for configuring a Firefox based web browser to isolate I2P<br>
|
||||
Browsing to a single contextual identity, thus creating an I2P in Private<br>
|
||||
Browsing mode. It requires the use of a pre-installed I2P Router.<br>
|
||||
i2psetproxy.js (0.79-1) UNRELEASED; urgency=low</p>
|
||||
<ul>
|
||||
<li>Pin application tabs to the front of the tab order</li>
|
||||
<li>Refine pageaction behavior</li>
|
||||
</ul>
|
||||
<p>-- idk <a href="mailto:hankhill19580@gmail.com">hankhill19580@gmail.com</a> Mon, 24 SEP 2020 20:18:03 -0400</p>
|
||||
<p>i2psetproxy.js (0.77-1) UNRELEASED; urgency=low</p></content>
|
||||
<author>
|
||||
<name>eyedeekay</name>
|
||||
</author>
|
||||
<media:thumbnail height="30" width="30" url="https://avatars3.githubusercontent.com/u/8733713?s=60&v=4"/>
|
||||
</entry>
|
||||
<entry>
|
||||
<id>tag:github.com,2008:Repository/169256012/0.77</id>
|
||||
<updated>2020-09-25T00:19:45Z</updated>
|
||||
<link rel="alternate" type="text/html" href="https://github.com/eyedeekay/I2P-in-Private-Browsing-Mode-Firefox/releases/tag/0.77"/>
|
||||
<title>0.77</title>
|
||||
<content type="html"><p>Merge pull request <a class="issue-link js-issue-link" href="https://github.com/eyedeekay/I2P-in-Private-Browsing-Mode-Firefox/pull/100">#100</a> from eyedeekay/bookmarks</p>
|
||||
|
||||
<p>make the bookmarks part of a subdirectory</p></content>
|
||||
<author>
|
||||
<name>eyedeekay</name>
|
||||
</author>
|
||||
<media:thumbnail height="30" width="30" url="https://avatars3.githubusercontent.com/u/8733713?s=60&v=4"/>
|
||||
<media:thumbnail height="30" width="30" url="https://avatars.githubusercontent.com/u/8733713?s=60&v=4"/>
|
||||
</entry>
|
||||
</feed>
|
||||
|
Before Width: | Height: | Size: 242 KiB After Width: | Height: | Size: 198 KiB |
586
scrub.js
@ -8,6 +8,8 @@ var ircpref = chrome.i18n.getMessage("ircPreface");
|
||||
var extensionpref = chrome.i18n.getMessage("extensionPreface");
|
||||
var muwirepref = chrome.i18n.getMessage("muwirePreface");
|
||||
var botepref = chrome.i18n.getMessage("botePreface");
|
||||
var blogpref = chrome.i18n.getMessage("blogPreface");
|
||||
var blogprefpriv = chrome.i18n.getMessage("blogPrefacePrivate");
|
||||
|
||||
var contextScrub = async function (requestDetails) {
|
||||
function onHeaderError() {
|
||||
@ -86,6 +88,9 @@ var notMyContextNotMyProblem = async function () {
|
||||
var context7 = await browser.contextualIdentities.query({
|
||||
name: botepref,
|
||||
});
|
||||
var context8 = await browser.contextualIdentities.query({
|
||||
name: blogpref,
|
||||
});
|
||||
var othercontexts = [];
|
||||
console.log("Contexts:", contexts);
|
||||
for (context in contexts) {
|
||||
@ -113,143 +118,105 @@ var notMyContextNotMyProblem = async function () {
|
||||
|
||||
var contextSetup = function (requestDetails) {
|
||||
function onContextError() {
|
||||
console.log("Context launcher error");
|
||||
console.error("Context launcher error");
|
||||
}
|
||||
async function forceIntoIsolation(tabId, contextidentifier, tab, pin = true) {
|
||||
console.info(
|
||||
"(isolate) forcing context for",
|
||||
tabId,
|
||||
contextidentifier,
|
||||
tab
|
||||
);
|
||||
try {
|
||||
var context = await browser.contextualIdentities.query({
|
||||
name: contextidentifier,
|
||||
});
|
||||
if (tabId.cookieStoreId != context[0].cookieStoreId) {
|
||||
function Create() {
|
||||
function onCreated(tab) {
|
||||
function closeOldTab(tabs) {
|
||||
if (tabId.id != tab.id) {
|
||||
console.log(
|
||||
"(isolate) Closing un-isolated tab",
|
||||
tabId.id,
|
||||
"in favor of",
|
||||
tab.id,
|
||||
"with context",
|
||||
tab.cookieStoreId
|
||||
);
|
||||
browser.tabs.remove(tabId.id);
|
||||
if (pin) {
|
||||
browser.tabs.move(tab.id, { index: 0 });
|
||||
for (index = 0; index < tabs.length; index++) {
|
||||
if (index != tabs.length - 1)
|
||||
browser.tabs.remove(tabs[index].id);
|
||||
}
|
||||
}
|
||||
}
|
||||
browser.pageAction.setPopup({
|
||||
tabId: tabId.id,
|
||||
popup: "security.html",
|
||||
});
|
||||
browser.pageAction.show(tabId.id);
|
||||
}
|
||||
var pins = browser.tabs.query({
|
||||
cookieStoreId: context[0].cookieStoreId,
|
||||
});
|
||||
pins.then(closeOldTab, onError);
|
||||
// closeOldTab(tab);
|
||||
}
|
||||
var created = browser.tabs.create({
|
||||
active: true,
|
||||
cookieStoreId: context[0].cookieStoreId,
|
||||
url: requestDetails.url,
|
||||
pinned: pin,
|
||||
});
|
||||
created.then(onCreated, onContextError);
|
||||
}
|
||||
var gettab = browser.tabs.get(tabId.id);
|
||||
gettab.then(Create, onContextError);
|
||||
return tabId;
|
||||
}
|
||||
} catch (error) {
|
||||
console.error("(isolate)Context Error", error);
|
||||
}
|
||||
}
|
||||
//console.log("(isolate)Forcing I2P requests into context");
|
||||
try {
|
||||
var i2pTabFind = async function (tabId) {
|
||||
console.info("(isolate)Context Discovery browser");
|
||||
try {
|
||||
var context = await browser.contextualIdentities.query({
|
||||
name: titlepref,
|
||||
});
|
||||
if (tabId.cookieStoreId != context[0].cookieStoreId) {
|
||||
function Create() {
|
||||
function onCreated(tab) {
|
||||
function closeOldTab() {
|
||||
if (tabId.id != tab.id) {
|
||||
console.log("(isolate) Closing un-isolated tab", tabId.id);
|
||||
console.log("in favor of", tab.id);
|
||||
console.log("with context", tab.cookieStoreId);
|
||||
browser.tabs.remove(tabId.id);
|
||||
}
|
||||
browser.pageAction.setPopup({
|
||||
tabId: tabId.id,
|
||||
popup: "security.html",
|
||||
});
|
||||
browser.pageAction.show(tabId.id);
|
||||
}
|
||||
closeOldTab(tab);
|
||||
}
|
||||
var created = browser.tabs.create({
|
||||
active: true,
|
||||
cookieStoreId: context[0].cookieStoreId,
|
||||
url: requestDetails.url,
|
||||
});
|
||||
created.then(onCreated, onContextError);
|
||||
}
|
||||
var gettab = browser.tabs.get(tabId.id);
|
||||
gettab.then(Create, onContextError);
|
||||
return tabId;
|
||||
}
|
||||
return forceIntoIsolation(tabId, titlepref, tab, false);
|
||||
} catch (error) {
|
||||
console.log("(isolate)Context Error", error);
|
||||
console.error("(isolate)Context Error", error);
|
||||
}
|
||||
};
|
||||
var routerTabFind = async function (tabId) {
|
||||
console.info("(isolate)Context Discovery console");
|
||||
try {
|
||||
var context = await browser.contextualIdentities.query({
|
||||
name: routerpref,
|
||||
});
|
||||
if (tabId.cookieStoreId != context[0].cookieStoreId) {
|
||||
function Create() {
|
||||
function onCreated(tab) {
|
||||
function closeOldTab(tabs) {
|
||||
if (tabId.id != tab.id) {
|
||||
console.log("(isolate) Closing un-isolated tab", tabId.id);
|
||||
console.log("in favor of", tab.id);
|
||||
console.log("with context", tab.cookieStoreId);
|
||||
browser.tabs.remove(tabId.id);
|
||||
browser.tabs.move(tab.id, { index: 0 });
|
||||
}
|
||||
for (index = 0; index < tabs.length; index++) {
|
||||
if (index != tabs.length - 1)
|
||||
browser.tabs.remove(tabs[index].id);
|
||||
}
|
||||
}
|
||||
var pins = browser.tabs.query({
|
||||
cookieStoreId: context[0].cookieStoreId,
|
||||
});
|
||||
pins.then(closeOldTab, onError);
|
||||
}
|
||||
if (requestDetails.url.endsWith("xhr1.html")) {
|
||||
hostname = url.split("/")[2];
|
||||
let prefix = url.substr(0, url.indexOf("://") + 3);
|
||||
requestDetails.url = prefix + hostname + "/home";
|
||||
}
|
||||
var created = browser.tabs.create({
|
||||
active: true,
|
||||
pinned: true,
|
||||
cookieStoreId: context[0].cookieStoreId,
|
||||
url: requestDetails.url,
|
||||
});
|
||||
created.then(onCreated, onContextError);
|
||||
}
|
||||
var gettab = browser.tabs.get(tabId.id);
|
||||
gettab.then(Create, onContextError);
|
||||
return tabId;
|
||||
}
|
||||
return forceIntoIsolation(tabId, routerpref, tab);
|
||||
} catch (error) {
|
||||
console.log("(isolate)Context Error", error);
|
||||
console.error("(isolate)Context Error", error);
|
||||
}
|
||||
};
|
||||
var i2ptunnelTabFind = async function (tabId) {
|
||||
console.info("(isolate)Context Discovery browser");
|
||||
try {
|
||||
var context = await browser.contextualIdentities.query({
|
||||
name: tunnelpref,
|
||||
});
|
||||
if (tabId.cookieStoreId != context[0].cookieStoreId) {
|
||||
function Create() {
|
||||
function onCreated(tab) {
|
||||
function closeOldTab(tabs) {
|
||||
if (tabId.id != tab.id) {
|
||||
console.log("(isolate) Closing un-isolated tab", tabId.id);
|
||||
console.log("in favor of", tab.id);
|
||||
console.log("with context", tab.cookieStoreId);
|
||||
browser.tabs.remove(tabId.id);
|
||||
browser.tabs.move(tab.id, { index: 0 });
|
||||
}
|
||||
for (index = 0; index < tabs.length; index++) {
|
||||
if (index != tabs.length - 1)
|
||||
browser.tabs.remove(tabs[index].id);
|
||||
}
|
||||
}
|
||||
var pins = browser.tabs.query({
|
||||
cookieStoreId: context[0].cookieStoreId,
|
||||
});
|
||||
pins.then(closeOldTab, onError);
|
||||
}
|
||||
if (requestDetails.url.endsWith("xhr1.html")) {
|
||||
hostname = url.split("/")[2];
|
||||
let prefix = url.substr(0, url.indexOf("://") + 3);
|
||||
requestDetails.url = prefix + hostname + "/i2ptunnelmgr/";
|
||||
}
|
||||
var created = browser.tabs.create({
|
||||
active: true,
|
||||
pinned: true,
|
||||
cookieStoreId: context[0].cookieStoreId,
|
||||
url: requestDetails.url,
|
||||
});
|
||||
created.then(onCreated, onContextError);
|
||||
}
|
||||
var gettab = browser.tabs.get(tabId.id);
|
||||
gettab.then(Create, onContextError);
|
||||
return tabId;
|
||||
}
|
||||
return forceIntoIsolation(tabId, tunnelpref, tab);
|
||||
} catch (error) {
|
||||
console.log("(isolate)Context Error", error);
|
||||
console.error("(isolate)Context Error", error);
|
||||
}
|
||||
};
|
||||
var snarkTabFind = async function (tabId) {
|
||||
console.info("(isolate)Context Discovery torrents");
|
||||
try {
|
||||
var context = await browser.contextualIdentities.query({
|
||||
name: torrentpref,
|
||||
@ -266,9 +233,14 @@ var contextSetup = function (requestDetails) {
|
||||
function onCreated(tab) {
|
||||
function closeOldTab(tabs) {
|
||||
if (tabId.id != tab.id) {
|
||||
console.log("(isolate) Closing un-isolated tab", tabId.id);
|
||||
console.log("in favor of", tab.id);
|
||||
console.log("with context", tab.cookieStoreId);
|
||||
console.log(
|
||||
"(isolate) Closing un-isolated tab",
|
||||
tabId.id,
|
||||
"in favor of",
|
||||
tab.id,
|
||||
"with context",
|
||||
tab.cookieStoreId
|
||||
);
|
||||
browser.tabs.remove(tabId.id);
|
||||
browser.tabs.move(tab.id, { index: 0 });
|
||||
}
|
||||
@ -305,188 +277,58 @@ var contextSetup = function (requestDetails) {
|
||||
}
|
||||
};
|
||||
var muwireTabFind = async function (tabId) {
|
||||
console.info("(isolate)Context Discovery muwire");
|
||||
try {
|
||||
var context = await browser.contextualIdentities.query({
|
||||
name: muwirepref,
|
||||
});
|
||||
if (tabId.cookieStoreId != context[0].cookieStoreId) {
|
||||
function Create() {
|
||||
function onCreated(tab) {
|
||||
function closeOldTab(tabs) {
|
||||
if (tabId.id != tab.id) {
|
||||
console.log("(isolate) Closing un-isolated tab", tabId.id);
|
||||
console.log("in favor of", tab.id);
|
||||
console.log("with context", tab.cookieStoreId);
|
||||
browser.tabs.remove(tabId.id);
|
||||
browser.tabs.move(tab.id, { index: 0 });
|
||||
}
|
||||
for (index = 0; index < tabs.length; index++) {
|
||||
if (index != tabs.length - 1)
|
||||
browser.tabs.remove(tabs[index].id);
|
||||
}
|
||||
}
|
||||
var pins = browser.tabs.query({
|
||||
cookieStoreId: context[0].cookieStoreId,
|
||||
});
|
||||
pins.then(closeOldTab, onError);
|
||||
}
|
||||
if (requestDetails.url.endsWith("xhr1.html")) {
|
||||
hostname = url.split("/")[2];
|
||||
let prefix = url.substr(0, url.indexOf("://") + 3);
|
||||
requestDetails.url = prefix + hostname + "/muwire/";
|
||||
}
|
||||
var created = browser.tabs.create({
|
||||
active: true,
|
||||
pinned: true,
|
||||
cookieStoreId: context[0].cookieStoreId,
|
||||
url: requestDetails.url,
|
||||
});
|
||||
created.then(onCreated, onContextError);
|
||||
}
|
||||
var gettab = browser.tabs.get(tabId.id);
|
||||
gettab.then(Create, onContextError);
|
||||
return tabId;
|
||||
}
|
||||
return forceIntoIsolation(tabId, muwirepref, tab);
|
||||
} catch (error) {
|
||||
console.log("(isolate)Context Error", error);
|
||||
console.error("(isolate)Context Error", error);
|
||||
}
|
||||
};
|
||||
var i2pboteTabFind = async function (tabId) {
|
||||
console.info("(isolate)Context Discovery bote");
|
||||
try {
|
||||
var context = await browser.contextualIdentities.query({
|
||||
name: botepref,
|
||||
});
|
||||
if (tabId.cookieStoreId != context[0].cookieStoreId) {
|
||||
function Create() {
|
||||
function onCreated(tab) {
|
||||
function closeOldTab(tabs) {
|
||||
if (tabId.id != tab.id) {
|
||||
console.log("(isolate) Closing un-isolated tab", tabId.id);
|
||||
console.log("in favor of", tab.id);
|
||||
console.log("with context", tab.cookieStoreId);
|
||||
browser.tabs.remove(tabId.id);
|
||||
browser.tabs.move(tab.id, { index: 0 });
|
||||
}
|
||||
for (index = 0; index < tabs.length; index++) {
|
||||
if (index != tabs.length - 1)
|
||||
browser.tabs.remove(tabs[index].id);
|
||||
}
|
||||
}
|
||||
var pins = browser.tabs.query({
|
||||
cookieStoreId: context[0].cookieStoreId,
|
||||
});
|
||||
pins.then(closeOldTab, onError);
|
||||
}
|
||||
if (requestDetails.url.endsWith("xhr1.html")) {
|
||||
hostname = url.split("/")[2];
|
||||
let prefix = url.substr(0, url.indexOf("://") + 3);
|
||||
requestDetails.url = prefix + hostname + "/i2pbote/";
|
||||
}
|
||||
var created = browser.tabs.create({
|
||||
active: true,
|
||||
pinned: true,
|
||||
cookieStoreId: context[0].cookieStoreId,
|
||||
url: requestDetails.url,
|
||||
});
|
||||
created.then(onCreated, onContextError);
|
||||
}
|
||||
var gettab = browser.tabs.get(tabId.id);
|
||||
gettab.then(Create, onContextError);
|
||||
return tabId;
|
||||
}
|
||||
return forceIntoIsolation(tabId, botepref, tab);
|
||||
} catch (error) {
|
||||
console.log("(isolate)Context Error", error);
|
||||
console.error("(isolate)Context Error", error);
|
||||
}
|
||||
};
|
||||
var mailTabFind = async function (tabId) {
|
||||
console.info("(isolate)Context Discovery mail");
|
||||
try {
|
||||
var context = await browser.contextualIdentities.query({
|
||||
name: mailpref,
|
||||
});
|
||||
if (tabId.cookieStoreId != context[0].cookieStoreId) {
|
||||
function Create() {
|
||||
function onCreated(tab) {
|
||||
function closeOldTab(tabs) {
|
||||
if (tabId.id != tab.id) {
|
||||
console.log("(isolate) Closing un-isolated tab", tabId.id);
|
||||
console.log("in favor of", tab.id);
|
||||
console.log("with context", tab.cookieStoreId);
|
||||
browser.tabs.remove(tabId.id);
|
||||
browser.tabs.move(tab.id, { index: 0 });
|
||||
}
|
||||
for (index = 0; index < tabs.length; index++) {
|
||||
if (index != tabs.length - 1)
|
||||
browser.tabs.remove(tabs[index].id);
|
||||
}
|
||||
}
|
||||
var pins = browser.tabs.query({
|
||||
cookieStoreId: context[0].cookieStoreId,
|
||||
});
|
||||
pins.then(closeOldTab, onError);
|
||||
}
|
||||
if (requestDetails.url.endsWith("xhr1.html")) {
|
||||
hostname = url.split("/")[2];
|
||||
let prefix = url.substr(0, url.indexOf("://") + 3);
|
||||
requestDetails.url = prefix + hostname + "/webmail/";
|
||||
}
|
||||
var created = browser.tabs.create({
|
||||
active: true,
|
||||
pinned: true,
|
||||
cookieStoreId: context[0].cookieStoreId,
|
||||
url: requestDetails.url,
|
||||
});
|
||||
created.then(onCreated, onContextError);
|
||||
}
|
||||
var gettab = browser.tabs.get(tabId.id);
|
||||
gettab.then(Create, onContextError);
|
||||
return tabId;
|
||||
}
|
||||
return forceIntoIsolation(tabId, mailpref, tab);
|
||||
} catch (error) {
|
||||
console.log("(isolate)Context Error", error);
|
||||
console.error("(isolate)Context Error", error);
|
||||
}
|
||||
};
|
||||
var ircTabFind = async function (tabId) {
|
||||
console.info("(isolate)Context Discovery irc");
|
||||
try {
|
||||
var context = await browser.contextualIdentities.query({
|
||||
name: ircpref,
|
||||
});
|
||||
if (tabId.cookieStoreId != context[0].cookieStoreId) {
|
||||
if (requestDetails.url.includes(":7669")) {
|
||||
function Create() {
|
||||
function onCreated(tab) {
|
||||
function closeOldTab(tabs) {
|
||||
if (tabId.id != tab.id) {
|
||||
console.log("(isolate) Closing un-isolated tab", tabId.id);
|
||||
console.log("in favor of", tab.id);
|
||||
console.log("with context", tab.cookieStoreId);
|
||||
browser.tabs.remove(tabId.id);
|
||||
browser.tabs.move(tab.id, { index: 0 });
|
||||
}
|
||||
for (index = 0; index < tabs.length; index++) {
|
||||
if (index != tabs.length - 1)
|
||||
browser.tabs.remove(tabs[index].id);
|
||||
}
|
||||
}
|
||||
var pins = browser.tabs.query({
|
||||
cookieStoreId: context[0].cookieStoreId,
|
||||
});
|
||||
pins.then(closeOldTab, onError);
|
||||
}
|
||||
var created = browser.tabs.create({
|
||||
active: true,
|
||||
pinned: true,
|
||||
cookieStoreId: context[0].cookieStoreId,
|
||||
url: requestDetails.url,
|
||||
});
|
||||
created.then(onCreated, onContextError);
|
||||
}
|
||||
var gettab = browser.tabs.get(tabId.id);
|
||||
gettab.then(Create, onContextError);
|
||||
return tabId;
|
||||
}
|
||||
}
|
||||
return forceIntoIsolation(tabId, ircpref, tab);
|
||||
} catch (error) {
|
||||
console.log("(isolate)Context Error", error);
|
||||
console.error("(isolate)Context Error", error);
|
||||
}
|
||||
};
|
||||
var blogTabFind = async function (tabId) {
|
||||
console.info("(isolate)Context Discovery blog");
|
||||
try {
|
||||
var context = await browser.contextualIdentities.query({
|
||||
name: blogpref,
|
||||
});
|
||||
return forceIntoIsolation(tabId, blogpref, tab);
|
||||
} catch (error) {
|
||||
console.error("(isolate)Context Error", error);
|
||||
}
|
||||
};
|
||||
var tabGet = async function (tabId) {
|
||||
@ -540,8 +382,13 @@ var contextSetup = function (requestDetails) {
|
||||
}
|
||||
} else {
|
||||
if (localhost) {
|
||||
var irctab = tab.then(ircTabFind, onContextError);
|
||||
return requestDetails;
|
||||
if (localhost === "blog") {
|
||||
var routertab = tab.then(blogTabFind, onContextError);
|
||||
return requestDetails;
|
||||
} else if (localhost === "irc") {
|
||||
var irctab = tab.then(ircTabFind, onContextError);
|
||||
return requestDetails;
|
||||
}
|
||||
}
|
||||
}
|
||||
// if (oldtab.cookieStoreId == 'firefox-default') {
|
||||
@ -594,19 +441,23 @@ var coolheadersSetup = function (e) {
|
||||
popup.then(gotPopup);
|
||||
}
|
||||
function gotPopup(p) {
|
||||
console.log("(scrub) checking popup", p);
|
||||
if (p.length != 0) return;
|
||||
console.log("(scrub)(header check) checking popup", p);
|
||||
console.log(
|
||||
"(scrub)(header check) checking headers",
|
||||
e.responseHeaders
|
||||
);
|
||||
let headers = e.responseHeaders.filter((word) =>
|
||||
word.name.toUpperCase().includes("I2P")
|
||||
);
|
||||
console.log("(scrub)(header check) checking filtered headers", headers);
|
||||
for (i = headers.length - 1; i >= 0; i--) {
|
||||
let header = headers[i];
|
||||
console.log("(scrub) checking header", header);
|
||||
console.log("(scrub)(header check) checking header", header);
|
||||
if (header.name.toUpperCase().endsWith("I2P-LOCATION")) {
|
||||
var tab = browser.tabs.get(e.tabId);
|
||||
tab.then(altSrc);
|
||||
function altSrc(tab) {
|
||||
console.log("(scrub) X-I2P-LOCATION");
|
||||
console.log("(scrub) X-I2P-LOCATION", header.value);
|
||||
let url = new URL(header.value);
|
||||
browser.pageAction.setPopup({
|
||||
tabId: e.tabId,
|
||||
@ -626,7 +477,10 @@ var coolheadersSetup = function (e) {
|
||||
break;
|
||||
}
|
||||
if (header.name.toUpperCase().endsWith("I2P-TORRENTLOCATION")) {
|
||||
console.log("(scrub) checking header torrentlocation", header);
|
||||
console.log(
|
||||
"(scrub)(header check) checking header torrentlocation",
|
||||
header
|
||||
);
|
||||
var imgs = document.getElementsByTagName("img");
|
||||
for (let img of imgs) {
|
||||
if (tmpsrc.host == location.host) {
|
||||
@ -677,7 +531,7 @@ var coolheadersSetup = function (e) {
|
||||
tabId: e.tabId,
|
||||
popup: "torrent.html",
|
||||
});
|
||||
if (tab.url.startsWith("https")) {
|
||||
if (tab != undefined && tab.url.startsWith("https")) {
|
||||
browser.pageAction.setIcon({
|
||||
path: "icons/infotoopiesbt.png",
|
||||
tabId: e.tabId,
|
||||
@ -704,23 +558,106 @@ var coolheadersSetup = function (e) {
|
||||
};
|
||||
|
||||
function getTabURL(tab) {
|
||||
if (tab.url.startsWith("https")) {
|
||||
browser.pageAction.setPopup({
|
||||
tabId: tab.id,
|
||||
popup: "security.html",
|
||||
});
|
||||
browser.pageAction.setIcon({
|
||||
path: "icons/infotoopies.png",
|
||||
tabId: tab.id,
|
||||
});
|
||||
console.log(tab.url);
|
||||
if (tab.url.includes(".i2p")) {
|
||||
//console.log("(background) tabinfo", tabInfo[0].id)
|
||||
console.log("(scrub)(equiv check) popup check", tab);
|
||||
|
||||
if (tab.id != undefined) {
|
||||
popup = browser.pageAction.getPopup({ tabId: tab.id });
|
||||
console.log("(scrub)(equiv check) popup check");
|
||||
popup.then(gotPopup);
|
||||
}
|
||||
function gotPopup(p) {
|
||||
if (p.length != 0) return;
|
||||
if (tab.url.startsWith("https")) {
|
||||
if (tab.url.includes(".i2p")) {
|
||||
browser.pageAction.setPopup({
|
||||
tabId: tab.id,
|
||||
popup: "security.html",
|
||||
});
|
||||
browser.pageAction.setIcon({
|
||||
path: "icons/infotoopies.png",
|
||||
tabId: tab.id,
|
||||
});
|
||||
console.log(tab.url);
|
||||
//console.log("(background) tabinfo", tabInfo[0].id)
|
||||
try {
|
||||
browser.tabs
|
||||
.sendMessage(tab.id, { req: "i2p-torrentlocation" })
|
||||
.then((response) => {
|
||||
if (response != undefined && response != "") {
|
||||
console.log(
|
||||
"(scrub)(equiv check) i2p-torrentlocation response object",
|
||||
response
|
||||
);
|
||||
if (response.content.toUpperCase() != "NO-ALT-LOCATION") {
|
||||
browser.pageAction.setPopup({
|
||||
tabId: tab.id,
|
||||
popup: "torrent.html",
|
||||
});
|
||||
browser.pageAction.setIcon({
|
||||
path: "icons/infotoopiesbt.png",
|
||||
tabId: tab.id,
|
||||
});
|
||||
browser.pageAction.setTitle({
|
||||
tabId: tab.id,
|
||||
title: response.content,
|
||||
});
|
||||
browser.pageAction.show(tab.id);
|
||||
}
|
||||
}
|
||||
});
|
||||
console.log("(scrub)(equiv check)", tab.id, tab.url);
|
||||
} catch (e) {
|
||||
console.log("(scrub)(equiv check)", e);
|
||||
}
|
||||
} else {
|
||||
try {
|
||||
browser.tabs
|
||||
.sendMessage(tab.id, { req: "i2p-location" })
|
||||
.then((response) => {
|
||||
if (response != undefined) {
|
||||
console.log(
|
||||
"(scrub)(equiv check) i2p-location response object",
|
||||
response
|
||||
);
|
||||
if (response.content.toUpperCase() != "NO-ALT-LOCATION") {
|
||||
browser.pageAction.setPopup({
|
||||
tabId: tab.id,
|
||||
popup: "location.html",
|
||||
});
|
||||
browser.pageAction.setIcon({
|
||||
path: "icons/i2plogo.png",
|
||||
tabId: tab.id,
|
||||
});
|
||||
browser.pageAction.setTitle({
|
||||
tabId: tab.id,
|
||||
title: response.content,
|
||||
});
|
||||
browser.pageAction.show(tab.id);
|
||||
}
|
||||
}
|
||||
});
|
||||
console.log("(scrub)(equiv check)", tab.id, tab.url);
|
||||
} catch (e) {
|
||||
console.log("(scrub)(equiv check)", e);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (tab.url.includes(".i2p")) {
|
||||
browser.pageAction.setPopup({
|
||||
tabId: tab.id,
|
||||
popup: "security.html",
|
||||
});
|
||||
browser.pageAction.setIcon({
|
||||
path: "icons/infotoopie.png",
|
||||
tabId: tab.id,
|
||||
});
|
||||
console.log(tab.url);
|
||||
}
|
||||
try {
|
||||
browser.tabs
|
||||
.sendMessage(tab.id, { req: "i2p-torrentlocation" })
|
||||
.then((response) => {
|
||||
if (response != undefined && response != "") {
|
||||
if (response != undefined) {
|
||||
console.log(
|
||||
"(pageaction) i2p-torrentlocation response object",
|
||||
response
|
||||
@ -731,7 +668,7 @@ function getTabURL(tab) {
|
||||
popup: "torrent.html",
|
||||
});
|
||||
browser.pageAction.setIcon({
|
||||
path: "icons/infotoopiesbt.png",
|
||||
path: "icons/infotoopiebt.png",
|
||||
tabId: tab.id,
|
||||
});
|
||||
browser.pageAction.setTitle({
|
||||
@ -746,79 +683,6 @@ function getTabURL(tab) {
|
||||
} catch (e) {
|
||||
console.log("(pageaction)", e);
|
||||
}
|
||||
} else {
|
||||
try {
|
||||
browser.tabs
|
||||
.sendMessage(tab.id, { req: "i2p-location" })
|
||||
.then((response) => {
|
||||
if (response != undefined) {
|
||||
console.log(
|
||||
"(pageaction) i2p-location response object",
|
||||
response
|
||||
);
|
||||
if (response.content.toUpperCase() != "NO-ALT-LOCATION") {
|
||||
browser.pageAction.setPopup({
|
||||
tabId: tab.id,
|
||||
popup: "location.html",
|
||||
});
|
||||
browser.pageAction.setIcon({
|
||||
path: "icons/i2plogo.png",
|
||||
tabId: tab.id,
|
||||
});
|
||||
browser.pageAction.setTitle({
|
||||
tabId: tab.id,
|
||||
title: response.content,
|
||||
});
|
||||
browser.pageAction.show(tab.id);
|
||||
}
|
||||
}
|
||||
});
|
||||
console.log("(pageaction)", tab.id, tab.url);
|
||||
} catch (e) {
|
||||
console.log("(pageaction)", e);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (tab.url.includes(".i2p")) {
|
||||
browser.pageAction.setPopup({
|
||||
tabId: tab.id,
|
||||
popup: "security.html",
|
||||
});
|
||||
browser.pageAction.setIcon({
|
||||
path: "icons/infotoopie.png",
|
||||
tabId: tab.id,
|
||||
});
|
||||
console.log(tab.url);
|
||||
}
|
||||
try {
|
||||
browser.tabs
|
||||
.sendMessage(tab.id, { req: "i2p-torrentlocation" })
|
||||
.then((response) => {
|
||||
if (response != undefined) {
|
||||
console.log(
|
||||
"(pageaction) i2p-torrentlocation response object",
|
||||
response
|
||||
);
|
||||
if (response.content.toUpperCase() != "NO-ALT-LOCATION") {
|
||||
browser.pageAction.setPopup({
|
||||
tabId: tab.id,
|
||||
popup: "torrent.html",
|
||||
});
|
||||
browser.pageAction.setIcon({
|
||||
path: "icons/infotoopiebt.png",
|
||||
tabId: tab.id,
|
||||
});
|
||||
browser.pageAction.setTitle({
|
||||
tabId: tab.id,
|
||||
title: response.content,
|
||||
});
|
||||
browser.pageAction.show(tab.id);
|
||||
}
|
||||
}
|
||||
});
|
||||
console.log("(pageaction)", tab.id, tab.url);
|
||||
} catch (e) {
|
||||
console.log("(pageaction)", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
BIN
susimail.png
Before Width: | Height: | Size: 162 KiB After Width: | Height: | Size: 65 KiB |
BIN
toopie.png
Before Width: | Height: | Size: 68 KiB After Width: | Height: | Size: 133 KiB |
@ -1,4 +1,4 @@
|
||||
Acknowledgement
|
||||
Acknowledgementindex
|
||||
===============
|
||||
|
||||
**Many, many thanks to the [Transmitter](https://github.com/myfreeweb/transmitter)
|
||||
@ -33,7 +33,7 @@ To install the plugin, go to [http://127.0.0.1:7657/configplugins](http://127.0.
|
||||
and scroll down to the section of the page where it says "Installation from URL"
|
||||
and paste the following URL:
|
||||
|
||||
```http://stats.i2p/i2p/plugins/i2psnark-rpc.su3```
|
||||
`http://stats.i2p/i2p/plugins/i2psnark-rpc.su3`
|
||||
|
||||
Click the "Install Plugin" button and you'll be ready to go. Now, open the
|
||||
extension options menu, and just click "Save." The defaults are correct for use
|
||||
|
@ -126,20 +126,23 @@ function createContextMenu() {
|
||||
});
|
||||
}
|
||||
|
||||
createContextMenu();
|
||||
|
||||
browser.contextMenus.onClicked.addListener((info, tab) => {
|
||||
if (info.menuItemId === "transmitter-add") {
|
||||
return addUrl(info.linkUrl);
|
||||
} else if (info.menuItemId.startsWith("transmitter-add-loc-")) {
|
||||
let index = parseInt(info.menuItemId.substr("transmitter-add-loc-".length));
|
||||
browser.storage.local.get("server").then(({ server }) => {
|
||||
let path = server.locations[index].path;
|
||||
addUrl(info.linkUrl, path);
|
||||
});
|
||||
}
|
||||
});
|
||||
if (browser.windows != undefined) {
|
||||
createContextMenu();
|
||||
|
||||
browser.contextMenus.onClicked.addListener((info, tab) => {
|
||||
if (info.menuItemId === "transmitter-add") {
|
||||
return addUrl(info.linkUrl);
|
||||
} else if (info.menuItemId.startsWith("transmitter-add-loc-")) {
|
||||
let index = parseInt(
|
||||
info.menuItemId.substr("transmitter-add-loc-".length)
|
||||
);
|
||||
browser.storage.local.get("server").then(({ server }) => {
|
||||
let path = server.locations[index].path;
|
||||
addUrl(info.linkUrl, path);
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
////// Badge
|
||||
|
||||
function updateBadge() {
|
||||
|
@ -6,7 +6,7 @@
|
||||
<link rel="stylesheet" type="text/css" href="../sidebar.css" />
|
||||
</head>
|
||||
<body>
|
||||
<h1>Acknowledgement</h1>
|
||||
<h1>Acknowledgementindex</h1>
|
||||
|
||||
<p><strong>Many, many thanks to the <a href="https://github.com/myfreeweb/transmitter">Transmitter</a>
|
||||
webextension.</strong></p>
|
||||
|
Before Width: | Height: | Size: 165 KiB After Width: | Height: | Size: 80 KiB |
10
window.html
@ -29,8 +29,8 @@
|
||||
|
||||
<div class="topnav">
|
||||
<a class="applicationName window-visit-homepage" href="#" id="window-visit-homepage" target="_blank">Home Page</a>
|
||||
<form action="http://yacy.idk.i2p/yacysearch.html?" method="get">
|
||||
<input id="search-query" name="query" placeholder="Search on yacy.idk.i2p(Opens a new tab)" type="search"> <input id="search-submit" text="Submit" type="submit">
|
||||
<form action="http://legwork.i2p/yacysearch.html?" method="get">
|
||||
<input id="search-query" name="query" placeholder="Search on legwork.i2p(Opens a new tab)" type="search"> <input id="search-submit" text="Submit" type="submit">
|
||||
</form>
|
||||
</div>
|
||||
|
||||
@ -84,9 +84,9 @@
|
||||
<p id="applicationExplain">These applications use I2P to provide them with security and privacy.</p>
|
||||
|
||||
<ul>
|
||||
<li class="application"><button class="applicationName window-visit-homepage" href="#" id="window-visit-index" target="_blank">Help Page</button> <span class="applicationDesc" id="abouthome">For more information about this extension, go here:</span></li>
|
||||
<li class="application"><button class="applicationName window-visit-help" href="#" id="window-visit-help" target="_blank">Help Page</button> <span class="applicationDesc" id="abouthome">For more information about this extension, go here:</span></li>
|
||||
|
||||
<li class="application"><button class="applicationName window-visit-toopie" href="#" id="window-visit-toopie" target="_blank">Toopie</button> <span class="applicationDesc" id="toopie">For information about your I2P router status, go here:</span></li>
|
||||
<li class="application window-visit-toopie"><button class="applicationName window-visit-toopie" href="#" id="window-visit-toopie" target="_blank">Toopie</button> <span class="applicationDesc window-visit-toopie" id="toopie">For information about your I2P router status, go here:</span></li>
|
||||
|
||||
<li class="application"><button class="applicationName" id="window-visit-i2ptunnel" target="_blank">Hidden Services Manager</button> <span class="applicationDesc" id="i2ptunnel">I2P has a web-based interface for configuring .i2p services like web sites, to set up your own web sites, go here:</span></li>
|
||||
|
||||
@ -113,6 +113,8 @@
|
||||
<br>
|
||||
The server address is not set yet.
|
||||
<br>
|
||||
<a class="torrent-opener" href="#" id="window-visit-torrent">For assistance, visit the torrent help page</a>.
|
||||
<br>
|
||||
<a class="config-opener" href="#">Open the settings</a> to continue.
|
||||
</div>
|
||||
|
||||
|
Before Width: | Height: | Size: 449 KiB After Width: | Height: | Size: 237 KiB |