Compare commits
139 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
4e30e1c613 | ||
![]() |
907a9e7d20 | ||
![]() |
ec7655bfa9 | ||
![]() |
a84f29d9f1 | ||
![]() |
de8eb976db | ||
![]() |
24fd8a98c3 | ||
![]() |
a06b349d5f | ||
![]() |
855febc1b4 | ||
![]() |
e49f7a7daf | ||
![]() |
2e9ae83daa | ||
![]() |
c222b4ed0b | ||
![]() |
493b1e3cfb | ||
![]() |
85aad86268 | ||
![]() |
7946b7592f | ||
![]() |
e79b6c7d22 | ||
![]() |
461ec921b2 | ||
![]() |
7169018292 | ||
![]() |
3dbce313a0 | ||
![]() |
db6c275321 | ||
![]() |
e2b631fafa | ||
![]() |
95ed7cb751 | ||
![]() |
e20f0d8552 | ||
![]() |
8b44325565 | ||
![]() |
4f8db01542 | ||
![]() |
e245aff6bd | ||
![]() |
7501f4c1a5 | ||
![]() |
9b02651985 | ||
![]() |
e04db247e8 | ||
![]() |
4e30e1077b | ||
![]() |
040b57781e | ||
![]() |
07ca54a885 | ||
![]() |
e125b77d11 | ||
![]() |
851e3854a7 | ||
![]() |
0d414130a7 | ||
![]() |
25a7b523f9 | ||
![]() |
3d0b7db6dc | ||
![]() |
2e8727a309 | ||
![]() |
01fbf32acd | ||
![]() |
e2642553b5 | ||
![]() |
d04709e3a5 | ||
![]() |
10dd0af335 | ||
![]() |
b33a7b623b | ||
![]() |
55841f8421 | ||
![]() |
303bd90d84 | ||
![]() |
274eb1a98b | ||
![]() |
4e544dd9e4 | ||
![]() |
6fe1bc3fb5 | ||
![]() |
4897ceff7f | ||
![]() |
8551a13494 | ||
![]() |
064ec504b5 | ||
![]() |
16c9fbb19f | ||
![]() |
ca58d2e307 | ||
![]() |
fc89fe9ada | ||
![]() |
d6ece55d71 | ||
![]() |
ff9a1484b0 | ||
![]() |
70e3bee4da | ||
![]() |
cd25d95fdf | ||
![]() |
65c914a9d0 | ||
![]() |
c0bb7e234d | ||
![]() |
3fefc88a38 | ||
![]() |
5a5cc51536 | ||
![]() |
25ec2d58c1 | ||
![]() |
f896f6ef92 | ||
![]() |
e10d96905b | ||
![]() |
9e015c51ef | ||
![]() |
ff9ba99476 | ||
![]() |
ce4ec0cdfc | ||
![]() |
5b9c706cc9 | ||
![]() |
2aba15f280 | ||
![]() |
fd5364ab8e | ||
![]() |
08639cbf43 | ||
![]() |
52ba8fa837 | ||
![]() |
2b69ff05cf | ||
![]() |
6a8a9039c9 | ||
![]() |
3a52c4e2a6 | ||
![]() |
2fb1d71ae9 | ||
![]() |
185467937c | ||
![]() |
64c5c05b82 | ||
![]() |
4615513bb2 | ||
![]() |
3b63ba945d | ||
![]() |
1911641cd0 | ||
![]() |
e18eeaf934 | ||
![]() |
ea92d4a5b8 | ||
![]() |
51cc8c96e1 | ||
![]() |
12fff599f0 | ||
![]() |
30231ab974 | ||
![]() |
1362ca32d9 | ||
![]() |
0c64c301c9 | ||
![]() |
38147d45e1 | ||
![]() |
093db8443c | ||
![]() |
56a220136b | ||
![]() |
e903349e4c | ||
![]() |
175683a8ed | ||
![]() |
d7449a5e8a | ||
![]() |
3bcbfc1e58 | ||
![]() |
13210031e6 | ||
![]() |
5a2acc1c1c | ||
![]() |
4aed7e0db4 | ||
![]() |
f4d2334900 | ||
![]() |
7902aded0a | ||
![]() |
256a990ebc | ||
![]() |
ff883a2a9a | ||
![]() |
d1943b4262 | ||
![]() |
c96ec6c3b7 | ||
![]() |
6467ea6f63 | ||
![]() |
352d71af26 | ||
![]() |
ab7774ea29 | ||
![]() |
4e00c72d5f | ||
![]() |
acd7adc9c1 | ||
![]() |
94f0124f0f | ||
![]() |
89523390de | ||
![]() |
77f57d7f1e | ||
![]() |
a33afc52d3 | ||
![]() |
b06facacb0 | ||
![]() |
bd4c9c0658 | ||
![]() |
b23b90baa1 | ||
![]() |
5b6224f9ce | ||
![]() |
232ada5ed3 | ||
![]() |
2fab8e042f | ||
![]() |
749ff30b5b | ||
![]() |
f0b4a0a849 | ||
![]() |
870eaa6e3e | ||
![]() |
c7af1a0d72 | ||
![]() |
4c10cd2855 | ||
![]() |
6f45363692 | ||
![]() |
8d14c945f3 | ||
![]() |
070955225d | ||
![]() |
9987325f1a | ||
![]() |
2bbeed8385 | ||
![]() |
875fe8b86d | ||
![]() |
b2184119f7 | ||
![]() |
cb5fa75616 | ||
![]() |
5c7a80997f | ||
![]() |
32035348c1 | ||
![]() |
049b79753e | ||
![]() |
25c24757d4 | ||
![]() |
2d17f4fb0f | ||
![]() |
916ee81668 | ||
![]() |
1dd48e4344 |
13
.eslintrc.js
13
.eslintrc.js
@@ -50,7 +50,7 @@ module.exports = {
|
||||
curly: "error",
|
||||
"default-case": "error",
|
||||
"default-param-last": "error",
|
||||
"dot-location": "error",
|
||||
"dot-location": "off",
|
||||
"dot-notation": "off",
|
||||
"eol-last": "error",
|
||||
eqeqeq: "off",
|
||||
@@ -59,7 +59,7 @@ module.exports = {
|
||||
"func-names": "off",
|
||||
"func-style": "off",
|
||||
"function-call-argument-newline": ["error", "consistent"],
|
||||
"function-paren-newline": "error",
|
||||
"function-paren-newline": "off",
|
||||
"generator-star-spacing": "error",
|
||||
"global-require": "error",
|
||||
"guard-for-in": "error",
|
||||
@@ -88,7 +88,7 @@ module.exports = {
|
||||
"max-classes-per-file": "error",
|
||||
"max-depth": "error",
|
||||
"max-len": "error",
|
||||
"max-lines": "error",
|
||||
"max-lines": "off",
|
||||
"max-lines-per-function": "off",
|
||||
"max-nested-callbacks": "error",
|
||||
"max-params": "error",
|
||||
@@ -96,7 +96,7 @@ module.exports = {
|
||||
"max-statements-per-line": "error",
|
||||
"multiline-comment-style": ["error", "bare-block"],
|
||||
"multiline-ternary": "error",
|
||||
"new-cap": "error",
|
||||
"new-cap": "off",
|
||||
"new-parens": "error",
|
||||
"newline-after-var": "off",
|
||||
"newline-before-return": "off",
|
||||
@@ -127,7 +127,7 @@ module.exports = {
|
||||
"no-implied-eval": "error",
|
||||
"no-import-assign": "error",
|
||||
"no-inline-comments": "error",
|
||||
"no-inner-declarations": ["error", "functions"],
|
||||
"no-inner-declarations": "off",
|
||||
"no-invalid-this": "error",
|
||||
"no-iterator": "error",
|
||||
"no-label-var": "error",
|
||||
@@ -182,6 +182,7 @@ module.exports = {
|
||||
"no-unmodified-loop-condition": "error",
|
||||
"no-unneeded-ternary": "error",
|
||||
"no-unused-expressions": "error",
|
||||
"no-unused-vars": "off",
|
||||
"no-use-before-define": "off",
|
||||
"no-useless-call": "error",
|
||||
"no-useless-computed-key": "error",
|
||||
@@ -195,7 +196,7 @@ module.exports = {
|
||||
"no-whitespace-before-property": "error",
|
||||
"nonblock-statement-body-position": "error",
|
||||
"object-curly-newline": "error",
|
||||
"object-curly-spacing": "error",
|
||||
"object-curly-spacing": "off",
|
||||
"object-property-newline": "error",
|
||||
"object-shorthand": "error",
|
||||
"one-var": "off",
|
||||
|
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1,2 +1,3 @@
|
||||
README.md.asc
|
||||
node_modules/
|
||||
web-ext-artifacts
|
||||
|
146
Makefile
146
Makefile
@@ -15,6 +15,8 @@ install: uninstall
|
||||
cp ./*.css $(PREFIX)/share/webext/i2ppb@eyedeekay.github.io/
|
||||
cp ./*.md $(PREFIX)/share/webext/i2ppb@eyedeekay.github.io/
|
||||
cp ./*.xpi $(PREFIX)/share/webext/i2ppb@eyedeekay.github.io/
|
||||
cp ./*.png $(PREFIX)/share/webext/i2ppb@eyedeekay.github.io/
|
||||
cp ./*.torrent $(PREFIX)/share/webext/i2ppb@eyedeekay.github.io/
|
||||
cp ./manifest.json $(PREFIX)/share/webext/i2ppb@eyedeekay.github.io/
|
||||
cp ./LICENSE $(PREFIX)/share/webext/i2ppb@eyedeekay.github.io/
|
||||
ln -s $(PREFIX)/share/webext/i2ppb@eyedeekay.github.io \
|
||||
@@ -36,8 +38,8 @@ clean:
|
||||
## EVEN RELEASES are AMO RELEASES
|
||||
## ODD RELEASES are SELFHOSTED RELEASES
|
||||
|
||||
MOZ_VERSION=0.46
|
||||
VERSION=0.47
|
||||
MOZ_VERSION=0.56
|
||||
VERSION=0.57
|
||||
#VERSION=$(MOZ_VERSION)
|
||||
#VERSION=1.27
|
||||
|
||||
@@ -60,7 +62,22 @@ amo-readme:
|
||||
sed 's|</h2>|</strong>|g' | \
|
||||
sed 's|<h3>|<strong>|g' | \
|
||||
sed 's|</h3>|</strong>|g' | \
|
||||
grep -v '<img' > index.html
|
||||
grep -v '<img' > amo-index.html
|
||||
|
||||
MAGNET=`torrent2magnet i2ppb@eyedeekay.github.io.xpi.torrent`
|
||||
|
||||
index:
|
||||
@echo "<!DOCTYPE html>" > index.html
|
||||
@echo "<html>" >> index.html
|
||||
@echo "<head>" >> index.html
|
||||
@echo " <title>I2P in Private Browsing Mode</title>" >> index.html
|
||||
@echo " <link rel=\"stylesheet\" type=\"text/css\" href =\"home.css\" />" >> index.html
|
||||
@echo "</head>" >> index.html
|
||||
@echo "<body>" >> index.html
|
||||
sed "s|magnetsub|[Magnet Link]($(MAGNET))|g" README.md | markdown >> index.html
|
||||
@echo "</body>" >> index.html
|
||||
@echo "</html>" >> index.html
|
||||
|
||||
|
||||
xpi:
|
||||
#wget -O ../i2ppb@eyedeekay.github.io.xpi \
|
||||
@@ -69,10 +86,19 @@ xpi:
|
||||
cp ~/Downloads/i2p_in_private_browsing-$(VERSION)-an+fx.xpi ./i2ppb@eyedeekay.github.io.xpi
|
||||
|
||||
version:
|
||||
sed -i 's|7647|7657|g' *.js* */*.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
|
||||
|
||||
moz-version:
|
||||
sed -i 's|7647|7657|g' *.js* */*.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
|
||||
|
||||
rhz-version:
|
||||
sed -i 's|$(shell grep "\"version\": " manifest.json)| \"version\": \"$(VERSION)1\",|g' manifest.json
|
||||
sed -i 's|$(shell grep "\"version_name\": " manifest.json)| \"version_name\": \"$(VERSION)1-rhizome\",|g' manifest.json
|
||||
sed -i 's|7657|7647|g' *.js* */*.js*
|
||||
|
||||
zip: version
|
||||
zip --exclude="./i2ppb@eyedeekay.github.io.xpi" \
|
||||
@@ -83,18 +109,22 @@ zip: version
|
||||
--exclude="./package-lock.json" \
|
||||
--exclude="./.node_modules" \
|
||||
--exclude="./node_modules" \
|
||||
--exclude="./.git" -r -FS ../i2psetproxy.js.zip *
|
||||
--exclude="./.git" \
|
||||
--exclude="*/*.xpi" \
|
||||
--exclude="web-ext-artifacts" \
|
||||
--exclude="./*.pdf" -r -FS ../i2psetproxy.js.zip *
|
||||
|
||||
release:
|
||||
cat desc debian/changelog | gothub release -p -u eyedeekay -r i2psetproxy.js -t $(VERSION) -n $(VERSION) -d -
|
||||
cat desc debian/changelog | gothub release -p -u eyedeekay -r I2P-in-Private-Browsing-Mode-Firefox -t $(VERSION) -n $(VERSION) -d -; true
|
||||
|
||||
delete-release:
|
||||
gothub delete -u eyedeekay -r i2psetproxy.js -t $(VERSION); true
|
||||
gothub delete -u eyedeekay -r I2P-in-Private-Browsing-Mode-Firefox -t $(VERSION); true
|
||||
|
||||
recreate-release: delete-release release upload
|
||||
|
||||
upload: upload-xpi upload-deb
|
||||
|
||||
full-release: release submit deb upload torrent upload-torrent
|
||||
|
||||
WEB_EXT_API_KEY=AMO_KEY
|
||||
WEB_EXT_API_SECRET=AMO_SECRET
|
||||
@@ -105,14 +135,22 @@ WEB_EXT_API_SECRET=AMO_SECRET
|
||||
tk:
|
||||
echo $(WEB_EXT_API_KEY)
|
||||
|
||||
submit: moz-sign moz-submit
|
||||
submit: moz-sign rhz-submit moz-submit
|
||||
|
||||
clean-artifacts:
|
||||
rm -fr web-ext-artifacts/*
|
||||
|
||||
##ODD NUMBERED, SELF-DISTRIBUTED VERSIONS HERE!
|
||||
moz-sign: version
|
||||
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."
|
||||
web-ext sign --channel unlisted --config-discovery false --api-key $(WEB_EXT_API_KEY) --api-secret $(WEB_EXT_API_SECRET); true
|
||||
web-ext-submit --channel unlisted --config-discovery false --api-key $(WEB_EXT_API_KEY) --api-secret $(WEB_EXT_API_SECRET); true
|
||||
make copyss
|
||||
sleep 5
|
||||
|
||||
copyss:
|
||||
cp web-ext-artifacts/*.xpi ./i2ppb@eyedeekay.github.io.xpi; true
|
||||
|
||||
##EVEN NUMBERED, MOZILLA-DISTRIBUTED VERSIONS HERE!
|
||||
moz-submit: moz-version
|
||||
@@ -120,35 +158,102 @@ moz-submit: moz-version
|
||||
@echo "requires a JWT API Key and Secret from addons.mozilla.org to be made available"
|
||||
@echo "to the Makefile under the variables WEB_EXT_API_KEY and WEB_EXT_API_SECRET."
|
||||
web-ext sign --channel listed --config-discovery false --api-key $(WEB_EXT_API_KEY) --api-secret $(WEB_EXT_API_SECRET); true
|
||||
sleep 5
|
||||
|
||||
rhz-submit: rhz-version
|
||||
@echo "Rhizome releases are disabled while browser is completed."
|
||||
#@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."
|
||||
#web-ext-submit --channel unlisted --config-discovery false --api-key $(WEB_EXT_API_KEY) --api-secret $(WEB_EXT_API_SECRET); true
|
||||
#cp web-ext-artifacts/*.xpi ./i2ppb@eyedeekay.github.io.xpi
|
||||
|
||||
getxpi:
|
||||
gothub download -t $(VERSION) -u eyedeekay -r I2P-in-Private-Browsing-Mode-Firefox -n "i2ppb@eyedeekay.github.io.xpi"
|
||||
|
||||
torrent: getxpi
|
||||
mktorrent -a http://zviyq72xcmjupynn5y2f5qa3u7bxyu34jnqmwt6czte2l7idxm7q.b32.i2p/announce \
|
||||
-a http://s5ikrdyjwbcgxmqetxb3nyheizftms7euacuub2hic7defkh3xhq.b32.i2p/a \
|
||||
-a http://uajd4nctepxpac4c4bdyrdw7qvja2a5u3x25otfhkptcjgd53ioq.b32.i2p/announce \
|
||||
-a http://w7tpbzncbcocrqtwwm3nezhnnsw4ozadvi2hmvzdhrqzfxfum7wa.b32.i2p/a \
|
||||
-a http://explodie.org:6969/announce \
|
||||
-a http://tracker.opentrackr.org:1337/announce \
|
||||
-a http://tracker.kamigami.org:2710/announce \
|
||||
-a http://tracker.internetwarriors.net:1337/announce \
|
||||
-a http://tracker.darli.net:6611/announce \
|
||||
-a http://tracker.corpscorp.online:80/announce \
|
||||
-a http://tracker.bz:80/announce \
|
||||
-a http://tracker.bt4g.com:2095/announce \
|
||||
-a http://retracker.sevstar.net:2710/announce \
|
||||
-a http://h4.trakx.nibba.trade:80/announce \
|
||||
-a http://www.proxmox.com:6969/announce \
|
||||
-a http://www.loushao.net:8080/announce \
|
||||
-a http://vps02.net.orel.ru:80/announce \
|
||||
-a http://tracker4.itzmx.com:2710/announce \
|
||||
-a http://tracker3.itzmx.com:6961/announce \
|
||||
-a http://tracker2.itzmx.com:6961/announce \
|
||||
-a http://tracker1.itzmx.com:8080/announce \
|
||||
-a http://tracker01.loveapp.com:6789/announce \
|
||||
-a http://tracker.zerobytes.xyz:1337/announce \
|
||||
-a http://tracker.yoshi210.com:6969/announce \
|
||||
-a http://tracker.torrentyorg.pl:80/announce \
|
||||
-a http://tracker.nyap2p.com:8080/announce \
|
||||
-a http://tracker.lelux.fi:80/announce \
|
||||
-a http://tracker.gbitt.info:80/announce \
|
||||
-a http://pow7.com:80/announce \
|
||||
-a http://opentracker.i2p.rocks:6969/announce \
|
||||
-a http://open.acgtracker.com:1096/announce \
|
||||
-a http://open.acgnxtracker.com:80/announce \
|
||||
-a http://mail2.zelenaya.net:80/announce \
|
||||
-a http://acg.rip:6699/announce \
|
||||
-n "./i2ppb-$(VERSION)@eyedeekay.github.io.xpi" \
|
||||
-o "./i2ppb-$(VERSION)@eyedeekay.github.io.xpi.torrent" \
|
||||
-w https://github.com/eyedeekay/I2P-in-Private-Browsing-Mode-Firefox/releases/download/$(VERSION)/i2ppb@eyedeekay.github.io.xpi \
|
||||
i2ppb@eyedeekay.github.io.xpi
|
||||
ln -sf "./i2ppb-$(VERSION)@eyedeekay.github.io.xpi.torrent" "./i2ppb@eyedeekay.github.io.xpi.torrent"
|
||||
|
||||
upload-torrent:
|
||||
gothub upload -R -u eyedeekay -r I2P-in-Private-Browsing-Mode-Firefox -t $(VERSION) -n "i2ppb@eyedeekay.github.io.xpi.torrent" -f "./i2ppb-$(VERSION)@eyedeekay.github.io.xpi.torrent"
|
||||
|
||||
upload-xpi:
|
||||
gothub upload -R -u eyedeekay -r i2psetproxy.js -t $(VERSION) -n "i2ppb@eyedeekay.github.io.xpi" -f "./i2ppb@eyedeekay.github.io.xpi"
|
||||
gothub upload -R -u eyedeekay -r I2P-in-Private-Browsing-Mode-Firefox -t $(VERSION) -n "i2ppb@eyedeekay.github.io.xpi" -f "./i2ppb@eyedeekay.github.io.xpi"
|
||||
|
||||
upload-deb:
|
||||
gothub upload -R -u eyedeekay -r i2psetproxy.js -t $(VERSION) -n "i2psetproxy.js_$(VERSION)-1_amd64.deb" -f "../i2psetproxy.js_$(VERSION)-1_amd64.deb"
|
||||
gothub upload -R -u eyedeekay -r i2psetproxy.js -t $(VERSION) -n "i2psetproxy.js_$(VERSION).orig.tar.gz" -f "../i2psetproxy.js_$(VERSION).orig.tar.gz"
|
||||
gothub upload -R -u eyedeekay -r i2psetproxy.js -t $(VERSION) -n "i2psetproxy.js_$(VERSION)-1.debian.tar.xz" -f "../i2psetproxy.js_$(VERSION)-1.debian.tar.xz"
|
||||
gothub upload -R -u eyedeekay -r i2psetproxy.js -t $(VERSION) -n "i2psetproxy.js_$(VERSION)-1.dsc" -f "../i2psetproxy.js_$(VERSION)-1.dsc"
|
||||
gothub upload -R -u eyedeekay -r i2psetproxy.js -t $(VERSION) -n "i2psetproxy.js_$(VERSION)-1_amd64.changes" -f "../i2psetproxy.js_$(VERSION)-1_amd64.changes"
|
||||
gothub upload -R -u eyedeekay -r i2psetproxy.js -t $(VERSION) -n "i2psetproxy.js_$(VERSION)-1_amd64.buildinfo" -f "../i2psetproxy.js_$(VERSION)-1_amd64.buildinfo"
|
||||
gothub upload -R -u eyedeekay -r I2P-in-Private-Browsing-Mode-Firefox -t $(VERSION) -n "i2psetproxy.js_$(VERSION)-1_amd64.deb" -f "../i2psetproxy.js_$(VERSION)-1_amd64.deb"
|
||||
gothub upload -R -u eyedeekay -r I2P-in-Private-Browsing-Mode-Firefox -t $(VERSION) -n "i2psetproxy.js_$(VERSION).orig.tar.gz" -f "../i2psetproxy.js_$(VERSION).orig.tar.gz"
|
||||
gothub upload -R -u eyedeekay -r I2P-in-Private-Browsing-Mode-Firefox -t $(VERSION) -n "i2psetproxy.js_$(VERSION)-1.debian.tar.xz" -f "../i2psetproxy.js_$(VERSION)-1.debian.tar.xz"
|
||||
gothub upload -R -u eyedeekay -r I2P-in-Private-Browsing-Mode-Firefox -t $(VERSION) -n "i2psetproxy.js_$(VERSION)-1.dsc" -f "../i2psetproxy.js_$(VERSION)-1.dsc"
|
||||
gothub upload -R -u eyedeekay -r I2P-in-Private-Browsing-Mode-Firefox -t $(VERSION) -n "i2psetproxy.js_$(VERSION)-1_amd64.changes" -f "../i2psetproxy.js_$(VERSION)-1_amd64.changes"
|
||||
gothub upload -R -u eyedeekay -r I2P-in-Private-Browsing-Mode-Firefox -t $(VERSION) -n "i2psetproxy.js_$(VERSION)-1_amd64.buildinfo" -f "../i2psetproxy.js_$(VERSION)-1_amd64.buildinfo"
|
||||
|
||||
upload-docs:
|
||||
gothub release -p -u eyedeekay -r I2P-in-Private-Browsing-Mode-Firefox -t docs -n "Documentation" -d "PDF's and text about the extension"; true
|
||||
gothub upload -R -u eyedeekay -r I2P-in-Private-Browsing-Mode-Firefox -t docs -n "Landing Page Documentation.pdf" -f ../smartlander.pdf
|
||||
gothub upload -R -u eyedeekay -r I2P-in-Private-Browsing-Mode-Firefox -t docs -n "Browser Design Documentation.pdf" -f ../browser.pdf
|
||||
|
||||
fmt:
|
||||
cleancss -O1 all -O2 all --format beautify home.css -o .home.css && mv .home.css home.css
|
||||
cleancss -O1 all -O2 all --format beautify info.css -o .info.css && mv .info.css info.css
|
||||
#find . -path ./node_modules -prune -o -name '*.css' -exec cleancss -O1 --format beautify {} \;
|
||||
find . -path ./node_modules -prune -o -name '*.js' -exec prettier --write {} \;
|
||||
find . -path ./node_modules -prune -o -name '*.json' -exec prettier --write {} \;
|
||||
|
||||
lint:
|
||||
eslint --fix *.js
|
||||
eslint --color *.js
|
||||
|
||||
deborig:
|
||||
deborig: fmt version
|
||||
rm -rf ../i2psetproxy.js-$(VERSION)
|
||||
cp -r . ../i2psetproxy.js-$(VERSION)
|
||||
cd ../i2psetproxy.js-$(VERSION) && \
|
||||
rm -rf web-ext-artifacts && \
|
||||
tar \
|
||||
-cvz \
|
||||
--exclude=.git \
|
||||
--exclude=i2psetproxy.js.gif \
|
||||
--exclude=node_modules \
|
||||
--exclude=web-ext-artifacts \
|
||||
--exclude=*.xpi \
|
||||
--exclude=*/*.xpi \
|
||||
--exclude=*.pdf \
|
||||
-f ../i2psetproxy.js_$(VERSION).orig.tar.gz \
|
||||
.
|
||||
|
||||
@@ -156,3 +261,6 @@ deb: deborig
|
||||
cd ../i2psetproxy.js-$(VERSION) && debuild -us -uc -rfakeroot
|
||||
|
||||
-include mirrors.mk
|
||||
|
||||
dat:
|
||||
wget -c -O dat.js https://bundle.run/dat-js
|
259
README.md
259
README.md
@@ -1,13 +1,168 @@
|
||||
i2psetproxy.js
|
||||
==============
|
||||
I2P in Private Browsing Mode(Firefox-Only)
|
||||
==========================================
|
||||
|
||||
WebExtension that does extended configuration of a dedicated I2P browser. While
|
||||
**experimental**, it's capable of enforcing the use of the I2P Proxy without
|
||||
needing to touch about:config and disables several
|
||||
fingerprinting/de-anonymization vectors on it's own. It is also the easiest way
|
||||
to configure an I2P browser on Android without requiring the user to root their
|
||||
device. It aims to be as similar to a fully-fledged I2P browser as possible and
|
||||
borrows some code from I2P Rhizome(Which it is also compatible with).
|
||||
This is an **Experimental** webextension which introduces a set of new "Private
|
||||
Browsing" modes to Firefox-based browsers(Supporting webextensions) that makes
|
||||
it easier to configure a browser to use I2P securely and adds features for
|
||||
making I2P applications easier to use. It does this by isolating I2P-specific
|
||||
settings to Contextual Identities within Firefox, then loading them
|
||||
automatically when the user requests them. It also adds convenience and
|
||||
management features specific to I2P like protocol handlers and native messaging
|
||||
systems.
|
||||
|
||||
Installation(Cross-Platform):
|
||||
-----------------------------
|
||||
|
||||
For desktop users this addon is available from addons.mozilla.org, where you
|
||||
will be able to recive automatic updates:
|
||||
https://addons.mozilla.org/en-US/firefox/addon/i2p-in-private-browsing/.
|
||||
|
||||
Debian Installation:
|
||||
--------------------
|
||||
|
||||
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:
|
||||
|
||||
make deb
|
||||
|
||||
and then you can install it with:
|
||||
|
||||
sudo apt install ../i2psetproxy.js_*.deb
|
||||
|
||||
Bittorrent Download:
|
||||
--------------------
|
||||
|
||||
The self-hosted plugin is available from I2P both within the I2P and Clearnet
|
||||
Bittorrent network.
|
||||
|
||||
* magnetsub
|
||||
* [Get the .torrent file](./i2ppb@eyedeekay.github.io.xpi.torrent)
|
||||
|
||||
Usage:
|
||||
------
|
||||
|
||||
* 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.
|
||||
* 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:
|
||||
* 
|
||||
* Also, there's a menu for accessing I2P functionality while you're browsing.
|
||||
It lets you control a few settings in a granular way.
|
||||
* 
|
||||
* You can re-enable WebRTC but force it to always use the proxy that is
|
||||
enforced by the tab.
|
||||
* 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.
|
||||
* That's all there is to it! Your browser is configured to safely use and
|
||||
administer I2P
|
||||
|
||||
### Features
|
||||
|
||||
* [done] **Provide** 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.
|
||||
* 
|
||||
* [done] **Indicate** the I2P browser is in use visually. Find an
|
||||
acceptable way to indicate it on Android.
|
||||
* 
|
||||
* [done] **Set** the http proxy to use the local I2P proxy automatically.
|
||||
Provide specific configuration for other types of I2P proxies(SOCKS,
|
||||
isolating HTTP)
|
||||
* [done] **Disable** risky webRTC features/offer the option to re-enable
|
||||
them with the proxy enforced.
|
||||
* [done] **Change** the color of the browser window to indicate that I2P is in
|
||||
use
|
||||
* 
|
||||
* [ready/broken/wip] **Provide** help in a variety of languages.
|
||||
* [wip] **Monitor** 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.
|
||||
* [Done] **Handle** 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.
|
||||
* 
|
||||
* [wip] **Handle Torrents** by talking to i2psnark-rpc plugin and then
|
||||
adding them directly into the Firefox downloads drop-downs, menus, etc. If I
|
||||
can. Right now instead of talking to snark-rpc, it uses a web-based protocl
|
||||
handler that simply auto-fills the torrent into i2psnark.
|
||||
* 
|
||||
* [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
|
||||
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
|
||||
- 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.
|
||||
- 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.
|
||||
- I2P Blogging: Use this for posting content to the web interface of your
|
||||
blog or to other similar websites that you create content on.
|
||||
* 
|
||||
|
||||
### Video
|
||||
|
||||
* 
|
||||
|
||||
Documents
|
||||
------------
|
||||
|
||||
* **[Browser Outline](https://github.com/eyedeekay/I2P-in-Private-Browsing-Mode-Firefox/releases/download/docs/Browser.Design.Documentation.pdf)**: This document is an outline of each of
|
||||
the browser extension's feature panels in presentation form.
|
||||
* **[Smart Lander Design](https://github.com/eyedeekay/I2P-in-Private-Browsing-Mode-Firefox/releases/download/docs/Landing.Page.Documentation.pdf)**: 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.
|
||||
|
||||
Super Extra Important Background Info:
|
||||
--------------------------------------
|
||||
|
||||
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.
|
||||
|
||||
### Links about Project Uplift
|
||||
|
||||
* [Tor Uplift](https://wiki.mozilla.org/Security/Tor_Uplift) 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.
|
||||
* [First Party Isolation](https://wiki.mozilla.org/Security/FirstPartyIsolation)
|
||||
is a feature in Firefox and other browsers which keeps information from
|
||||
leaking across first-party domains.
|
||||
* [Fingerprinting](https://wiki.mozilla.org/Security/Fingerprinting) 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.
|
||||
* [Fennec](https://wiki.mozilla.org/Security/Fennec%2BTor_Project) is Firefox
|
||||
for Android and this link has some analysis of the privacy consequences of the
|
||||
Android platform.
|
||||
* [Tracking](https://wiki.mozilla.org/Security/Tor_Uplift/Tracking) in Firefox
|
||||
is surveyed here.
|
||||
|
||||
Project uplift seems to have largely been accomplished?
|
||||
|
||||
### Links about Project Fusion
|
||||
|
||||
* [Project Fusion](https://wiki.mozilla.org/Security/Fusion) or Firefox using
|
||||
Onions is a joint Mozilla/Tor effort to create an enhanced Private Browsing
|
||||
mode for Firefox which uses Tor.
|
||||
* [Notes](https://trac.torproject.org/projects/tor/wiki/org/meetings/2018Rome/Notes/FusionProject)
|
||||
from a meeting about Fusion.
|
||||
* [Tor at the Heart: Firefox](https://blog.torproject.org/tor-heart-firefox) is
|
||||
a blog about Tor and the relationship they have to Firefox re: TBB, Fusion.
|
||||
|
||||
The Old Version
|
||||
---------------
|
||||
@@ -30,7 +185,7 @@ to install an extension and indicate the permissions required. Read them over
|
||||
and when you're ready, accept them. That's all it should take, your browser is
|
||||
now configured to use I2P.
|
||||
|
||||
### addons.mozilla.org
|
||||
### Android addons.mozilla.org(Temporarily Disabled)
|
||||
|
||||
If you would prefer to recieve automatic updates from AMO, the correct product
|
||||
page for this plugin is
|
||||
@@ -40,87 +195,3 @@ for updates, you can download the identical plugin from this repository's
|
||||
releases page. The latest AMO Plugin will always be identical to the latest
|
||||
github release, except for the version number, which must be incremented for
|
||||
submission to AMO.
|
||||
|
||||
Debian usage:
|
||||
-------------
|
||||
|
||||
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:
|
||||
|
||||
make deb
|
||||
|
||||
### Features
|
||||
|
||||
* [done] **Provide** 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.
|
||||
* [done/wip] **Indicate** the I2P browser is in use visually. Find an
|
||||
acceptable way to indicate it on Android.
|
||||
* [done] **Set** the http proxy to use the local I2P proxy automatically.
|
||||
Provide specific configuration for other types of I2P proxies(SOCKS,
|
||||
isolating HTTP)
|
||||
* [done/wip] **Disable** risky webRTC features/offer the option to re-enable
|
||||
them with the proxy enforced.
|
||||
* [done] **Change** the color of the browser window to indicate that I2P is in
|
||||
use
|
||||
* [done-ish] **Reset** the HTTP Proxy tunnel to generate a new destination
|
||||
on-demand
|
||||
* it does this by working in conjunction with this
|
||||
[standalone HTTP proxy](https://github.com/eyedeekay/httptunnel), currently
|
||||
disabled*.
|
||||
* [ready] **Provide** help in a variety of languages.
|
||||
* [wip] **Monitor** 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.
|
||||
* [1/2] **Handle** 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.
|
||||
* [not started] **Handle Torrents** by talking to i2psnark-rpc plugin and then
|
||||
adding them directly into the Firefox downloads drop-downs, menus, etc. If I
|
||||
can.
|
||||
|
||||
### Screenshot
|
||||
|
||||

|
||||
|
||||

|
||||
|
||||

|
||||
|
||||

|
||||
|
||||

|
||||
|
||||

|
||||
|
||||

|
||||
|
||||
Super Extra Important Background Info:
|
||||
--------------------------------------
|
||||
|
||||
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.
|
||||
|
||||
### Links about Project Uplift
|
||||
|
||||
* https://wiki.mozilla.org/Security/Tor_Uplift
|
||||
* https://wiki.mozilla.org/Security/FirstPartyIsolation
|
||||
* https://wiki.mozilla.org/Security/Fingerprinting
|
||||
* https://wiki.mozilla.org/Security/Fennec%2BTor_Project
|
||||
* https://wiki.mozilla.org/Security/Tor_Uplift/Tracking
|
||||
|
||||
Project uplift seems to have largely been accomplished?
|
||||
|
||||
### Links about Project Fusion
|
||||
|
||||
* https://wiki.mozilla.org/Security/Fusion
|
||||
* https://trac.torproject.org/projects/tor/wiki/org/meetings/2018Rome/Notes/FusionProject
|
||||
* https://blog.torproject.org/tor-heart-firefox
|
@@ -4,9 +4,113 @@
|
||||
"description": "Name of the extension."
|
||||
},
|
||||
"extensionDescription": {
|
||||
"message": "Set up a browser to use the i2p http proxy automatically",
|
||||
"message": "Your browser is now set up to use I2P.",
|
||||
"description": "Description of the extension."
|
||||
},
|
||||
"extensionStatus": {
|
||||
"message": "It is a labs project for enhancing your I2P browsing experience.",
|
||||
"description": "Release status of the extension."
|
||||
},
|
||||
"proxyFailedStatus": {
|
||||
"message": "Proxy is not ready",
|
||||
"description": "Proxy failed status."
|
||||
},
|
||||
"controlHeader": {
|
||||
"message": "Control",
|
||||
"description": "Headline for control panel."
|
||||
},
|
||||
"controlExplain": {
|
||||
"message": "These controls are used to tailor your I2P Browsing Experience",
|
||||
"description": "Introduce the control panel."
|
||||
},
|
||||
"clearData": {
|
||||
"message": "Clear Browsing Data: ",
|
||||
"description": "Clear Browsing Data menu item."
|
||||
},
|
||||
"clearDesc": {
|
||||
"message": "Use this to erase your I2P browsing data.",
|
||||
"description": "Clear browsing data action description."
|
||||
},
|
||||
"enableWebRTC": {
|
||||
"message": "Enable WebRTC with proxy?",
|
||||
"description": "WebRTC checkbox label."
|
||||
},
|
||||
"rtcDesc": {
|
||||
"message": "WebRTC is disabled by default, but you can turn it back on and force it to honor the proxy. If you are a user of the Snowflake browser extension, this option is disabled and WebRTC is turned on by default.",
|
||||
"description": "WebRTC action description"
|
||||
},
|
||||
"disableHistory": {
|
||||
"message": "Disable History in I2P Tabs?",
|
||||
"description": "History checkbox label."
|
||||
},
|
||||
"histDesc": {
|
||||
"message": "History is automatically cleared when your I2P tabs are closed. If you want to clear history as you go, check this box.",
|
||||
"description": "History action description"
|
||||
},
|
||||
"applicationHeader": {
|
||||
"message": "Applications",
|
||||
"description": "Header for applications section."
|
||||
},
|
||||
"applicationExplain": {
|
||||
"message": "These applications work with I2P directly to provide them with security and privacy.",
|
||||
"description": "Description for application section."
|
||||
},
|
||||
"windowVisitHomepage": {
|
||||
"message": "Home Page: ",
|
||||
"description": "Home page for the extension label."
|
||||
},
|
||||
"abouthome": {
|
||||
"message": "For more information about this extension, visit this page.",
|
||||
"description": "Description for the extension button page."
|
||||
},
|
||||
"windowVisitI2ptunnel": {
|
||||
"message": "Hidden Services Manager: ",
|
||||
"description": "Title for i2ptunnel"
|
||||
},
|
||||
"i2ptunnel": {
|
||||
"message": "I2P has a web-based interface for configuring .i2p services like web sites which you can set up.",
|
||||
"description": "Description for i2ptunnel"
|
||||
},
|
||||
"windowVisitSusimail": {
|
||||
"message": "E-Mail: ",
|
||||
"description": "Title for e-mail"
|
||||
},
|
||||
"susimail": {
|
||||
"message": "I2P also bundles a webmail client which can be used to access in-I2P e-mail.",
|
||||
"description": "Description for e-mail"
|
||||
},
|
||||
"windowVisitSnark": {
|
||||
"message": "Bittorrent: ",
|
||||
"description": "Title for Bittorrent"
|
||||
},
|
||||
"snark": {
|
||||
"message": "I2P is capable of anonymous Peer-to-Peer file sharing using the built-in bittorrent application.",
|
||||
"description": "Description for Bittorrent"
|
||||
},
|
||||
"windowVisitSources": {
|
||||
"message": "Extension Source Code: ",
|
||||
"description": "Title for source code link"
|
||||
},
|
||||
"sources": {
|
||||
"message": "Browse the source code here",
|
||||
"description": "Description for the Source code link"
|
||||
},
|
||||
"windowVisitWebPage": {
|
||||
"message": "Extension Home Page: ",
|
||||
"description": "Visit extension homepage on Github"
|
||||
},
|
||||
"homepage": {
|
||||
"message": "More information is available here",
|
||||
"description": "Find more information"
|
||||
},
|
||||
"windowVisitReleases": {
|
||||
"message": "Extension Releases: ",
|
||||
"description": "Visit the release page"
|
||||
},
|
||||
"releases": {
|
||||
"message": "Check for new releases here",
|
||||
"description": "Description for new release page"
|
||||
},
|
||||
"titlePreface": {
|
||||
"message": "I2P Browser",
|
||||
"description": "Preface for the browser titlebar"
|
||||
@@ -23,6 +127,14 @@
|
||||
"message": "Web Browser (Private)",
|
||||
"description": "Preface for the browser titlebar"
|
||||
},
|
||||
"localPreface": {
|
||||
"message": "Localhost Browser",
|
||||
"description": "Preface for the browser titlebar"
|
||||
},
|
||||
"localPrefacePrivate": {
|
||||
"message": "Localhost Browser (Private)",
|
||||
"description": "Preface for the browser titlebar"
|
||||
},
|
||||
"routerPreface": {
|
||||
"message": "Router Console",
|
||||
"description": "Preface for the browser titlebar"
|
||||
@@ -97,10 +209,22 @@
|
||||
},
|
||||
"controlHostText": {
|
||||
"message": "Control Host: ",
|
||||
"description": "Host for the Reset Tunnel button"
|
||||
"description": "Host for the Router Console"
|
||||
},
|
||||
"controlPortText": {
|
||||
"message": "Control Port: ",
|
||||
"description": "Port for the Reset Tunnel button"
|
||||
"description": "Port for the Router Console"
|
||||
},
|
||||
"controlHostValue": {
|
||||
"message": "127.0.0.1",
|
||||
"description": "Host for the Router Console"
|
||||
},
|
||||
"controlPortValue": {
|
||||
"message": "7657",
|
||||
"description": "Port for the Router Console"
|
||||
},
|
||||
"protocolHandlerValue": {
|
||||
"message": "http://127.0.0.1:7657/i2psnark/?nofilter_newURL=%s&action=Add&foo=Add+torrent",
|
||||
"description": "Value for the magnet protocol handler"
|
||||
}
|
||||
}
|
||||
|
294
background.js
294
background.js
@@ -10,8 +10,10 @@ var torrentpref = chrome.i18n.getMessage("torrentPreface");
|
||||
var torrentprefpriv = chrome.i18n.getMessage("torrentPrefacePrivate");
|
||||
var tunnelpref = chrome.i18n.getMessage("i2ptunnelPreface");
|
||||
var tunnelprefpriv = chrome.i18n.getMessage("i2ptunnelPrefacePrivate");
|
||||
var localpref = chrome.i18n.getMessage("localPreface");
|
||||
var localprefpriv = chrome.i18n.getMessage("localPrefacePrivate");
|
||||
|
||||
function onGot(contexts) {
|
||||
function onContextsGot(contexts) {
|
||||
var ids = [];
|
||||
for (let context of contexts) {
|
||||
console.log(`Name: ${context.name}`);
|
||||
@@ -25,7 +27,7 @@ function onGot(contexts) {
|
||||
color: "orange",
|
||||
icon: "fingerprint"
|
||||
})
|
||||
.then(onCreated, onError);
|
||||
.then(onCreated, onNotCreated);
|
||||
}
|
||||
if (ids.indexOf(webpref) == -1) {
|
||||
browser.contextualIdentities
|
||||
@@ -34,7 +36,7 @@ function onGot(contexts) {
|
||||
color: "red",
|
||||
icon: "circle"
|
||||
})
|
||||
.then(onCreated, onError);
|
||||
.then(onCreated, onNotCreated);
|
||||
}
|
||||
if (ids.indexOf(routerpref) == -1) {
|
||||
browser.contextualIdentities
|
||||
@@ -43,7 +45,7 @@ function onGot(contexts) {
|
||||
color: "blue",
|
||||
icon: "briefcase"
|
||||
})
|
||||
.then(onCreated, onError);
|
||||
.then(onCreated, onNotCreated);
|
||||
}
|
||||
if (ids.indexOf(tunnelpref) == -1) {
|
||||
browser.contextualIdentities
|
||||
@@ -52,7 +54,7 @@ function onGot(contexts) {
|
||||
color: "green",
|
||||
icon: "tree"
|
||||
})
|
||||
.then(onCreated, onError);
|
||||
.then(onCreated, onNotCreated);
|
||||
}
|
||||
if (ids.indexOf(mailpref) == -1) {
|
||||
browser.contextualIdentities
|
||||
@@ -61,7 +63,7 @@ function onGot(contexts) {
|
||||
color: "yellow",
|
||||
icon: "briefcase"
|
||||
})
|
||||
.then(onCreated, onError);
|
||||
.then(onCreated, onNotCreated);
|
||||
}
|
||||
if (ids.indexOf(torrentpref) == -1) {
|
||||
browser.contextualIdentities
|
||||
@@ -70,57 +72,109 @@ function onGot(contexts) {
|
||||
color: "purple",
|
||||
icon: "chill"
|
||||
})
|
||||
.then(onCreated, onError);
|
||||
.then(onCreated, onNotCreated);
|
||||
}
|
||||
if (ids.indexOf(localpref) == -1) {
|
||||
browser.contextualIdentities
|
||||
.create({
|
||||
name: localpref,
|
||||
color: "red",
|
||||
icon: "fence"
|
||||
})
|
||||
.then(onCreated, onNotCreated);
|
||||
}
|
||||
}
|
||||
|
||||
function onContextsError() {
|
||||
console.log("Error finding contextual identities, is the API enabled?");
|
||||
}
|
||||
|
||||
function onCreated(context) {
|
||||
console.log(`New identity's ID: ${context.cookieStoreId}.`);
|
||||
}
|
||||
|
||||
function onError(e) {
|
||||
console.error(e);
|
||||
function onNotCreated(context) {
|
||||
console.log(`identity ID: ${context.cookieStoreId} not created`);
|
||||
}
|
||||
|
||||
browser.contextualIdentities.query({}).then(onGot, onError);
|
||||
browser.contextualIdentities.query({}).then(onContextsGot, onContextsError);
|
||||
|
||||
if (!isDroid()) {
|
||||
chrome.windows.onCreated.addListener(themeWindow);
|
||||
chrome.windows.onFocusChanged.addListener(themeWindow);
|
||||
chrome.windows.onRemoved.addListener(themeWindow);
|
||||
chrome.tabs.onUpdated.addListener(themeWindowByTab);
|
||||
chrome.tabs.onActivated.addListener(themeWindowByTab);
|
||||
} else {
|
||||
}
|
||||
var gettingInfo = browser.runtime.getPlatformInfo();
|
||||
gettingInfo.then(got => {
|
||||
if (got.os != "android") {
|
||||
browser.windows.onCreated.addListener(themeWindow);
|
||||
browser.windows.onFocusChanged.addListener(themeWindow);
|
||||
browser.windows.onRemoved.addListener(themeWindow);
|
||||
browser.tabs.onUpdated.addListener(themeWindowByTab);
|
||||
browser.tabs.onActivated.addListener(themeWindowByTab);
|
||||
}
|
||||
});
|
||||
|
||||
function themeWindowByTab(tabId) {
|
||||
function tabWindow(tab) {
|
||||
getwindow = browser.windows.get(tab.windowId);
|
||||
getwindow.then(themeWindow);
|
||||
var gettingPlatformInfo = browser.runtime.getPlatformInfo();
|
||||
gettingPlatformInfo.then(got => {
|
||||
if (got.os == "android") {
|
||||
let getwindow = browser.tabs.get(tab.tabId);
|
||||
getwindow.then(themeWindow);
|
||||
} else {
|
||||
let getwindow = browser.windows.get(tab.windowId);
|
||||
getwindow.then(themeWindow);
|
||||
}
|
||||
});
|
||||
}
|
||||
if (typeof tabId === "number") {
|
||||
tab = browser.tabs.get(tabId);
|
||||
let tab = browser.tabs.get(tabId);
|
||||
tab.then(tabWindow);
|
||||
} else {
|
||||
tabWindow(tabId);
|
||||
}
|
||||
}
|
||||
|
||||
function isEmpty(obj) {
|
||||
if (obj === undefined || obj === null) {
|
||||
return true;
|
||||
}
|
||||
for (var key in obj) {
|
||||
if (obj.hasOwnProperty(key)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
var oldtheme = null;
|
||||
|
||||
var getOldTheme = async function getOldTheme() {
|
||||
let foundtheme = await browser.theme.getCurrent();
|
||||
if (!isEmpty(foundtheme)) {
|
||||
oldtheme = foundtheme;
|
||||
console.log("Found old theme", oldtheme);
|
||||
}
|
||||
return oldtheme;
|
||||
};
|
||||
|
||||
getOldTheme();
|
||||
|
||||
function themeWindow(window) {
|
||||
// Check if the window is in private browsing
|
||||
function onThemeError() {
|
||||
console.log("got theme", oldtheme);
|
||||
browser.theme.update(oldtheme);
|
||||
}
|
||||
function logTabs(tabInfo) {
|
||||
function onGot(context) {
|
||||
function onContextGotTheme(context) {
|
||||
if (context.name == titlepref) {
|
||||
console.log("Active in I2P window");
|
||||
if (window.incognito) {
|
||||
chrome.theme.update(window.id, {
|
||||
browser.theme.update(window.id, {
|
||||
colors: {
|
||||
frame: "#FFC56D",
|
||||
toolbar: "#FFC56D"
|
||||
}
|
||||
});
|
||||
} else {
|
||||
chrome.theme.update(window.id, {
|
||||
browser.theme.update(window.id, {
|
||||
colors: {
|
||||
frame: "#FFC56D",
|
||||
toolbar: "#FFC56D"
|
||||
@@ -130,14 +184,14 @@ function themeWindow(window) {
|
||||
} else if (context.name == routerpref) {
|
||||
console.log("Active in Router Console window");
|
||||
if (window.incognito) {
|
||||
chrome.theme.update(window.id, {
|
||||
browser.theme.update(window.id, {
|
||||
colors: {
|
||||
frame: "#A4C8E1",
|
||||
toolbar: "#A4C8E1"
|
||||
}
|
||||
});
|
||||
} else {
|
||||
chrome.theme.update(window.id, {
|
||||
browser.theme.update(window.id, {
|
||||
colors: {
|
||||
frame: "#A4C8E1",
|
||||
toolbar: "#A4C8E1"
|
||||
@@ -147,14 +201,14 @@ function themeWindow(window) {
|
||||
} else if (context.name == tunnelpref) {
|
||||
console.log("Active in Hidden Services Manager window");
|
||||
if (window.incognito) {
|
||||
chrome.theme.update(window.id, {
|
||||
browser.theme.update(window.id, {
|
||||
colors: {
|
||||
frame: "#D9D9D6",
|
||||
toolbar: "#D9D9D6"
|
||||
}
|
||||
});
|
||||
} else {
|
||||
chrome.theme.update(window.id, {
|
||||
browser.theme.update(window.id, {
|
||||
colors: {
|
||||
frame: "#D9D9D6",
|
||||
toolbar: "#D9D9D6"
|
||||
@@ -164,14 +218,14 @@ function themeWindow(window) {
|
||||
} else if (context.name == mailpref) {
|
||||
console.log("Active in Web Mail window");
|
||||
if (window.incognito) {
|
||||
chrome.theme.update(window.id, {
|
||||
browser.theme.update(window.id, {
|
||||
colors: {
|
||||
frame: "#F7E59A",
|
||||
toolbar: "#F7E59A"
|
||||
}
|
||||
});
|
||||
} else {
|
||||
chrome.theme.update(window.id, {
|
||||
browser.theme.update(window.id, {
|
||||
colors: {
|
||||
frame: "#F7E59A",
|
||||
toolbar: "#F7E59A"
|
||||
@@ -181,14 +235,14 @@ function themeWindow(window) {
|
||||
} else if (context.name == torrentpref) {
|
||||
console.log("Active in Bittorrent window");
|
||||
if (window.incognito) {
|
||||
chrome.theme.update(window.id, {
|
||||
browser.theme.update(window.id, {
|
||||
colors: {
|
||||
frame: "#A48FE1",
|
||||
toolbar: "#A48FE1"
|
||||
}
|
||||
});
|
||||
} else {
|
||||
chrome.theme.update(window.id, {
|
||||
browser.theme.update(window.id, {
|
||||
colors: {
|
||||
frame: "#A48FE1",
|
||||
toolbar: "#A48FE1"
|
||||
@@ -197,7 +251,11 @@ function themeWindow(window) {
|
||||
}
|
||||
} else {
|
||||
console.log("Not active in I2P window");
|
||||
chrome.theme.reset(window.id);
|
||||
if (isEmpty(oldtheme)) {
|
||||
browser.theme.reset();
|
||||
} else {
|
||||
browser.theme.update(window.id, oldtheme);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (
|
||||
@@ -206,9 +264,11 @@ function themeWindow(window) {
|
||||
) {
|
||||
browser.contextualIdentities
|
||||
.get(tabInfo[0].cookieStoreId)
|
||||
.then(onGot, onError);
|
||||
.then(onContextGotTheme, onThemeError);
|
||||
} else if (isEmpty(oldtheme)) {
|
||||
browser.theme.reset();
|
||||
} else {
|
||||
chrome.theme.reset(window.id);
|
||||
browser.theme.update(window.id, oldtheme);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -216,83 +276,96 @@ function themeWindow(window) {
|
||||
currentWindow: true,
|
||||
active: true
|
||||
});
|
||||
querying.then(logTabs, onError);
|
||||
querying.then(logTabs, onThemeError);
|
||||
}
|
||||
|
||||
function setTitle(window) {
|
||||
// Check if the window is in private browsing
|
||||
function onContextError() {
|
||||
console.log("Context Error");
|
||||
}
|
||||
function logTabs(tabInfo) {
|
||||
console.log(tabInfo);
|
||||
|
||||
function onGot(context) {
|
||||
function onContextGotTitle(context) {
|
||||
if (context.name == titlepref) {
|
||||
console.log("Active in I2P window");
|
||||
|
||||
if (window.incognito) {
|
||||
chrome.windows.update(window.id, {
|
||||
titlePreface: titleprefpriv
|
||||
browser.windows.update(window.id, {
|
||||
titlePreface: titleprefpriv + ": "
|
||||
});
|
||||
} else {
|
||||
chrome.windows.update(window.id, {
|
||||
titlePreface: titlepref
|
||||
browser.windows.update(window.id, {
|
||||
titlePreface: titlepref + ": "
|
||||
});
|
||||
}
|
||||
} else if (context.name == webpref) {
|
||||
console.log("Active in Web window");
|
||||
|
||||
if (window.incognito) {
|
||||
chrome.windows.update(window.id, {
|
||||
titlePreface: ""
|
||||
browser.windows.update(window.id, {
|
||||
titlePreface: webprefpriv + " - "
|
||||
});
|
||||
} else {
|
||||
chrome.windows.update(window.id, {
|
||||
titlePreface: ""
|
||||
browser.windows.update(window.id, {
|
||||
titlePreface: webpref + " - "
|
||||
});
|
||||
}
|
||||
} else if (context.name == routerpref) {
|
||||
console.log("Active in Router Console window");
|
||||
if (window.incognito) {
|
||||
chrome.windows.update(window.id, {
|
||||
titlePreface: routerprefpriv
|
||||
browser.windows.update(window.id, {
|
||||
titlePreface: titleprefpriv + " - " + routerprefpriv + ": "
|
||||
});
|
||||
} else {
|
||||
chrome.windows.update(window.id, {
|
||||
titlePreface: routerpref
|
||||
browser.windows.update(window.id, {
|
||||
titlePreface: titlepref + " - " + routerpref + ": "
|
||||
});
|
||||
}
|
||||
} else if (context.name == tunnelpref) {
|
||||
console.log("Active in Hidden Services Manager window");
|
||||
|
||||
if (window.incognito) {
|
||||
chrome.windows.update(window.id, {
|
||||
titlePreface: tunnelprefpriv
|
||||
browser.windows.update(window.id, {
|
||||
titlePreface: titleprefpriv + " - " + tunnelprefpriv + ": "
|
||||
});
|
||||
} else {
|
||||
chrome.windows.update(window.id, {
|
||||
titlePreface: tunnelpref
|
||||
browser.windows.update(window.id, {
|
||||
titlePreface: titlepref + " - " + tunnelpref + ": "
|
||||
});
|
||||
}
|
||||
} else if (context.name == mailpref) {
|
||||
console.log("Active in Web Mail window");
|
||||
console.log("Active in I2P Web Mail window");
|
||||
|
||||
if (window.incognito) {
|
||||
chrome.windows.update(window.id, {
|
||||
titlePreface: mailprefpriv
|
||||
browser.windows.update(window.id, {
|
||||
titlePreface: titleprefpriv + " - " + mailprefpriv + ": "
|
||||
});
|
||||
} else {
|
||||
chrome.windows.update(window.id, {
|
||||
titlePreface: mailpref
|
||||
browser.windows.update(window.id, {
|
||||
titlePreface: titlepref + " - " + mailpref + ": "
|
||||
});
|
||||
}
|
||||
} else if (context.name == torrentpref) {
|
||||
console.log("Active in I2P window");
|
||||
console.log("Active in I2P Torrent window");
|
||||
|
||||
if (window.incognito) {
|
||||
chrome.windows.update(window.id, {
|
||||
titlePreface: torrentprefpriv
|
||||
browser.windows.update(window.id, {
|
||||
titlePreface: titleprefpriv + " - " + torrentprefpriv + ": "
|
||||
});
|
||||
} else {
|
||||
chrome.windows.update(window.id, {
|
||||
titlePreface: torrentpref
|
||||
browser.windows.update(window.id, {
|
||||
titlePreface: titlepref + " - " + torrentpref + ": "
|
||||
});
|
||||
}
|
||||
} else if (context.name == localpref) {
|
||||
console.log("Active in Localhost window");
|
||||
|
||||
if (window.incognito) {
|
||||
browser.windows.update(window.id, {
|
||||
titlePreface: localprefpriv + " - " + localprefpriv + ": "
|
||||
});
|
||||
} else {
|
||||
browser.windows.update(window.id, {
|
||||
titlePreface: localpref + " - " + localpref + ": "
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -304,17 +377,15 @@ function setTitle(window) {
|
||||
) {
|
||||
browser.contextualIdentities
|
||||
.get(tabInfo[0].cookieStoreId)
|
||||
.then(onGot, onError);
|
||||
.then(onContextGotTitle, onContextError);
|
||||
} else if (window.incognito) {
|
||||
browser.windows.update(window.id, {
|
||||
titlePreface: ""
|
||||
});
|
||||
} else {
|
||||
if (window.incognito) {
|
||||
chrome.windows.update(window.id, {
|
||||
titlePreface: ""
|
||||
});
|
||||
} else {
|
||||
chrome.windows.update(window.id, {
|
||||
titlePreface: ""
|
||||
});
|
||||
}
|
||||
browser.windows.update(window.id, {
|
||||
titlePreface: ""
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -322,36 +393,63 @@ function setTitle(window) {
|
||||
currentWindow: true,
|
||||
active: true
|
||||
});
|
||||
querying.then(logTabs, onError);
|
||||
querying.then(logTabs, onContextError);
|
||||
}
|
||||
|
||||
chrome.windows.onCreated.addListener(() => {
|
||||
/* var gettingStoredSettings = chrome.storage.local.get();
|
||||
gettingStoredSettings.then(setupProxy, onError); */
|
||||
chrome.storage.local.get(function(got) {
|
||||
setupProxy();
|
||||
});
|
||||
var gettingListenerInfo = browser.runtime.getPlatformInfo();
|
||||
gettingListenerInfo.then(got => {
|
||||
function onPlatformError() {
|
||||
console.log("Error finding platform info");
|
||||
}
|
||||
if (got.os != "android") {
|
||||
browser.windows.onCreated.addListener(() => {
|
||||
chrome.storage.local.get(function() {
|
||||
setupProxy();
|
||||
});
|
||||
});
|
||||
browser.tabs.onCreated.addListener(() => {
|
||||
var getting = browser.windows.getCurrent({
|
||||
populate: true
|
||||
});
|
||||
getting.then(setTitle, onPlatformError);
|
||||
});
|
||||
browser.tabs.onActivated.addListener(() => {
|
||||
var getting = browser.windows.getCurrent({
|
||||
populate: true
|
||||
});
|
||||
getting.then(setTitle, onPlatformError);
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
chrome.tabs.onCreated.addListener(() => {
|
||||
var getting = browser.windows.getCurrent({
|
||||
populate: true
|
||||
});
|
||||
getting.then(setTitle, onError);
|
||||
/*
|
||||
var gettingInfo = browser.runtime.getPlatformInfo();
|
||||
gettingInfo.then(got => {
|
||||
if (got.os != "android") {
|
||||
browser.tabs.onCreated.addListener(() => {
|
||||
var getting = browser.windows.getCurrent({
|
||||
populate: true
|
||||
});
|
||||
getting.then(setTitle, onError);
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
chrome.tabs.onActivated.addListener(() => {
|
||||
var getting = browser.windows.getCurrent({
|
||||
populate: true
|
||||
});
|
||||
getting.then(setTitle, onError);
|
||||
var gettingInfo = browser.runtime.getPlatformInfo();
|
||||
gettingInfo.then(got => {
|
||||
if (got.os != "android") {
|
||||
browser.tabs.onActivated.addListener(() => {
|
||||
var getting = browser.windows.getCurrent({
|
||||
populate: true
|
||||
});
|
||||
getting.then(setTitle, onError);
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
*/
|
||||
function handleUpdated(updateInfo) {
|
||||
if (updateInfo.theme.colors) {
|
||||
if (updateInfo.theme) {
|
||||
console.log(`Theme was applied: ${updateInfo.theme}`);
|
||||
} else {
|
||||
console.log(`Theme was removed`);
|
||||
console.log("Theme was removed");
|
||||
}
|
||||
}
|
||||
|
||||
|
303
bookmarks.js
303
bookmarks.js
@@ -1,153 +1,168 @@
|
||||
function bookmarks(bookmarkToolbar) {
|
||||
console.log("Setting up bookmark toolbar", bookmarkToolbar);
|
||||
function bookHome(bookmarkItems) {
|
||||
if (!bookmarkItems.length) {
|
||||
function gotProxyInfo(info) {
|
||||
let host = info.value.http.split(":")[0];
|
||||
let port = info.value.http.split(":")[1];
|
||||
if (port == "7644") {
|
||||
var createBookmark = browser.bookmarks.create({
|
||||
url: "about:I2p",
|
||||
title: "I2P Home Page",
|
||||
parentId: bookmarkToolbar[0].id
|
||||
});
|
||||
createBookmark.then(onCreated);
|
||||
} else {
|
||||
var createBookmark = browser.bookmarks.create({
|
||||
url: browser.runtime.getURL("home.html"),
|
||||
title: "I2P Home Page",
|
||||
parentId: bookmarkToolbar[0].id
|
||||
});
|
||||
createBookmark.then(onCreated);
|
||||
}
|
||||
console.log("(bookmarks) adding home page bookmark");
|
||||
}
|
||||
console.log("(bookmarks) checking if we're running in an I2P Browser");
|
||||
var gettingInfo = browser.proxy.settings.get({});
|
||||
gettingInfo.then(gotProxyInfo);
|
||||
}
|
||||
}
|
||||
function bookTorrent(bookmarkItems) {
|
||||
if (!bookmarkItems.length) {
|
||||
function gotProxyInfo(info) {
|
||||
let host = info.value.http.split(":")[0];
|
||||
let port = info.value.http.split(":")[1];
|
||||
if (port == "7644") {
|
||||
var createBookmark = browser.bookmarks.create({
|
||||
url: "http://localhost:7647/i2psnark",
|
||||
title: "Bittorrent",
|
||||
parentId: bookmarkToolbar[0].id
|
||||
});
|
||||
createBookmark.then(onCreated);
|
||||
} else {
|
||||
var createBookmark = browser.bookmarks.create({
|
||||
url: "http://localhost:7657/i2psnark",
|
||||
title: "Bittorrent",
|
||||
parentId: bookmarkToolbar[0].id
|
||||
});
|
||||
createBookmark.then(onCreated);
|
||||
var gettingInfo = browser.runtime.getPlatformInfo();
|
||||
gettingInfo.then(got => {
|
||||
if (got.os != "android") {
|
||||
function bookmarks(bookmarkToolbar) {
|
||||
console.log("Setting up bookmark toolbar", bookmarkToolbar);
|
||||
function bookHome(bookmarkItems) {
|
||||
if (!bookmarkItems.length) {
|
||||
function gotProxyInfo(info) {
|
||||
let port = info.value.http.split(":")[1];
|
||||
if (port == "7644") {
|
||||
let createRhizomeBookmark = browser.bookmarks.create({
|
||||
url: "about:I2p",
|
||||
title: "I2P Home Page",
|
||||
parentId: bookmarkToolbar[0].id
|
||||
});
|
||||
createRhizomeBookmark.then(onCreated);
|
||||
} else {
|
||||
let createBookmark = browser.bookmarks.create({
|
||||
url: browser.runtime.getURL("home.html"),
|
||||
title: "I2P Home Page",
|
||||
parentId: bookmarkToolbar[0].id
|
||||
});
|
||||
createBookmark.then(onCreated);
|
||||
}
|
||||
console.log("(bookmarks) adding home page bookmark");
|
||||
}
|
||||
console.log(
|
||||
"(bookmarks) checking if we're running in an I2P Browser"
|
||||
);
|
||||
let gettingProxyInfo = browser.proxy.settings.get({});
|
||||
gettingProxyInfo.then(gotProxyInfo);
|
||||
}
|
||||
}
|
||||
console.log("(bookmarks) checking if we're running in an I2P Browser");
|
||||
var gettingInfo = browser.proxy.settings.get({});
|
||||
gettingInfo.then(gotProxyInfo);
|
||||
}
|
||||
}
|
||||
function bookMail(bookmarkItems) {
|
||||
if (!bookmarkItems.length) {
|
||||
function gotProxyInfo(info) {
|
||||
let host = info.value.http.split(":")[0];
|
||||
let port = info.value.http.split(":")[1];
|
||||
if (port == "7644") {
|
||||
var createBookmark = browser.bookmarks.create({
|
||||
url: "http://localhost:7647/webmail",
|
||||
title: "Web Mail",
|
||||
parentId: bookmarkToolbar[0].id
|
||||
});
|
||||
createBookmark.then(onCreated);
|
||||
} else {
|
||||
var createBookmark = browser.bookmarks.create({
|
||||
url: "http://localhost:7657/webmail",
|
||||
title: "Web Mail",
|
||||
parentId: bookmarkToolbar[0].id
|
||||
});
|
||||
createBookmark.then(onCreated);
|
||||
function bookTorrent(bookmarkItems) {
|
||||
if (!bookmarkItems.length) {
|
||||
function gotProxyInfo(info) {
|
||||
let port = info.value.http.split(":")[1];
|
||||
if (port == "7644") {
|
||||
let createBookmark = browser.bookmarks.create({
|
||||
url: "http://localhost:7657/i2psnark",
|
||||
title: "Bittorrent",
|
||||
parentId: bookmarkToolbar[0].id
|
||||
});
|
||||
createBookmark.then(onCreated);
|
||||
} else {
|
||||
let createRhizomeBookmark = browser.bookmarks.create({
|
||||
url:
|
||||
"http://" + control_host + ":" + control_port + "/i2psnark",
|
||||
title: "Bittorrent",
|
||||
parentId: bookmarkToolbar[0].id
|
||||
});
|
||||
createRhizomeBookmark.then(onCreated);
|
||||
}
|
||||
}
|
||||
console.log(
|
||||
"(bookmarks) checking if we're running in an I2P Browser"
|
||||
);
|
||||
let gettingProxyInfo = browser.proxy.settings.get({});
|
||||
gettingProxyInfo.then(gotProxyInfo);
|
||||
}
|
||||
console.log("(bookmarks) adding webmail bookmark");
|
||||
}
|
||||
console.log("(bookmarks) checking if we're running in an I2P Browser");
|
||||
var gettingInfo = browser.proxy.settings.get({});
|
||||
gettingInfo.then(gotProxyInfo);
|
||||
}
|
||||
}
|
||||
function bookI2PTunnel(bookmarkItems) {
|
||||
if (!bookmarkItems.length) {
|
||||
function gotProxyInfo(info) {
|
||||
let host = info.value.http.split(":")[0];
|
||||
let port = info.value.http.split(":")[1];
|
||||
if (port == "7644") {
|
||||
var createBookmark = browser.bookmarks.create({
|
||||
url: "http://localhost:7647/i2ptunnelmgr",
|
||||
title: "Hidden Services Manager",
|
||||
parentId: bookmarkToolbar[0].id
|
||||
});
|
||||
createBookmark.then(onCreated);
|
||||
} else {
|
||||
var createBookmark = browser.bookmarks.create({
|
||||
url: "http://localhost:7657/i2ptunnelmgr",
|
||||
title: "Hidden Services Manager",
|
||||
parentId: bookmarkToolbar[0].id
|
||||
});
|
||||
createBookmark.then(onCreated);
|
||||
function bookMail(bookmarkItems) {
|
||||
if (!bookmarkItems.length) {
|
||||
function gotProxyInfo(info) {
|
||||
let port = info.value.http.split(":")[1];
|
||||
if (port == "7644") {
|
||||
let createBookmark = browser.bookmarks.create({
|
||||
url: "http://localhost:7657/webmail",
|
||||
title: "Web Mail",
|
||||
parentId: bookmarkToolbar[0].id
|
||||
});
|
||||
createBookmark.then(onCreated);
|
||||
} else {
|
||||
let createRhizomeBookmark = browser.bookmarks.create({
|
||||
url: "http://" + control_host + ":" + control_port + "/webmail",
|
||||
title: "Web Mail",
|
||||
parentId: bookmarkToolbar[0].id
|
||||
});
|
||||
createRhizomeBookmark.then(onCreated);
|
||||
}
|
||||
console.log("(bookmarks) adding webmail bookmark");
|
||||
}
|
||||
console.log(
|
||||
"(bookmarks) checking if we're running in an I2P Browser"
|
||||
);
|
||||
let gettingProxyInfo = browser.proxy.settings.get({});
|
||||
gettingProxyInfo.then(gotProxyInfo);
|
||||
}
|
||||
console.log("(bookmarks) adding i2ptunnel bookmark");
|
||||
}
|
||||
console.log("(bookmarks) checking if we're running in an I2P Browser");
|
||||
var gettingInfo = browser.proxy.settings.get({});
|
||||
gettingInfo.then(gotProxyInfo);
|
||||
function bookI2PTunnel(bookmarkItems) {
|
||||
if (!bookmarkItems.length) {
|
||||
function gotProxyInfo(info) {
|
||||
let port = info.value.http.split(":")[1];
|
||||
if (port == "7644") {
|
||||
var createBookmark = browser.bookmarks.create({
|
||||
url: "http://localhost:7657/i2ptunnelmgr",
|
||||
title: "Hidden Services Manager",
|
||||
parentId: bookmarkToolbar[0].id
|
||||
});
|
||||
createBookmark.then(onCreated);
|
||||
} else {
|
||||
var createRhizomeBookmark = browser.bookmarks.create({
|
||||
url:
|
||||
"http://" +
|
||||
control_host +
|
||||
":" +
|
||||
control_port +
|
||||
"/i2ptunnelmgr",
|
||||
title: "Hidden Services Manager",
|
||||
parentId: bookmarkToolbar[0].id
|
||||
});
|
||||
createRhizomeBookmark.then(onCreated);
|
||||
}
|
||||
console.log("(bookmarks) adding i2ptunnel bookmark");
|
||||
}
|
||||
console.log(
|
||||
"(bookmarks) checking if we're running in an I2P Browser"
|
||||
);
|
||||
var gettingProxyInfo = browser.proxy.settings.get({});
|
||||
gettingProxyInfo.then(gotProxyInfo);
|
||||
}
|
||||
}
|
||||
|
||||
function onRejected(error) {
|
||||
console.log(`An error: ${error}`);
|
||||
}
|
||||
function onCreated(node) {
|
||||
console.log("Bookmarked", node);
|
||||
}
|
||||
|
||||
var b0 = browser.bookmarks.search({
|
||||
title: "I2P Home Page"
|
||||
});
|
||||
b0.then(bookHome, onRejected);
|
||||
|
||||
var b1 = browser.bookmarks.search({
|
||||
title: "Bittorrent"
|
||||
});
|
||||
b1.then(bookTorrent, onRejected);
|
||||
|
||||
var b2 = browser.bookmarks.search({
|
||||
title: "Hidden Services Manager"
|
||||
});
|
||||
b2.then(bookI2PTunnel, onRejected);
|
||||
|
||||
var b3 = browser.bookmarks.search({
|
||||
title: "Web Mail"
|
||||
});
|
||||
b3.then(bookMail, onRejected);
|
||||
}
|
||||
|
||||
var bt = browser.bookmarks.search({
|
||||
query: "Toolbar"
|
||||
});
|
||||
|
||||
bt.then(bookmarks);
|
||||
|
||||
function handleCreated(id, bookmarkInfo) {
|
||||
//var propValue;
|
||||
for (var propName in bookmarkInfo) {
|
||||
let propValue = bookmarkInfo[propName];
|
||||
console.log(propName, propValue);
|
||||
}
|
||||
}
|
||||
|
||||
browser.bookmarks.onCreated.addListener(handleCreated);
|
||||
}
|
||||
|
||||
function onRejected(error) {
|
||||
console.log(`An error: ${error}`);
|
||||
}
|
||||
function onCreated(node) {
|
||||
console.log("Bookmarked", node);
|
||||
}
|
||||
|
||||
var b0 = browser.bookmarks.search({
|
||||
title: "I2P Home Page"
|
||||
});
|
||||
b0.then(bookHome, onRejected);
|
||||
|
||||
var b1 = browser.bookmarks.search({
|
||||
title: "Bittorrent"
|
||||
});
|
||||
b1.then(bookTorrent, onRejected);
|
||||
|
||||
var b2 = browser.bookmarks.search({
|
||||
title: "Hidden Services Manager"
|
||||
});
|
||||
b2.then(bookI2PTunnel, onRejected);
|
||||
|
||||
var b3 = browser.bookmarks.search({
|
||||
title: "Web Mail"
|
||||
});
|
||||
b3.then(bookMail, onRejected);
|
||||
}
|
||||
|
||||
var bt = browser.bookmarks.search({
|
||||
query: "Toolbar"
|
||||
});
|
||||
|
||||
bt.then(bookmarks);
|
||||
|
||||
function handleCreated(id, bookmarkInfo) {
|
||||
var propValue;
|
||||
for (var propName in bookmarkInfo) {
|
||||
propValue = bookmarkInfo[propName];
|
||||
console.log(propName, propValue);
|
||||
}
|
||||
}
|
||||
|
||||
browser.bookmarks.onCreated.addListener(handleCreated);
|
||||
|
74
content.js
74
content.js
@@ -1,35 +1,45 @@
|
||||
var infoTitle = document.getElementById("text-section-header");
|
||||
infoTitle.textContent = chrome.i18n.getMessage("infoTitle");
|
||||
/*
|
||||
var helpMessage = document.getElementById("window-create-forum-panel");
|
||||
helpMessage.textContent = chrome.i18n.getMessage("forumMessage");
|
||||
*/
|
||||
/*
|
||||
var helpMessage = document.getElementById('window-create-help-panel');
|
||||
helpMessage.textContent = chrome.i18n.getMessage("helpMessage")
|
||||
*/
|
||||
/*
|
||||
var newsMessage = document.getElementById("window-create-news-panel");
|
||||
newsMessage.textContent = chrome.i18n.getMessage("newsMessage");
|
||||
*/
|
||||
var clearData = document.getElementById("clear-browser-data");
|
||||
clearData.textContent = chrome.i18n.getMessage("clearData");
|
||||
/*
|
||||
document.addEventListener("click", e => {
|
||||
browser.runtime.sendMessage({ url: "http://proxy.i2p" });
|
||||
});
|
||||
|
||||
function proxyContent(message) {
|
||||
var proxyData = document.getElementById("proxy-health");
|
||||
proxyData.textContent = message;
|
||||
console.log("Event occurred", message);
|
||||
function contentUpdateById(id, message) {
|
||||
let infoTitle = document.getElementById(id);
|
||||
let messageContent = chrome.i18n.getMessage(message);
|
||||
if (infoTitle === null) {
|
||||
console.log("content error", id, messageContent);
|
||||
return;
|
||||
}
|
||||
infoTitle.textContent = messageContent;
|
||||
}
|
||||
|
||||
browser.runtime.onMessage.addListener(proxyContent);
|
||||
*/
|
||||
// Information Section
|
||||
contentUpdateById("text-section-header", "extensionName");
|
||||
contentUpdateById("description", "extensionDescription");
|
||||
contentUpdateById("beta", "extensionStatus");
|
||||
contentUpdateById("proxy-check", "proxyFailedStatus");
|
||||
|
||||
/*
|
||||
function signalWebRTC(val){
|
||||
console.log("signal", val)
|
||||
}
|
||||
*/
|
||||
// Control Section
|
||||
contentUpdateById("controlHeader", "controlHeader");
|
||||
contentUpdateById("controlExplain", "controlExplain");
|
||||
contentUpdateById("clear-browser-data", "clearData");
|
||||
contentUpdateById("clear-desc", "clearDesc");
|
||||
contentUpdateById("enable-web-rtc", "enableWebRTC");
|
||||
contentUpdateById("rtcDesc", "rtcDesc");
|
||||
contentUpdateById("disable-history", "disableHistory");
|
||||
contentUpdateById("histDesc", "histDesc");
|
||||
|
||||
// Application Section
|
||||
contentUpdateById("applicationHeader", "applicationHeader");
|
||||
contentUpdateById("applicationExplain", "applicationExplain");
|
||||
contentUpdateById("window-visit-homepage", "windowVisitHomepage");
|
||||
contentUpdateById("abouthome", "abouthome");
|
||||
contentUpdateById("window-visit-i2ptunnel", "windowVisitI2ptunnel");
|
||||
contentUpdateById("i2ptunnel", "i2ptunnel");
|
||||
contentUpdateById("window-visit-susimail", "windowVisitSusiMail");
|
||||
contentUpdateById("susimail", "susimail");
|
||||
contentUpdateById("window-visit-snark", "windowVisitSnark");
|
||||
contentUpdateById("snark", "snark");
|
||||
|
||||
// Homepage Section
|
||||
contentUpdateById("window-visit-webpage", "windowVisitWebPage");
|
||||
contentUpdateById("webpage", "webpage");
|
||||
contentUpdateById("window-visit-sources", "windowVisitSources");
|
||||
contentUpdateById("sources", "sources");
|
||||
contentUpdateById("window-visit-releases", "windowVisitReleases");
|
||||
contentUpdateById("releases", "releases");
|
||||
|
36
context.js
36
context.js
@@ -1,19 +1,19 @@
|
||||
//var windowIds = []
|
||||
|
||||
function onCreated(windowInfo) {
|
||||
console.log(`Created window: ${windowInfo.id}`);
|
||||
browser.tabs.create({
|
||||
windowId: windowInfo.id,
|
||||
url: "about:blank",
|
||||
cookieStoreId: event.target.dataset.identity
|
||||
});
|
||||
}
|
||||
var titlepref = chrome.i18n.getMessage("titlePreface");
|
||||
|
||||
function onError(error) {
|
||||
console.log(`Error: ${error}`);
|
||||
}
|
||||
|
||||
function eventHandler(event) {
|
||||
function onCreated(windowInfo) {
|
||||
console.log(`Created window: ${windowInfo.id}`);
|
||||
browser.tabs.create({
|
||||
windowId: windowInfo.id,
|
||||
url: "about:blank",
|
||||
cookieStoreId: event.target.dataset.identity
|
||||
});
|
||||
}
|
||||
if (event.target.dataset.action == "create") {
|
||||
var creating = browser.tabs.create({
|
||||
cookieStoreId: event.target.dataset.identity
|
||||
@@ -26,7 +26,7 @@ function eventHandler(event) {
|
||||
cookieStoreId: event.target.dataset.identity
|
||||
})
|
||||
.then(tabs => {
|
||||
browser.tabs.remove(tabs.map(i => i.id));
|
||||
browser.tabs.remove(tabs.map(rem => rem.id));
|
||||
});
|
||||
}
|
||||
event.preventDefault();
|
||||
@@ -34,13 +34,13 @@ function eventHandler(event) {
|
||||
|
||||
function createOptions(node, identity) {
|
||||
for (let option of ["Create", "Close All"]) {
|
||||
let a = document.createElement("a");
|
||||
a.href = "#";
|
||||
a.innerText = option;
|
||||
a.dataset.action = option.toLowerCase().replace(" ", "-");
|
||||
a.dataset.identity = identity.cookieStoreId;
|
||||
a.addEventListener("click", eventHandler);
|
||||
node.appendChild(a);
|
||||
let alink = document.createElement("a");
|
||||
alink.href = "#";
|
||||
alink.innerText = option;
|
||||
alink.dataset.action = option.toLowerCase().replace(" ", "-");
|
||||
alink.dataset.identity = identity.cookieStoreId;
|
||||
alink.addEventListener("click", eventHandler);
|
||||
node.appendChild(alink);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -52,7 +52,7 @@ if (browser.contextualIdentities === undefined) {
|
||||
} else {
|
||||
browser.contextualIdentities
|
||||
.query({
|
||||
name: "I2P Browser"
|
||||
name: titlepref
|
||||
})
|
||||
.then(identities => {
|
||||
if (!identities.length) {
|
||||
|
39
debian/changelog
vendored
39
debian/changelog
vendored
@@ -1,3 +1,42 @@
|
||||
i2psetproxy.js (0.57-1) UNRELEASED; urgency=low
|
||||
|
||||
* Snowflake compatibility
|
||||
* Lots of small compatibility fixes
|
||||
* More linter errors
|
||||
* Make it multilingual again
|
||||
* Distribute a torrent and a magnet link with the plugin of the plugin
|
||||
|
||||
-- idk <hankhill19580@gmail.com> Thu, 4 JAN 2019 16:43:58 -0400
|
||||
|
||||
i2psetproxy.js (0.55-1) UNRELEASED; urgency=low
|
||||
|
||||
* Get rid of Web Browsing context launcher
|
||||
* Fix linter errors
|
||||
* Tolerate themes
|
||||
* Tolerate other containerizers
|
||||
|
||||
-- idk <hankhill19580@gmail.com> Thu, 2 JAN 2019 16:47:33 -0400
|
||||
|
||||
i2psetproxy.js (0.53-1) UNRELEASED; urgency=low
|
||||
|
||||
* Quick Fix
|
||||
|
||||
-- idk <hankhill19580@gmail.com> Sat, 23 NOV 2019 20:11:30 -0400
|
||||
|
||||
i2psetproxy.js (0.51-1) UNRELEASED; urgency=low
|
||||
|
||||
* Numerous code cleanups, compatibility fixes
|
||||
* enable-disable history
|
||||
* better homepage, better control panel, saner options
|
||||
|
||||
-- idk <hankhill19580@gmail.com> Sat, 23 NOV 2019 20:10:30 -0400
|
||||
|
||||
i2psetproxy.js (0.49-1) UNRELEASED; urgency=low
|
||||
|
||||
* fix tabs
|
||||
|
||||
-- idk <hankhill19580@gmail.com> Sat, 23 NOV 2019 22:51:11 -0400
|
||||
|
||||
i2psetproxy.js (0.47-1) UNRELEASED; urgency=low
|
||||
|
||||
* Improve android compatibility
|
||||
|
3
debian/rules
vendored
3
debian/rules
vendored
@@ -15,6 +15,9 @@ override_dh_auto_install:
|
||||
cp ./*.html $$(pwd)/debian/i2psetproxy.js/usr/share/webext/i2ppb@eyedeekay.github.io/
|
||||
cp ./*.css $$(pwd)/debian/i2psetproxy.js/usr/share/webext/i2ppb@eyedeekay.github.io/
|
||||
cp ./*.md $$(pwd)/debian/i2psetproxy.js/usr/share/webext/i2ppb@eyedeekay.github.io/
|
||||
cp ./*.xpi $$(pwd)/debian/i2psetproxy.js/usr/share/webext/i2ppb@eyedeekay.github.io/
|
||||
cp ./*.torrent $$(pwd)/debian/i2psetproxy.js/usr/share/webext/i2ppb@eyedeekay.github.io/
|
||||
cp ./*.png $$(pwd)/debian/i2psetproxy.js/usr/share/webext/i2ppb@eyedeekay.github.io/
|
||||
cp ./manifest.json $$(pwd)/debian/i2psetproxy.js/usr/share/webext/i2ppb@eyedeekay.github.io/
|
||||
cp ./LICENSE $$(pwd)/debian/i2psetproxy.js/usr/share/webext/i2ppb@eyedeekay.github.io/
|
||||
ln -sf $$(pwd)/debian/i2psetproxy.js/usr/share/webext/i2ppb@eyedeekay.github.io \
|
||||
|
7
debian/source/include-binaries
vendored
7
debian/source/include-binaries
vendored
@@ -1 +1,6 @@
|
||||
i2psetproxy.js.gif
|
||||
i2psetproxy.js.gif
|
||||
i2psetproxy.js@eyedeekay.github.io.xpi
|
||||
i2ppb@eyedeekay.github.io.xpi
|
||||
web-ext-artifacts/i2p_in_private_browsing-0.51-an+fx.xpi
|
||||
smartlander.pdf
|
||||
browser.pdf
|
1
geti2p.url
Normal file
1
geti2p.url
Normal file
@@ -0,0 +1 @@
|
||||
0.9.43
|
10
handler.js
10
handler.js
@@ -21,14 +21,14 @@ function trimHost(url) {
|
||||
} else {
|
||||
hostname = url.split("/")[0];
|
||||
}
|
||||
let path = url.replace(prefix+hostname, "")
|
||||
console.log("(handler) path", prefix+hostname, path)
|
||||
return path
|
||||
let path = url.replace(prefix + hostname, "");
|
||||
console.log("(handler) path", prefix + hostname, path);
|
||||
return path;
|
||||
}
|
||||
|
||||
var handlerSetup = async function(requestDetails) {
|
||||
var handlerSetup = function(requestDetails) {
|
||||
//console.log("checking protocol handler listener")
|
||||
var rwurl = identifyProtocolHandler(requestDetails.url);
|
||||
let rwurl = identifyProtocolHandler(requestDetails.url);
|
||||
if (rwurl != false) {
|
||||
console.log("(handler) rewrite URL requested", rwurl);
|
||||
requestDetails.redirectUrl = rwurl;
|
||||
|
28
home.css
28
home.css
@@ -76,8 +76,10 @@ p {
|
||||
border: 1px solid #d9d9d6;
|
||||
border-radius: 2px;
|
||||
box-shadow: inset 0 0 0 1px #fff,0 0 1px #ccc;
|
||||
background: #f8f8ff
|
||||
background: #f8f8ff;
|
||||
min-width: 95%
|
||||
}
|
||||
.application-info,
|
||||
.extended-info {
|
||||
min-height: 3rem;
|
||||
padding: 1rem;
|
||||
@@ -87,17 +89,7 @@ p {
|
||||
border-radius: 2px;
|
||||
box-shadow: inset 0 0 0 1px #fff,0 0 1px #ccc;
|
||||
background: #f8f8ff;
|
||||
min-width: 50%
|
||||
}
|
||||
.application-info {
|
||||
min-height: 3rem;
|
||||
padding: 1rem;
|
||||
margin-top: 1.5rem;
|
||||
display: inline-block;
|
||||
border: 1px solid #d9d9d6;
|
||||
border-radius: 2px;
|
||||
box-shadow: inset 0 0 0 1px #fff,0 0 1px #ccc;
|
||||
background: #f8f8ff
|
||||
min-width: 95%
|
||||
}
|
||||
h1 {
|
||||
margin-right: auto;
|
||||
@@ -212,6 +204,7 @@ li {
|
||||
box-shadow: inset 0 0 0 1px #fff,0 0 1px #ccc
|
||||
}
|
||||
#applicationExplain,
|
||||
#controlExplain,
|
||||
#linksExplain {
|
||||
min-height: 5rem;
|
||||
padding: .5rem;
|
||||
@@ -269,21 +262,28 @@ li {
|
||||
}
|
||||
.onboardingContent {
|
||||
font-size: .8rem!important;
|
||||
text-align: left
|
||||
text-align: left;
|
||||
display: none
|
||||
}
|
||||
#proxy-check {
|
||||
visibility: hidden
|
||||
}
|
||||
#info-content {
|
||||
display: none
|
||||
}
|
||||
.consoleOn:hover #proxy-check,
|
||||
.proxyReady:hover #proxy-check {
|
||||
visibility: visible;
|
||||
opacity: 1
|
||||
}
|
||||
img {
|
||||
max-width: 100%
|
||||
}
|
||||
img.readyness {
|
||||
height: 100%;
|
||||
width: auto
|
||||
}
|
||||
@media only screen and (max-width: 768px) {
|
||||
@media only screen and (max-width: 399px) {
|
||||
.application-info {
|
||||
display: none
|
||||
}
|
||||
|
76
home.html
76
home.html
@@ -9,15 +9,16 @@
|
||||
<body>
|
||||
<!--<div>-->
|
||||
<script src="home.js" type="text/javascript"></script>
|
||||
<script src="content.js" type="text/javascript"></script>
|
||||
<div class='background'>
|
||||
<div class='content'>
|
||||
<div class='section-header'>
|
||||
<h1>I2P In Private Browsing</h1>
|
||||
<h1 id="text-section-header">I2P Browsing</h1>
|
||||
</div>
|
||||
<div id="i2pbrowser-version"></div>
|
||||
<div id="i2pbrowser-description">
|
||||
<p id="description">I2P in Private Browsing is a webextension to secure and enhance your I2P use in the browser.</p>
|
||||
<p class="beta">This is an experimental product.</p>
|
||||
<p id="beta">This is an experimental product.</p>
|
||||
</div>
|
||||
<div id="readyness">
|
||||
<div id="consoleOn" class="hideIfI2PConsoleOff">
|
||||
@@ -32,77 +33,56 @@
|
||||
</div>
|
||||
<div id="onboarding" class="hideIfI2PConsoleOff">
|
||||
<h3 id="onboardingTitle">New to I2P? Learn more here.</h3>
|
||||
<h4 id="onboardingZero"><button class="showhider" onclick="flipVisibility('onboardingContentZero')">Protect your Privacy</button></h4>
|
||||
<h4 id="onboardingZero"><button id="onboardingButtonZero" class="showhider" onclick="flipVisibility('onboardingContentZero')">Protect your Privacy</button></h4>
|
||||
<p id="onboardingContentZero" class="onboardingContent">I2P Browser allows you to surf the internet using the private and secure I2P network. When using it, you are protected against tracking, surveillance, and censorship as a first-class participant in the I2P network. I2P Browser isolates cookies and deletes your browser history after your session. These modifications ensure your privacy and security are protected in the browser.</p>
|
||||
<h4 id="onboardingOne"><button class="showhider" onclick="flipVisibility('onboardingContentOne')">Configure your Experience</button></h4>
|
||||
<h4 id="onboardingOne"><button id="onboardingButtonOne" class="showhider" onclick="flipVisibility('onboardingContentOne')">Configure your Experience</button></h4>
|
||||
<p id="onboardingContentOne" class="onboardingContent">We also provide you with additional settings for bumping up your browser security. Our Security Settings allow you to block elements that could be used to attack your computer. Click below to see what the different options do. Note: By default, NoScript and HTTPS Everywhere are not included on the toolbar, but you can customize your toolbar to add them. With all the security and privacy features provided by I2P, your experience while browsing the internet may be a little different. Things may be a bit slower, and depending on your security level, some elements may not work or load. You may also be asked to prove you are a human and not a robot.</p>
|
||||
<h4 id="onboardingTwo"><button class="showhider" onclick="flipVisibility('onboardingContentTwo')">Share Files</button></h4>
|
||||
<h4 id="onboardingTwo"><button id="onboardingButtonTwo" class="showhider" onclick="flipVisibility('onboardingContentTwo')">Share Files</button></h4>
|
||||
<p id="onboardingContentTwo" class="onboardingContent">I2P is capable of using peer-to-peer applications like BitTorrent, protecting your identity when you share files. Our anonymous bittorrent client is available in the browser.</p>
|
||||
<h4 id="onboardingThree"><button class="showhider" onclick="flipVisibility('onboardingContentThree')">Hidden e-mail</button></h4>
|
||||
<h4 id="onboardingThree"><button id="onboardingButtonThree" class="showhider" onclick="flipVisibility('onboardingContentThree')">Hidden e-mail</button></h4>
|
||||
<p id="onboardingContentThree" class="onboardingContent">There is also an anonymous e-mail service available inside of I2P, which is accessible from our browser via the menu directly below.</p>
|
||||
<h4 id="onboardingFour"><button class="showhider" onclick="flipVisibility('onboardingContentFour')">Experience Tips</button></h4>
|
||||
<h4 id="onboardingFour"><button id="onboardingButtonFour" class="showhider" onclick="flipVisibility('onboardingContentFour')">Experience Tips</button></h4>
|
||||
<p id="onboardingContentFour" class="onboardingContent">With all the security and privacy features provided by I2P, your experience while browsing the internet may be a little different. Things may be a bit slower, and depending on your security level, some elements may not work or load. You may also be asked to prove you are a human and not a robot.</p>
|
||||
</div>
|
||||
<!--<p class="hideIfI2POn">&aboutI2p.warn_not_running; <a href="about:i2p">&aboutI2p.refresh_text;</a> &aboutI2p.reccommend_not_running;</p>-->
|
||||
<div class="application-info">
|
||||
<p class="hideIfI2PConsoleOff">
|
||||
<h3>Applications</h3>
|
||||
<h3 id="applicationHeader">Applications</h3>
|
||||
<p id="applicationExplain">These applications use I2P to provide them with security and privacy.</p>
|
||||
<ul>
|
||||
<a class="applicationName" href="http://127.0.0.1:7657/i2ptunnel">
|
||||
<li class="application">
|
||||
Hidden Services Manager <span class="applicationDesc">I2P has a web-based interface for configuring .i2p services like web sites, to set up your own web sites, go here:</span>
|
||||
</li>
|
||||
</a>
|
||||
<a class="applicationName" href="http://127.0.0.1:7657/susimail">
|
||||
<li class="application">
|
||||
E-Mail <span class="applicationDesc">I2P also bundles a webmail client which can be used to access in-I2P e-mail. To use it, go here:</span>
|
||||
</li>
|
||||
</a>
|
||||
<a class="applicationName" href="http://127.0.0.1:7657/i2psnark">
|
||||
<li class="application">
|
||||
BitTorrent <span class="applicationDesc">I2P is capable of anonymous Peer-to-Peer file sharing, to use the built-in bittorrent client go here:</span>
|
||||
</li>
|
||||
</a>
|
||||
<li class="application">
|
||||
<a id="window-visit-i2ptunnel" class="applicationName" target="_blank" href="http://127.0.0.1:7657/i2ptunnel">Hidden Services Manager </a>
|
||||
<span id="i2ptunnel" class="applicationDesc">I2P has a web-based interface for configuring .i2p services like web sites, to set up your own web sites, go here:</span>
|
||||
</li>
|
||||
<li class="application">
|
||||
<a id="window-visit-susimail" class="applicationName" target="_blank" href="http://127.0.0.1:7657/susimail">E-Mail </a>
|
||||
<span id="susimail" class="applicationDesc">I2P also bundles a webmail client which can be used to access in-I2P e-mail. To use it, go here:</span>
|
||||
</li>
|
||||
<li class="application">
|
||||
<a id="window-visit-snark" class="applicationName" target="_blank" href="http://127.0.0.1:7657/i2psnark">BitTorrent </a>
|
||||
<span id="snark" class="applicationDesc">I2P is capable of anonymous Peer-to-Peer file sharing, to use the built-in bittorrent client go here:</span>
|
||||
</li>
|
||||
</ul>
|
||||
</p>
|
||||
</div>
|
||||
<div class="extended-info">
|
||||
<h3 id="links"><button class="showhider" onclick="flipVisibility('info-content')">Links</button></h3>
|
||||
<h3 id="links"><button id="fliplinks" class="showhider">Links</button></h3>
|
||||
<div id="info-content">
|
||||
<p id="linksExplain">If you want to get more information about I2P, you can visit these links.</p>
|
||||
<p>
|
||||
<ul>
|
||||
<a href="https://github.com/i2p/i2p-browser">
|
||||
<li>
|
||||
I2P Browser Source Code: <span class="applicationDesc">Go here to browse the source code of our Firefox fork.</span>
|
||||
<a id="window-visit-webpage" href="https://eyedeekay.github.io/I2P-in-Private-Browsing-Mode-Firefox/">Homepage: </a>
|
||||
<span id="webpage" class="applicationDesc">More information is available here.</span>
|
||||
</li>
|
||||
</a>
|
||||
<a href="https://github.com/i2p/i2pbutton">
|
||||
<li>
|
||||
I2P Button Source Code: <span class="applicationDesc">Much of the functionality of the I2P Browser is implemented in the I2PButton plugin.</span>
|
||||
<a id="window-visit-sources" href="https://github.com/eyedeekay/I2P-in-Private-Browsing-Mode-Firefox">Source Code: </a>
|
||||
<span id="sources" class="applicationDesc">Browse the source or contribute here.</span>
|
||||
</li>
|
||||
</a>
|
||||
<a href="https://github.com/mikalv/i2p-browser-build-scripts">
|
||||
<li>
|
||||
I2P Browser Build Scripts: <span class="applicationDesc">These scripts are used to build the browser.</span>
|
||||
<a id="window-visit-releases" href="https://github.com/eyedeekay/I2P-in-Private-Browsing-Mode-Firefox">Releases: </a>
|
||||
<span id="releases" class="applicationDesc">Check for new releases here.</span>
|
||||
</li>
|
||||
</a>
|
||||
<a href="https://github.com/mikalv/i2p-browser-design-docs">
|
||||
<li>
|
||||
I2P Browser Design Document: <span class="applicationDesc">This is the I2P Browser Design Document.</span>
|
||||
</li>
|
||||
</a>
|
||||
<a href="http://trac.i2p2.i2p/">
|
||||
<li>
|
||||
Trac Wiki: <span class="applicationDesc">To report a bug, visit the Trac Wiki.</span>
|
||||
</li>
|
||||
</a>
|
||||
<a href="http://i2p-projekt.i2p/get-involved/donate">
|
||||
<li>
|
||||
<em>Support Us: </em> <span class="applicationDesc">I2P is funded by donations. In order to make a donation visit the project web site.</span>
|
||||
</li>
|
||||
</a>
|
||||
</ul>
|
||||
</p>
|
||||
</div>
|
||||
|
24
home.js
24
home.js
@@ -1,8 +1,24 @@
|
||||
document.addEventListener("click", clickEvent => {
|
||||
if (clickEvent.target.id === "onboardingButtonZero") {
|
||||
flipVisibility("onboardingContentZero");
|
||||
} else if (clickEvent.target.id === "onboardingButtonOne") {
|
||||
flipVisibility("onboardingContentOne");
|
||||
} else if (clickEvent.target.id === "onboardingButtonTwo") {
|
||||
flipVisibility("onboardingContentTwo");
|
||||
} else if (clickEvent.target.id === "onboardingButtonThree") {
|
||||
flipVisibility("onboardingContentThree");
|
||||
} else if (clickEvent.target.id === "onboardingButtonFour") {
|
||||
flipVisibility("onboardingContentFour");
|
||||
} else if (clickEvent.target.id === "fliplinks") {
|
||||
flipVisibility("info-content");
|
||||
}
|
||||
});
|
||||
|
||||
function flipVisibility(div) {
|
||||
var x = document.getElementById(div);
|
||||
if (x.style.display === "none") {
|
||||
x.style.display = "block";
|
||||
let flippable = document.getElementById(div);
|
||||
if (flippable.style.display === "none") {
|
||||
flippable.style.display = "block";
|
||||
} else {
|
||||
x.style.display = "none";
|
||||
flippable.style.display = "none";
|
||||
}
|
||||
}
|
||||
|
21
host.js
21
host.js
@@ -28,6 +28,12 @@ function localHost(url) {
|
||||
return false;
|
||||
}
|
||||
|
||||
function extensionHost(url) {
|
||||
var res = url.startsWith(browser.runtime.getURL(""));
|
||||
console.log("Extension URL?", res, url, browser.runtime.getURL(""));
|
||||
return res;
|
||||
}
|
||||
|
||||
function i2pHostName(url) {
|
||||
let hostname = "";
|
||||
if (url.indexOf("://") > -1) {
|
||||
@@ -71,24 +77,27 @@ function routerHost(url) {
|
||||
}
|
||||
if (url.indexOf("://") > -1) {
|
||||
hostname = url.split("/")[2];
|
||||
prefix = url.substr(0, url.indexOf("://") + 3);
|
||||
let prefix = url.substr(0, url.indexOf("://") + 3);
|
||||
path = url.replace(prefix + hostname + "/", "");
|
||||
} else if (identifyProtocolHandler(url)) {
|
||||
url = identifyProtocolHandler(url);
|
||||
return routerHost(url);
|
||||
let newurl = identifyProtocolHandler(url);
|
||||
return routerHost(newurl);
|
||||
} else {
|
||||
hostname = url.split("/")[0];
|
||||
path = url.replace(hostname + "/", "");
|
||||
}
|
||||
if (hostname === "127.0.0.1:7657") {
|
||||
if (hostname === control_host + ":" + control_port) {
|
||||
console.log("(hostcheck) router console found on configured ports");
|
||||
return pathcheck(path);
|
||||
} else if (hostname === "127.0.0.1:7657") {
|
||||
return pathcheck(path);
|
||||
} else if (hostname === "localhost:7657") {
|
||||
return pathcheck(path);
|
||||
}
|
||||
|
||||
if (hostname === "127.0.0.1:7647") {
|
||||
if (hostname === "127.0.0.1:7657") {
|
||||
return pathcheck(path);
|
||||
} else if (hostname === "localhost:7647") {
|
||||
} else if (hostname === "localhost:7657") {
|
||||
return pathcheck(path);
|
||||
}
|
||||
|
||||
|
4
i2ppb-0.55@eyedeekay.github.io.xpi.torrent
Normal file
4
i2ppb-0.55@eyedeekay.github.io.xpi.torrent
Normal file
@@ -0,0 +1,4 @@
|
||||
d8:announce76:http://zviyq72xcmjupynn5y2f5qa3u7bxyu34jnqmwt6czte2l7idxm7q.b32.i2p/announce13:announce-listll76:http://zviyq72xcmjupynn5y2f5qa3u7bxyu34jnqmwt6czte2l7idxm7q.b32.i2p/announceel69:http://s5ikrdyjwbcgxmqetxb3nyheizftms7euacuub2hic7defkh3xhq.b32.i2p/ael76:http://uajd4nctepxpac4c4bdyrdw7qvja2a5u3x25otfhkptcjgd53ioq.b32.i2p/announceel69:http://w7tpbzncbcocrqtwwm3nezhnnsw4ozadvi2hmvzdhrqzfxfum7wa.b32.i2p/ael33:http://explodie.org:6969/announceel43:http://tracker.opentrackr.org:1337/announceel41:http://tracker.kamigami.org:2710/announceel49:http://tracker.internetwarriors.net:1337/announceel38:http://tracker.darli.net:6611/announceel43:http://tracker.corpscorp.online:80/announceel29:http://tracker.bz:80/announceel37:http://tracker.bt4g.com:2095/announceel42:http://retracker.sevstar.net:2710/announceel39:http://h4.trakx.nibba.trade:80/announceel36:http://www.proxmox.com:6969/announceel36:http://www.loushao.net:8080/announceel36:http://vps02.net.orel.ru:80/announceel39:http://tracker4.itzmx.com:2710/announceel39:http://tracker3.itzmx.com:6961/announceel39:http://tracker2.itzmx.com:6961/announceel39:http://tracker1.itzmx.com:8080/announceel42:http://tracker01.loveapp.com:6789/announceel42:http://tracker.zerobytes.xyz:1337/announceel41:http://tracker.yoshi210.com:6969/announceel41:http://tracker.torrentyorg.pl:80/announceel39:http://tracker.nyap2p.com:8080/announceel35:http://tracker.lelux.fi:80/announceel37:http://tracker.gbitt.info:80/announceel27:http://pow7.com:80/announceel42:http://opentracker.i2p.rocks:6969/announceel40:http://open.acgtracker.com:1096/announceel40:http://open.acgnxtracker.com:80/announceel37:http://mail2.zelenaya.net:80/announceel28:http://acg.rip:6699/announceee10:created by13:mktorrent 1.113:creation datei1578123505e4:infod6:lengthi4582809e4:name36:./i2ppb-0.55@eyedeekay.github.io.xpi12:piece lengthi262144e6:pieces360:%<25><05>/Ԭx<D4AC><78>Ɠ<EFBFBD><08><>4<EFBFBD>ա<EFBFBD>G<EFBFBD>B<15>Ҍ<EFBFBD>2Fi<04>'N<><4E>d<EFBFBD>C*P<>ה<EFBFBD>s6<1E><><EFBFBD>><3E>Pk<50><6B><EFBFBD><EFBFBD>E<EFBFBD>Ӄ<EFBFBD>j<1C><>@<19>
|
||||
X<EFBFBD><EFBFBD><EFBFBD>?<3F>!s<C286><73>k<EFBFBD><6B>m{<7B><><EFBFBD><EFBFBD><EFBFBD>*<2A><><EFBFBD>`<><16>0J<18><>%,<13><><EFBFBD>O
|
||||
<EFBFBD>s˛Zs"
|
||||
<EFBFBD>-<2D>J<EFBFBD><4A>?Y<><59><EFBFBD>ue<75>IuO6jnd<><64>*<2A><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)<29>K<1C><>Z<EFBFBD><5A>C<1A><><04><>0!<21><><EFBFBD><EFBFBD>"<22>SIv<><76>;[<5B><><EFBFBD><EFBFBD>Tі<54><D196>h¶a5&<26>]A<19>dJ<64>Ou<4F>8<EFBFBD><38><0F><>扙<1C>Ͳ<><CDB2>݃J<DD83><4A><11>(~Ыuҫ<75><D2AB><EFBFBD>i<EFBFBD>y{<7B>7<><17><>m<EFBFBD> <20>i:ʼn<><C589><EFBFBD><EFBFBD><EFBFBD><EFBFBD>s;<3B><>F\p<><70><EFBFBD>S<05><><EFBFBD>a<EFBFBD><61><07><><EFBFBD><EFBFBD>~߳<>x<EFBFBD>~<7E><><EFBFBD>]\<5C>T6<>P<EFBFBD><50>*e<><11>S<EFBFBD>Vy
|
1
i2ppb@eyedeekay.github.io.xpi.torrent
Symbolic link
1
i2ppb@eyedeekay.github.io.xpi.torrent
Symbolic link
@@ -0,0 +1 @@
|
||||
./i2ppb-0.55@eyedeekay.github.io.xpi.torrent
|
Binary file not shown.
232
index.html
232
index.html
@@ -1,44 +1,74 @@
|
||||
<strong>i2psetproxy.js</strong>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>I2P in Private Browsing Mode</title>
|
||||
<link rel="stylesheet" type="text/css" href ="home.css" />
|
||||
</head>
|
||||
<body>
|
||||
<h1>I2P in Private Browsing Mode(Firefox-Only)</h1>
|
||||
|
||||
WebExtension that does extended configuration of a dedicated I2P browser. While
|
||||
<strong>experimental</strong>, it's capable of enforcing the use of the I2P Proxy without
|
||||
needing to touch about:config and disables several
|
||||
fingerprinting/de-anonymization vectors on it's own. It is also the easiest way
|
||||
to configure an I2P browser on Android without requiring the user to root their
|
||||
device.
|
||||
<p>This is an <strong>Experimental</strong> webextension which introduces a set of new "Private
|
||||
Browsing" modes to Firefox-based browsers(Supporting webextensions) that makes
|
||||
it easier to configure a browser to use I2P securely and adds features for
|
||||
making I2P applications easier to use. It does this by isolating I2P-specific
|
||||
settings to Contextual Identities within Firefox, then loading them
|
||||
automatically when the user requests them. It also adds convenience and
|
||||
management features specific to I2P like protocol handlers and native messaging
|
||||
systems.</p>
|
||||
|
||||
<strong>The Old Version</strong>
|
||||
<h2>Installation(Cross-Platform):</h2>
|
||||
|
||||
New versions of this extension create an I2P in Private Browsing mode instead.
|
||||
Since this is a drastic change to the behavior of the old plugin, a new entry
|
||||
for the new plugin has been made at a new location on addons.mozilla.org.
|
||||
<p>For desktop users this addon is available from addons.mozilla.org, where you
|
||||
will be able to recive automatic updates:
|
||||
https://addons.mozilla.org/en-US/firefox/addon/i2p-in-private-browsing/.</p>
|
||||
|
||||
<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>
|
||||
|
||||
<pre><code> make deb
|
||||
</code></pre>
|
||||
|
||||
<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 I2P both within the I2P and Clearnet
|
||||
Bittorrent network.</p>
|
||||
|
||||
<ul>
|
||||
<li>This is the new version: <a href="https://addons.mozilla.org/en-US/firefox/addon/i2p-in-private-browsing/">[link]</a></li>
|
||||
<li>This is the old version: <a href="https://addons.mozilla.org/en-US/firefox/addon/I2P-Proxy/">[link]</a></li>
|
||||
<li><a href="magnet:?xt=urn:btih:dc04e13d4697f68fe14975707015a45ed4a7d8e7">Magnet Link</a></li>
|
||||
<li><a href="./i2ppb@eyedeekay.github.io.xpi.torrent">Get the .torrent file</a></li>
|
||||
</ul>
|
||||
|
||||
<strong>Android usage:</strong>
|
||||
<h2>Usage:</h2>
|
||||
|
||||
Open the following link
|
||||
<a href="https://github.com/eyedeekay/i2psetproxy.js/releases/">Github Releases Version</a>
|
||||
in the browser you want to use for I2P. Firefox will warn you that it is about
|
||||
to install an extension and indicate the permissions required. Read them over
|
||||
and when you're ready, accept them. That's all it should take, your browser is
|
||||
now configured to use I2P.
|
||||
<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>
|
||||
</ul>
|
||||
|
||||
<strong>addons.mozilla.org</strong>
|
||||
|
||||
If you would prefer to recieve automatic updates from AMO, the correct product
|
||||
page for this plugin is
|
||||
<a href="https://addons.mozilla.org/en-US/firefox/addon/i2p-in-private-browsing/">I2P In Private Browsing</a>.
|
||||
This absolutely requires a working outproxy. If you want to avoid the use of AMO
|
||||
for updates, you can download the identical plugin from this repository's
|
||||
releases page. The latest AMO Plugin will always be identical to the latest
|
||||
github release, except for the version number, which must be incremented for
|
||||
submission to AMO.
|
||||
|
||||
<strong>Features</strong>
|
||||
<h3>Features</h3>
|
||||
|
||||
<ul>
|
||||
<li>[done] <strong>Provide</strong> a way to launch into an I2P-Specific contextual identity
|
||||
@@ -46,61 +76,141 @@ submission to AMO.
|
||||
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>[done/wip] <strong>Indicate</strong> the I2P browser is in use visually. Find an
|
||||
<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/wip] <strong>Disable</strong> risky webRTC features/offer the option to re-enable
|
||||
<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>[done-ish] <strong>Reset</strong> the HTTP Proxy tunnel to generate a new destination
|
||||
on-demand
|
||||
<ul>
|
||||
<li>it does this by working in conjunction with this
|
||||
<a href="https://github.com/eyedeekay/httptunnel">standalone HTTP proxy</a>, currently
|
||||
disabled*.</li>
|
||||
</ul></li>
|
||||
<li>[ready] <strong>Provide</strong> help in a variety of languages.</li>
|
||||
<li><img src="i2ptunnel.png" alt="Visiting i2ptunnel" title="" /></li>
|
||||
<li>[ready/broken/wip] <strong>Provide</strong> help in a variety of languages.</li>
|
||||
<li>[wip] <strong>Monitor</strong> the health and readiness of the I2P router it is
|
||||
instructed to use.</li>
|
||||
<li>[1/2] <strong>Handle</strong> router console applications under their own origins and
|
||||
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>[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>[not started] <strong>Handle Torrents</strong> by talking to i2psnark-rpc plugin and then
|
||||
<li><img src="routerconsole.png" alt="Visiting routerconsole" title="" /></li>
|
||||
<li>[wip] <strong>Handle Torrents</strong> by talking to i2psnark-rpc plugin and then
|
||||
adding them directly into the Firefox downloads drop-downs, menus, etc. If I
|
||||
can.</li>
|
||||
can. Right now instead of talking to snark-rpc, it uses a web-based protocl
|
||||
handler that simply auto-fills the torrent into i2psnark.</li>
|
||||
<li><img src="i2psnark.png" alt="Visiting i2psnark" title="" /></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>
|
||||
|
||||
<strong>Screenshot</strong>
|
||||
<h3>Video</h3>
|
||||
|
||||
<ul>
|
||||
<li><img src="i2psetproxy.js.gif" alt="Video of the plugin in action" title="" /></li>
|
||||
</ul>
|
||||
|
||||
<h2>Documents</h2>
|
||||
|
||||
<strong>Super Extra Important Background Info:</strong>
|
||||
<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>
|
||||
</ul>
|
||||
|
||||
This plugin's viability is directly related to the viability of Mozilla and
|
||||
<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.
|
||||
"Uplift" and "Fusion(Firefox Using Onions)" projects.</p>
|
||||
|
||||
<strong>Links about Project Uplift</strong>
|
||||
<h3>Links about Project Uplift</h3>
|
||||
|
||||
<ul>
|
||||
<li>https://wiki.mozilla.org/Security/Tor_Uplift</li>
|
||||
<li>https://wiki.mozilla.org/Security/FirstPartyIsolation</li>
|
||||
<li>https://wiki.mozilla.org/Security/Fingerprinting</li>
|
||||
<li>https://wiki.mozilla.org/Security/Fennec%2BTor_Project</li>
|
||||
<li>https://wiki.mozilla.org/Security/Tor_Uplift/Tracking</li>
|
||||
<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>
|
||||
|
||||
Project uplift seems to have largely been accomplished?
|
||||
<p>Project uplift seems to have largely been accomplished?</p>
|
||||
|
||||
<strong>Links about Project Fusion</strong>
|
||||
<h3>Links about Project Fusion</h3>
|
||||
|
||||
<ul>
|
||||
<li>https://wiki.mozilla.org/Security/Fusion</li>
|
||||
<li>https://trac.torproject.org/projects/tor/wiki/org/meetings/2018Rome/Notes/FusionProject</li>
|
||||
<li>https://blog.torproject.org/tor-heart-firefox</li>
|
||||
<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 Old Version</h2>
|
||||
|
||||
<p>New versions of this extension create an I2P in Private Browsing mode instead.
|
||||
Since this is a drastic change to the behavior of the old plugin, 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>Open the following link
|
||||
<a href="https://github.com/eyedeekay/i2psetproxy.js/releases/">Github Releases Version</a>
|
||||
in the browser you want to use for I2P. Firefox will warn you that it is about
|
||||
to install an extension and indicate the permissions required. Read them over
|
||||
and when you're ready, accept them. That's all it should take, your browser is
|
||||
now configured to use I2P.</p>
|
||||
|
||||
<h3>Android addons.mozilla.org(Temporarily Disabled)</h3>
|
||||
|
||||
<p>If you would prefer to recieve automatic updates from AMO, the correct product
|
||||
page for this plugin is
|
||||
<a href="https://addons.mozilla.org/en-US/firefox/addon/i2p-in-private-browsing/">I2P In Private Browsing</a>.
|
||||
This absolutely requires a working outproxy. If you want to avoid the use of AMO
|
||||
for updates, you can download the identical plugin from this repository's
|
||||
releases page. The latest AMO Plugin will always be identical to the latest
|
||||
github release, except for the version number, which must be incremented for
|
||||
submission to AMO.</p>
|
||||
</body>
|
||||
</html>
|
||||
|
188
info.js
188
info.js
@@ -1,9 +1,38 @@
|
||||
document.addEventListener("click", e => {
|
||||
function getCurrentWindow() {
|
||||
return chrome.windows.getCurrent();
|
||||
function checkPeerConnection() {
|
||||
function snowflake(snowflake) {
|
||||
console.log("snowflake plugin found, leaving WebRTC alone", snowflake);
|
||||
EnablePeerConnection();
|
||||
}
|
||||
var snowflakeInfo = browser.management.get(
|
||||
"{b11bea1f-a888-4332-8d8a-cec2be7d24b9}" // string
|
||||
);
|
||||
snowflakeInfo.then(snowflake);
|
||||
let getting = browser.privacy.network.peerConnectionEnabled.get({});
|
||||
getting.then(got => {
|
||||
let webrtc = got.value;
|
||||
console.log("checking webrtc", webrtc);
|
||||
document.getElementById("enable-web-rtc").checked = webrtc;
|
||||
});
|
||||
}
|
||||
|
||||
if (e.target.id === "window-create-help-panel") {
|
||||
checkPeerConnection();
|
||||
|
||||
function checkHistory() {
|
||||
let getting = browser.storage.local.get("disable_history");
|
||||
getting.then(got => {
|
||||
let disable_history = got.disable_history;
|
||||
if (disable_history == undefined) {
|
||||
disable_history = false;
|
||||
}
|
||||
console.log("checking history", disable_history);
|
||||
document.getElementById("disable-history").checked = disable_history;
|
||||
});
|
||||
}
|
||||
|
||||
checkHistory();
|
||||
|
||||
document.addEventListener("click", clickEvent => {
|
||||
if (clickEvent.target.id === "window-create-help-panel") {
|
||||
let createData = {
|
||||
type: "panel",
|
||||
incognito: true
|
||||
@@ -12,7 +41,7 @@ document.addEventListener("click", e => {
|
||||
creating.then(() => {
|
||||
console.log("The help panel has been created");
|
||||
});
|
||||
} else if (e.target.id === "window-create-news-panel") {
|
||||
} else if (clickEvent.target.id === "window-create-news-panel") {
|
||||
let createData = {
|
||||
type: "panel",
|
||||
incognito: true
|
||||
@@ -21,67 +50,77 @@ document.addEventListener("click", e => {
|
||||
creating.then(() => {
|
||||
console.log("The news panel has been created");
|
||||
});
|
||||
} else if (e.target.id === "generate-fresh-tunnel") {
|
||||
function RefreshIdentity() {
|
||||
} else if (clickEvent.target.id === "generate-fresh-tunnel") {
|
||||
function refreshIdentity() {
|
||||
console.log("Generating new identity");
|
||||
const Http = new XMLHttpRequest();
|
||||
const url = "http://" + controlHost + ":" + controlPort;
|
||||
Http.open("GET", url);
|
||||
Http.send();
|
||||
Http.onreadystatechange = e => {
|
||||
Http.onreadystatechange = event => {
|
||||
console.log(Http.responseText);
|
||||
};
|
||||
}
|
||||
RefreshIdentity();
|
||||
} else if (e.target.id === "window-preface-title") {
|
||||
getCurrentWindow().then(currentWindow => {
|
||||
let updateInfo = {
|
||||
titlePreface: "I2P Help | "
|
||||
};
|
||||
chrome.windows.update(currentWindow.id, updateInfo);
|
||||
});
|
||||
} else if (e.target.id === "window-visit-homepage") {
|
||||
refreshIdentity();
|
||||
} else if (clickEvent.target.id === "window-preface-title") {
|
||||
console.log("attempting to create homepage tab");
|
||||
goHome();
|
||||
} else if (e.target.id === "window-visit-i2ptunnel") {
|
||||
} else if (clickEvent.target.id === "window-visit-homepage") {
|
||||
console.log("attempting to create homepage tab");
|
||||
goHome();
|
||||
} else if (clickEvent.target.id === "window-visit-i2ptunnel") {
|
||||
console.log("attempting to create i2ptunnel tab");
|
||||
goTunnel();
|
||||
} else if (e.target.id === "window-visit-susimail") {
|
||||
} else if (clickEvent.target.id === "window-visit-susimail") {
|
||||
console.log("attempting to create susimail tab");
|
||||
goMail();
|
||||
} else if (e.target.id === "window-visit-snark") {
|
||||
} else if (clickEvent.target.id === "window-visit-snark") {
|
||||
console.log("attempting to create snark tab");
|
||||
goSnark();
|
||||
} else if (e.target.id === "clear-browser-data") {
|
||||
} else if (clickEvent.target.id === "clear-browser-data") {
|
||||
forgetBrowsingData();
|
||||
} else if (e.target.id === "check-i2p-control") {
|
||||
echo("I2P Router Detected", "panel-section-i2pcontrol-check");
|
||||
} else if (e.target.id === "enable-web-rtc") {
|
||||
if (e.target.checked) {
|
||||
} else if (clickEvent.target.id === "check-i2p-control") {
|
||||
//echo("I2P Router Detected", "panel-section-i2pcontrol-check");
|
||||
} else if (clickEvent.target.id === "enable-web-rtc") {
|
||||
if (clickEvent.target.checked) {
|
||||
browser.runtime.sendMessage({ rtc: "enableWebRTC" });
|
||||
} else {
|
||||
browser.runtime.sendMessage({ rtc: "disableWebRTC" });
|
||||
}
|
||||
checkPeerConnection();
|
||||
return;
|
||||
} else if (clickEvent.target.id === "disable-history") {
|
||||
if (clickEvent.target.checked) {
|
||||
browser.runtime.sendMessage({ history: "disableHistory" });
|
||||
} else {
|
||||
browser.runtime.sendMessage({ history: "enableHistory" });
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
e.preventDefault();
|
||||
clickEvent.preventDefault();
|
||||
});
|
||||
|
||||
function proxyReadiness() {
|
||||
console.log(this.responseText);
|
||||
}
|
||||
|
||||
var gettingInfo = browser.runtime.getPlatformInfo();
|
||||
gettingInfo.then(got => {
|
||||
if (got.os != "android") {
|
||||
browser.history.onVisited.addListener(onVisited);
|
||||
}
|
||||
});
|
||||
|
||||
function goHome() {
|
||||
function gotProxyInfo(info) {
|
||||
let host = info.value.http.split(":")[0];
|
||||
let port = info.value.http.split(":")[1];
|
||||
if (port == "7644") {
|
||||
let createData = {
|
||||
let createRhizomeData = {
|
||||
url: "about:I2p"
|
||||
};
|
||||
console.log("visiting homepage");
|
||||
let creating = browser.tabs.create(createData);
|
||||
let creating = browser.tabs.create(createRhizomeData);
|
||||
} else {
|
||||
let createData = {
|
||||
url: "home.html"
|
||||
@@ -92,71 +131,70 @@ function goHome() {
|
||||
console.log("(bookmarks) adding home page bookmark");
|
||||
}
|
||||
console.log("(bookmarks) checking if we're running in an I2P Browser");
|
||||
var gettingInfo = browser.proxy.settings.get({});
|
||||
gettingInfo.then(gotProxyInfo);
|
||||
var gettingProxyInfo = browser.proxy.settings.get({});
|
||||
gettingProxyInfo.then(gotProxyInfo);
|
||||
}
|
||||
|
||||
function onTabCreated() {
|
||||
console.log("Tab Created");
|
||||
}
|
||||
|
||||
function goTunnel() {
|
||||
function onTabError() {
|
||||
console.log("I2PTunnel tab created");
|
||||
}
|
||||
let createData = {
|
||||
url: "http://127.0.0.1:7657/i2ptunnel"
|
||||
url: "http://" + control_host + ":" + control_port + "/i2ptunnel"
|
||||
};
|
||||
console.log("visiting homepage");
|
||||
console.log("visiting i2ptunnel");
|
||||
let creating = browser.tabs.create(createData);
|
||||
creating(onTabCreated, onTabError);
|
||||
}
|
||||
|
||||
function goMail() {
|
||||
function onTabError() {
|
||||
console.log("Mail tab created");
|
||||
}
|
||||
let createData = {
|
||||
url: "http://127.0.0.1:7657/susimail"
|
||||
url: "http://" + control_host + ":" + control_port + "/susimail"
|
||||
};
|
||||
console.log("visiting homepage");
|
||||
console.log("visiting mail");
|
||||
let creating = browser.tabs.create(createData);
|
||||
creating(onTabCreated, onTabError);
|
||||
}
|
||||
|
||||
function goSnark() {
|
||||
function onTabError() {
|
||||
console.log("Snark tab created");
|
||||
}
|
||||
let createData = {
|
||||
url: "http://127.0.0.1:7657/i2psnark"
|
||||
url: "http://" + control_host + ":" + control_port + "/i2psnark"
|
||||
};
|
||||
console.log("visiting homepage");
|
||||
console.log("visiting snark");
|
||||
let creating = browser.tabs.create(createData);
|
||||
}
|
||||
/*
|
||||
//document.addEventListener("onpageshow", e => {
|
||||
console.log("(Check) Checking Proxy Readiness");
|
||||
const Http = new XMLHttpRequest();
|
||||
Http.addEventListener("load", proxyReadiness);
|
||||
const url = "http://proxy.i2p"; ///themes/console/images/favicon.ico";
|
||||
Http.open("GET", url);
|
||||
Http.send();
|
||||
//});
|
||||
|
||||
function transferComplete(evt) {
|
||||
console.log(
|
||||
"The transfer is complete.",
|
||||
this.status,
|
||||
this.statusText,
|
||||
this.responseText
|
||||
);
|
||||
creating(onTabCreated, onTabError);
|
||||
}
|
||||
|
||||
function transferFailed(evt) {
|
||||
console.log(
|
||||
"An error occurred while transferring the file.",
|
||||
this.status,
|
||||
this.statusText,
|
||||
this.responseText
|
||||
);
|
||||
}
|
||||
function onVisited(historyItem) {
|
||||
function onCleaned(results) {
|
||||
if (results.length) {
|
||||
console.log(" was not removed");
|
||||
} else {
|
||||
console.log(" was removed");
|
||||
}
|
||||
}
|
||||
|
||||
function transferCanceled(evt) {
|
||||
console.log(
|
||||
"The transfer has been canceled by the user.",
|
||||
this.status,
|
||||
this.statusText,
|
||||
this.responseText
|
||||
);
|
||||
function onRemoved() {
|
||||
var searching = browser.history.search({
|
||||
text: historyItem.url,
|
||||
startTime: 0
|
||||
});
|
||||
searching.then(onCleaned);
|
||||
}
|
||||
if (!history) {
|
||||
if (i2pHost(historyItem.url)) {
|
||||
var deletingUrl = browser.history.deleteUrl(historyItem.url);
|
||||
}
|
||||
deletingUrl.then(onRemoved);
|
||||
}
|
||||
}
|
||||
|
||||
Http.addEventListener("load", transferComplete);
|
||||
Http.addEventListener("error", transferFailed);
|
||||
Http.addEventListener("abort", transferCanceled);
|
||||
*/
|
||||
|
BIN
lander.png
Normal file
BIN
lander.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 71 KiB |
@@ -5,11 +5,11 @@
|
||||
"strict_min_version": "60.0"
|
||||
}
|
||||
},
|
||||
"content_security_policy": "script-src 'self' 'sha256-AT9pbzcnD9T9Agf3fMgPh55nsx/xONoULxPFvOb93Uo='; object-src 'self'",
|
||||
"permissions": [
|
||||
"theme",
|
||||
"browsingData",
|
||||
"bookmarks",
|
||||
"management",
|
||||
"notifications",
|
||||
"proxy",
|
||||
"privacy",
|
||||
@@ -24,7 +24,8 @@
|
||||
],
|
||||
"manifest_version": 2,
|
||||
"name": "__MSG_extensionName__",
|
||||
"version": "0.46",
|
||||
"version": "0.55",
|
||||
"version_name": "0.55",
|
||||
"description": "__MSG_extensionDescription__",
|
||||
"homepage_url": "https://github.com/eyedeekay/i2psetproxy.js",
|
||||
"icons": {
|
||||
@@ -54,16 +55,22 @@
|
||||
"bookmarks.js"
|
||||
]
|
||||
},
|
||||
"protocol_handlers": [{
|
||||
"protocol": "ext+rc",
|
||||
"name": "RouterConsole",
|
||||
"uriTemplate": "http://127.0.0.1:7657/%s"
|
||||
},
|
||||
{
|
||||
"protocol": "magnet",
|
||||
"name": "I2PTorrent",
|
||||
"uriTemplate": "http://127.0.0.1:7657/i2psnark/?nofilter_newURL=%s&action=Add&foo=Add+torrent"
|
||||
}],
|
||||
"protocol_handlers": [
|
||||
{
|
||||
"protocol": "ext+rc",
|
||||
"name": "RouterConsole",
|
||||
"uriTemplate": "http://127.0.0.1:7657/%s"
|
||||
},
|
||||
{
|
||||
"protocol": "ext+dati2p",
|
||||
"name": "Dat over I2P",
|
||||
"uriTemplate": "/dat.html#!/%s"
|
||||
},
|
||||
{
|
||||
"protocol": "magnet",
|
||||
"name": "I2PTorrent",
|
||||
"uriTemplate": "http://127.0.0.1:7657/i2psnark/?nofilter_newURL=%s&action=Add&foo=Add+torrent"
|
||||
}
|
||||
],
|
||||
"default_locale": "en"
|
||||
}
|
||||
|
||||
|
@@ -1,14 +1,3 @@
|
||||
function isDroid() {
|
||||
var gettingInfo = browser.runtime.getPlatformInfo();
|
||||
gettingInfo.then(got => {
|
||||
if (got.os == "android") {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function SetHostText() {
|
||||
var hostid = document.getElementById("hostText");
|
||||
hostid.textContent = chrome.i18n.getMessage("hostText");
|
||||
@@ -24,174 +13,6 @@ function SetControlHostText() {
|
||||
controlhostid.textContent = chrome.i18n.getMessage("controlHostText");
|
||||
}
|
||||
|
||||
var handleContextProxyRequest = async function(requestDetails) {
|
||||
console.log("(proxy)Searching for proxy by context");
|
||||
try {
|
||||
var handleProxyRequest = function(context) {
|
||||
proxy = {
|
||||
failoverTimeout: 0,
|
||||
proxyDns: false
|
||||
};
|
||||
if (context != undefined) {
|
||||
if (context.name == "i2pbrowser") {
|
||||
proxy = {
|
||||
type: getScheme(),
|
||||
host: getHost(),
|
||||
port: getPort()
|
||||
};
|
||||
console.log(
|
||||
"(proxy)",
|
||||
context.name,
|
||||
"Using",
|
||||
proxy.type,
|
||||
"proxy ",
|
||||
proxy.host + ":" + proxy.port
|
||||
);
|
||||
return proxy;
|
||||
} else if (context.name == "routerconsole") {
|
||||
if (routerHost(requestDetails.url)) {
|
||||
return proxy;
|
||||
} else if (!routerHost(requestDetails.url)) {
|
||||
proxy = {
|
||||
type: "http",
|
||||
host: "localhost",
|
||||
port: "65535"
|
||||
};
|
||||
}
|
||||
proxy = {
|
||||
type: getScheme(),
|
||||
host: getHost(),
|
||||
port: getPort()
|
||||
};
|
||||
console.log(
|
||||
"(proxy)",
|
||||
context.name,
|
||||
"Using",
|
||||
proxy.type,
|
||||
"proxy ",
|
||||
proxy.host + ":" + proxy.port
|
||||
);
|
||||
return proxy;
|
||||
} else if (context.name == "fenced-default") {
|
||||
if (localHost(requestDetails.url)) {
|
||||
if (!routerHost(requestDetails.url)) {
|
||||
proxy = {
|
||||
type: "http",
|
||||
host: "localhost",
|
||||
port: "65535"
|
||||
};
|
||||
}
|
||||
}
|
||||
console.log(
|
||||
"(proxy)",
|
||||
context.name,
|
||||
"Using",
|
||||
proxy.type,
|
||||
"proxy ",
|
||||
proxy.host + ":" + proxy.port
|
||||
);
|
||||
return proxy;
|
||||
}
|
||||
}
|
||||
if (!routerHost(requestDetails.url)) {
|
||||
proxy = {
|
||||
type: "http",
|
||||
host: "localhost",
|
||||
port: "65535"
|
||||
};
|
||||
} else if (i2pHost(requestDetails.url)) {
|
||||
proxy = {
|
||||
type: getScheme(),
|
||||
host: getHost(),
|
||||
port: getPort()
|
||||
};
|
||||
}
|
||||
return proxy;
|
||||
};
|
||||
var contextGet = async function(tabInfo) {
|
||||
try {
|
||||
console.log("(proxy)Tab info from Function", tabInfo);
|
||||
context = await browser.contextualIdentities.get(tabInfo.cookieStoreId);
|
||||
return context;
|
||||
} catch (error) {
|
||||
console.log("(proxy)Context Error", error);
|
||||
}
|
||||
};
|
||||
var tabFind = async function(tabId) {
|
||||
try {
|
||||
context = await browser.contextualIdentities.query({
|
||||
name: "i2pbrowser"
|
||||
});
|
||||
tabId.cookieStoreId = context[0].cookieStoreId;
|
||||
console.log("(proxy) forcing context", tabId.cookieStoreId);
|
||||
return tabId;
|
||||
} catch (error) {
|
||||
console.log("(proxy)Context Error", error);
|
||||
}
|
||||
};
|
||||
var tabGet = async function(tabId) {
|
||||
try {
|
||||
console.log("(proxy)Tab ID from Request", tabId);
|
||||
let tabInfo = await browser.tabs.get(tabId);
|
||||
return tabInfo;
|
||||
} catch (error) {
|
||||
console.log("(proxy)Tab error", error);
|
||||
}
|
||||
};
|
||||
|
||||
if (requestDetails.tabId > 0) {
|
||||
if (proxyHost(requestDetails.url)) {
|
||||
console.log("(Proxy)I2P Proxy test URL detected, ", requestDetails.url);
|
||||
return {
|
||||
type: getScheme(),
|
||||
host: getHost(),
|
||||
port: getPort()
|
||||
};
|
||||
} else if (i2pHost(requestDetails.url)) {
|
||||
console.log("(Proxy)I2P URL detected, ");
|
||||
var tab = tabGet(requestDetails.tabId);
|
||||
var mtab = tab.then(tabFind);
|
||||
requestDetails.tabId = mtab;
|
||||
var context = mtab.then(contextGet);
|
||||
var proxy = await context.then(handleProxyRequest);
|
||||
console.log("(proxy)Returning I2P Proxy", proxy);
|
||||
return proxy;
|
||||
} else {
|
||||
var tab = tabGet(requestDetails.tabId);
|
||||
var context = tab.then(contextGet);
|
||||
var proxy = await context.then(handleProxyRequest);
|
||||
console.log("(proxy)Returning I2P Proxy", proxy);
|
||||
return proxy;
|
||||
}
|
||||
proxy = {
|
||||
type: getScheme(),
|
||||
host: getHost(),
|
||||
port: getPort()
|
||||
};
|
||||
console.log("(proxy)Returning I2P Proxy", proxy);
|
||||
return proxy;
|
||||
}
|
||||
} catch (error) {
|
||||
console.log("(proxy)Not using I2P Proxy.", error);
|
||||
}
|
||||
};
|
||||
|
||||
function setupProxy() {
|
||||
var controlHost = getControlHost();
|
||||
var controlPort = getControlPort();
|
||||
var Host = getHost();
|
||||
var Port = getPort();
|
||||
var Scheme = getScheme();
|
||||
|
||||
/**/
|
||||
console.log("Setting up Firefox WebExtension proxy");
|
||||
browser.proxy.onRequest.addListener(handleContextProxyRequest, {
|
||||
urls: ["<all_urls>"]
|
||||
});
|
||||
console.log("i2p settings created for WebExtension Proxy");
|
||||
/**/
|
||||
}
|
||||
|
||||
function SetControlPortText() {
|
||||
var controlportid = document.getElementById("controlPortText");
|
||||
controlportid.textContent = chrome.i18n.getMessage("controlPortText");
|
||||
@@ -324,6 +145,75 @@ function checkStoredSettings(storedSettings) {
|
||||
gettingInfo.then(gotProxyInfo);
|
||||
}
|
||||
|
||||
function checkAndroidStoredSettings(storedSettings) {
|
||||
let defaultSettings = {};
|
||||
let host = "";
|
||||
let port = "";
|
||||
console.log("proxy", "'" + host + "'", ":", port);
|
||||
if (!storedSettings.proxy_scheme) {
|
||||
defaultSettings["proxy_scheme"] = "http";
|
||||
}
|
||||
if (!storedSettings.proxy_host) {
|
||||
if (host == "") {
|
||||
defaultSettings["proxy_host"] = "127.0.0.1";
|
||||
} else {
|
||||
defaultSettings["proxy_host"] = host;
|
||||
}
|
||||
} else {
|
||||
if (host != "") {
|
||||
defaultSettings["proxy_host"] = host;
|
||||
} else {
|
||||
defaultSettings["proxy_host"] = storedSettings.proxy_host;
|
||||
}
|
||||
}
|
||||
if (!storedSettings.proxy_port) {
|
||||
if (port == undefined) {
|
||||
defaultSettings["proxy_port"] = 4444;
|
||||
} else {
|
||||
defaultSettings["proxy_port"] = port;
|
||||
}
|
||||
} else {
|
||||
if (port != undefined) {
|
||||
defaultSettings["proxy_port"] = port;
|
||||
} else {
|
||||
defaultSettings["proxy_port"] = storedSettings.proxy_port;
|
||||
}
|
||||
}
|
||||
if (!storedSettings.control_host) {
|
||||
if (host == "") {
|
||||
defaultSettings["control_host"] = "127.0.0.1";
|
||||
} else {
|
||||
defaultSettings["control_host"] = host;
|
||||
}
|
||||
} else {
|
||||
if (host != "") {
|
||||
defaultSettings["control_host"] = host;
|
||||
} else {
|
||||
defaultSettings["control_host"] = storedSettings.control_host;
|
||||
}
|
||||
}
|
||||
if (!storedSettings.control_port) {
|
||||
if (port == undefined) {
|
||||
defaultSettings["control_port"] = 4444;
|
||||
} else {
|
||||
defaultSettings["control_port"] = port;
|
||||
}
|
||||
} else {
|
||||
if (port != undefined) {
|
||||
defaultSettings["control_port"] = port;
|
||||
} else {
|
||||
defaultSettings["control_port"] = storedSettings.control_port;
|
||||
}
|
||||
}
|
||||
console.log(
|
||||
defaultSettings["proxy_host"],
|
||||
defaultSettings["proxy_port"],
|
||||
defaultSettings["control_host"],
|
||||
defaultSettings["control_port"]
|
||||
);
|
||||
chrome.storage.local.set(defaultSettings);
|
||||
}
|
||||
|
||||
function onError(e) {
|
||||
console.error(e);
|
||||
}
|
||||
@@ -346,7 +236,6 @@ function storeSettings() {
|
||||
console.log("storing proxy port:", proxy_port);
|
||||
console.log("storing control host:", control_host);
|
||||
console.log("storing control port:", control_port);
|
||||
setupProxy();
|
||||
}
|
||||
|
||||
function updateUI(restoredSettings) {
|
||||
@@ -375,15 +264,25 @@ function updateUI(restoredSettings) {
|
||||
SetControlHostText();
|
||||
SetControlPortText();
|
||||
SetControlHelpText();
|
||||
setupProxy();
|
||||
}
|
||||
|
||||
function onError(e) {
|
||||
console.error(e);
|
||||
}
|
||||
chrome.storage.local.get(function(got) {
|
||||
checkStoredSettings(got);
|
||||
updateUI(got);
|
||||
|
||||
var gettingInfo = browser.runtime.getPlatformInfo();
|
||||
gettingInfo.then(got => {
|
||||
if (got.os != "android") {
|
||||
chrome.storage.local.get(function(got) {
|
||||
checkStoredSettings(got);
|
||||
updateUI(got);
|
||||
});
|
||||
} else {
|
||||
chrome.storage.local.get(function(got) {
|
||||
checkAndroidStoredSettings(got);
|
||||
updateUI(got);
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
const saveButton = document.querySelector("#save-button");
|
||||
|
33
platform.js
33
platform.js
@@ -1,13 +1,26 @@
|
||||
var android = false;
|
||||
|
||||
var gettingInfo = browser.runtime.getPlatformInfo();
|
||||
gettingInfo.then(got => {
|
||||
if (got.os == "android") {
|
||||
console.log("Running in Android detected");
|
||||
android = true;
|
||||
return true;
|
||||
} else {
|
||||
console.log("Running in Desktop detected");
|
||||
android = false;
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
function isDroid() {
|
||||
var gettingInfo = browser.runtime.getPlatformInfo();
|
||||
gettingInfo.then(got => {
|
||||
if (got.os == "android") {
|
||||
console.log("Running in Android detected");
|
||||
return true;
|
||||
} else {
|
||||
console.log("Running in Desktop detected");
|
||||
return false;
|
||||
}
|
||||
});
|
||||
console.log("android?", android);
|
||||
if (android == undefined) {
|
||||
return false;
|
||||
}
|
||||
return android;
|
||||
}
|
||||
|
||||
function notClosable() {
|
||||
return false;
|
||||
}
|
||||
|
160
privacy.js
160
privacy.js
@@ -1,13 +1,4 @@
|
||||
var webpref = chrome.i18n.getMessage("webPreface");
|
||||
var webprefpriv = chrome.i18n.getMessage("webPrefacePrivate");
|
||||
var routerpref = chrome.i18n.getMessage("routerPreface");
|
||||
var routerprefpriv = chrome.i18n.getMessage("routerPrefacePrivate");
|
||||
var mailpref = chrome.i18n.getMessage("mailPreface");
|
||||
var mailprefpriv = chrome.i18n.getMessage("mailPrefacePrivate");
|
||||
var torrentpref = chrome.i18n.getMessage("torrentPreface");
|
||||
var torrentprefpriv = chrome.i18n.getMessage("torrentPrefacePrivate");
|
||||
var tunnelpref = chrome.i18n.getMessage("i2ptunnelPreface");
|
||||
var tunnelprefpriv = chrome.i18n.getMessage("i2ptunnelPrefacePrivate");
|
||||
var titlepref = chrome.i18n.getMessage("titlePreface");
|
||||
|
||||
function onSet(result) {
|
||||
if (result) {
|
||||
@@ -86,7 +77,7 @@ function disableReferrers() {
|
||||
|
||||
// enable fingerprinting resistent features(letterboxing and stuff)
|
||||
function enableResistFingerprinting() {
|
||||
var setting = browser.privacy.websites.referrersEnabled.set({
|
||||
var setting = browser.privacy.websites.resistFingerprinting.set({
|
||||
value: true
|
||||
});
|
||||
console.log("Enabling resist fingerprinting/val=", {
|
||||
@@ -139,32 +130,58 @@ function setAllPrivacy() {
|
||||
setAllPrivacy();
|
||||
|
||||
function ResetPeerConnection() {
|
||||
browser.privacy.network.peerConnectionEnabled.set({
|
||||
value: false
|
||||
});
|
||||
browser.privacy.network.networkPredictionEnabled.set({
|
||||
value: false
|
||||
});
|
||||
chrome.privacy.network.webRTCIPHandlingPolicy.set({
|
||||
value: "disable_non_proxied_udp"
|
||||
});
|
||||
console.log("Re-disabled WebRTC");
|
||||
function reset(snowflake) {
|
||||
var webrtc = false;
|
||||
console.log("No snowflake plugin found, pre-disabled WebRTC");
|
||||
var rtc = browser.privacy.network.peerConnectionEnabled.set({
|
||||
value: webrtc
|
||||
});
|
||||
rtc.then(AssurePeerConnection);
|
||||
}
|
||||
function snowflake(snowflake) {
|
||||
console.log("snowflake plugin found, leaving WebRTC alone", snowflake);
|
||||
EnablePeerConnection();
|
||||
}
|
||||
var snowflakeInfo = browser.management.get(
|
||||
"{b11bea1f-a888-4332-8d8a-cec2be7d24b9}" // string
|
||||
);
|
||||
snowflakeInfo.then(snowflake, reset);
|
||||
}
|
||||
|
||||
function EnablePeerConnection() {
|
||||
browser.privacy.network.peerConnectionEnabled.set({
|
||||
value: true
|
||||
});
|
||||
browser.privacy.network.networkPredictionEnabled.set({
|
||||
value: false
|
||||
});
|
||||
chrome.privacy.network.webRTCIPHandlingPolicy.set({
|
||||
value: "disable_non_proxied_udp"
|
||||
var webrtc = true;
|
||||
var rtc = browser.privacy.network.peerConnectionEnabled.set({
|
||||
value: webrtc
|
||||
});
|
||||
rtc.then(AssurePeerConnection);
|
||||
console.log("Enabled WebRTC");
|
||||
}
|
||||
|
||||
ResetPeerConnection();
|
||||
function AssurePeerConnection() {
|
||||
function assure(webrtc) {
|
||||
browser.privacy.network.peerConnectionEnabled.set({
|
||||
value: webrtc.value
|
||||
});
|
||||
browser.privacy.network.networkPredictionEnabled.set({
|
||||
value: false
|
||||
});
|
||||
chrome.privacy.network.webRTCIPHandlingPolicy.set({
|
||||
value: "proxy_only"
|
||||
});
|
||||
}
|
||||
let rtc = browser.privacy.network.peerConnectionEnabled.get({});
|
||||
rtc.then(assure);
|
||||
}
|
||||
|
||||
var gettingInfo = browser.runtime.getPlatformInfo();
|
||||
gettingInfo.then(got => {
|
||||
if (got.os == "android") {
|
||||
browser.tabs.onCreated.addListener(ResetPeerConnection);
|
||||
} else {
|
||||
browser.windows.onCreated.addListener(ResetPeerConnection);
|
||||
}
|
||||
});
|
||||
//AssurePeerConnection();
|
||||
|
||||
function ResetDisableSavePasswords() {
|
||||
browser.privacy.services.passwordSavingEnabled.set({
|
||||
@@ -187,24 +204,10 @@ var defaultSettings = {
|
||||
dataTypes: ["downloads", "passwords", "formData", "localStorage", "history"]
|
||||
};
|
||||
|
||||
var appSettings = {
|
||||
since: "forever",
|
||||
dataTypes: [""]
|
||||
};
|
||||
|
||||
function onError(e) {
|
||||
console.error(e);
|
||||
function onError(therror) {
|
||||
console.error(therror);
|
||||
}
|
||||
|
||||
function checkStoredSettings(storedSettings) {
|
||||
chrome.storage.local.set(appSettings);
|
||||
}
|
||||
|
||||
const gettingStoredSettings = browser.storage.local.get();
|
||||
gettingStoredSettings.then(checkStoredSettings, onError);
|
||||
|
||||
function clearCookiesContext(cookieStoreId) {}
|
||||
|
||||
function forgetBrowsingData(storedSettings) {
|
||||
function getSince(selectedSince) {
|
||||
if (selectedSince === "forever") {
|
||||
@@ -244,7 +247,7 @@ function forgetBrowsingData(storedSettings) {
|
||||
|
||||
function deepCleanHistory(historyItems) {
|
||||
console.log("Deep cleaning history");
|
||||
for (item of historyItems) {
|
||||
for (let item of historyItems) {
|
||||
if (i2pHost(item.url)) {
|
||||
browser.history.deleteUrl({
|
||||
url: item.url
|
||||
@@ -256,48 +259,48 @@ function forgetBrowsingData(storedSettings) {
|
||||
hostnames: [i2pHostName(item.url)],
|
||||
since
|
||||
})
|
||||
.then(onGot);
|
||||
.then(onContextGotLog);
|
||||
console.log("cleared Passwords");
|
||||
browser.browsingData
|
||||
.removeDownloads({
|
||||
hostnames: [i2pHostName(item.url)],
|
||||
since
|
||||
})
|
||||
.then(onGot);
|
||||
.then(onContextGotLog);
|
||||
console.log("cleared Downloads");
|
||||
browser.browsingData
|
||||
.removeFormData({
|
||||
hostnames: [i2pHostName(item.url)],
|
||||
since
|
||||
})
|
||||
.then(onGot);
|
||||
.then(onContextGotLog);
|
||||
console.log("cleared Form Data");
|
||||
browser.browsingData
|
||||
.removeLocalStorage({
|
||||
hostnames: [i2pHostName(item.url)],
|
||||
since
|
||||
})
|
||||
.then(onGot);
|
||||
.then(onContextGotLog);
|
||||
console.log("cleared Local Storage");
|
||||
|
||||
contexts = browser.contextualIdentities.query({
|
||||
let contexts = browser.contextualIdentities.query({
|
||||
name: titlepref
|
||||
});
|
||||
|
||||
function deepCleanCookies(cookies) {
|
||||
for (cookie of cookies) {
|
||||
for (let cookie of cookies) {
|
||||
var removing = browser.cookies.remove({
|
||||
firstPartyDomain: cookie.firstPartyDomain,
|
||||
name: cookie.name,
|
||||
url: item.url
|
||||
});
|
||||
removing.then(onGot, onError);
|
||||
removing.then(onContextGotLog, onError);
|
||||
}
|
||||
console.log("Cleared cookies");
|
||||
}
|
||||
|
||||
function deepCleanContext(cookieStoreIds) {
|
||||
for (cookieStoreId of cookieStoreIds) {
|
||||
for (let cookieStoreId of cookieStoreIds) {
|
||||
var removing = browser.cookies.getAll({
|
||||
firstPartyDomain: null,
|
||||
storeId: cookieStoreId.cookieStoreId
|
||||
@@ -338,8 +341,8 @@ function i2pHost(url) {
|
||||
return hostname.endsWith(".i2p");
|
||||
}
|
||||
|
||||
function onGot(contexts) {
|
||||
if (contexts != null) {
|
||||
function onContextGotLog(contexts) {
|
||||
if (contexts !== null) {
|
||||
for (let context of contexts) {
|
||||
console.log(context);
|
||||
}
|
||||
@@ -348,13 +351,48 @@ function onGot(contexts) {
|
||||
|
||||
browser.runtime.onMessage.addListener(message);
|
||||
|
||||
function message(message) {
|
||||
console.log(message);
|
||||
if (message.rtc === "enableWebRTC") {
|
||||
function enableHistory() {
|
||||
function checkStoredSettings(storedSettings) {
|
||||
storedSettings["disable_history"] = false;
|
||||
console.log(storedSettings);
|
||||
function enablehistory(settings) {
|
||||
console.log("Store History:", settings);
|
||||
}
|
||||
let setting = browser.storage.local.set(storedSettings);
|
||||
setting.then(enablehistory);
|
||||
}
|
||||
const gettingStoredSettings = browser.storage.local.get();
|
||||
gettingStoredSettings.then(checkStoredSettings, onError);
|
||||
}
|
||||
|
||||
function disableHistory() {
|
||||
function checkStoredSettings(storedSettings) {
|
||||
storedSettings["disable_history"] = true;
|
||||
console.log(storedSettings);
|
||||
function enablehistory(settings) {
|
||||
console.log("Store History:", settings);
|
||||
}
|
||||
var setting = browser.storage.local.set(storedSettings);
|
||||
setting.then(enablehistory);
|
||||
}
|
||||
const gettingStoredSettings = browser.storage.local.get();
|
||||
gettingStoredSettings.then(checkStoredSettings, onError);
|
||||
}
|
||||
|
||||
function message(recieved) {
|
||||
console.log(recieved);
|
||||
if (recieved.rtc === "enableWebRTC") {
|
||||
console.log("enableWebRTC");
|
||||
EnablePeerConnection();
|
||||
} else {
|
||||
} else if (recieved.rtc === "disableWebRTC") {
|
||||
console.log("disableWebRTC");
|
||||
ResetPeerConnection();
|
||||
}
|
||||
if (recieved.history === "enableHistory") {
|
||||
console.log("enableHistory");
|
||||
enableHistory();
|
||||
} else if (recieved.history === "disableHistory") {
|
||||
console.log("disableHistory");
|
||||
disableHistory();
|
||||
}
|
||||
}
|
||||
|
325
proxy.js
325
proxy.js
@@ -1,13 +1,7 @@
|
||||
var titlepref = chrome.i18n.getMessage("titlePreface");
|
||||
var webpref = chrome.i18n.getMessage("webPreface");
|
||||
var webprefpriv = chrome.i18n.getMessage("webPrefacePrivate");
|
||||
var routerpref = chrome.i18n.getMessage("routerPreface");
|
||||
var routerprefpriv = chrome.i18n.getMessage("routerPrefacePrivate");
|
||||
var mailpref = chrome.i18n.getMessage("mailPreface");
|
||||
var mailprefpriv = chrome.i18n.getMessage("mailPrefacePrivate");
|
||||
var torrentpref = chrome.i18n.getMessage("torrentPreface");
|
||||
var torrentprefpriv = chrome.i18n.getMessage("torrentPrefacePrivate");
|
||||
var tunnelpref = chrome.i18n.getMessage("i2ptunnelPreface");
|
||||
var tunnelprefpriv = chrome.i18n.getMessage("i2ptunnelPrefacePrivate");
|
||||
|
||||
browser.privacy.network.peerConnectionEnabled.set({
|
||||
value: false
|
||||
@@ -33,6 +27,10 @@ var handleContextProxyRequest = async function(requestDetails) {
|
||||
failoverTimeout: 0,
|
||||
proxyDns: false
|
||||
};
|
||||
if (context == "firefox-default" || context == "firefox-private") {
|
||||
proxy = null;
|
||||
return proxy;
|
||||
}
|
||||
if (context != undefined) {
|
||||
if (context.name == titlepref) {
|
||||
proxy = {
|
||||
@@ -40,14 +38,9 @@ var handleContextProxyRequest = async function(requestDetails) {
|
||||
host: getHost(),
|
||||
port: getPort()
|
||||
};
|
||||
console.log(
|
||||
"(proxy)",
|
||||
context.name,
|
||||
"Using",
|
||||
proxy.type,
|
||||
"proxy ",
|
||||
proxy.host + ":" + proxy.port
|
||||
);
|
||||
console.log("(proxy)", context.name);
|
||||
console.log("Using", proxy.type);
|
||||
console.log("proxy ", proxy.host + ":" + proxy.port);
|
||||
return proxy;
|
||||
} else if (context.name == routerpref) {
|
||||
if (routerHost(requestDetails.url)) {
|
||||
@@ -64,14 +57,9 @@ var handleContextProxyRequest = async function(requestDetails) {
|
||||
host: getHost(),
|
||||
port: getPort()
|
||||
};
|
||||
console.log(
|
||||
"(proxy)",
|
||||
context.name,
|
||||
"Using",
|
||||
proxy.type,
|
||||
"proxy ",
|
||||
proxy.host + ":" + proxy.port
|
||||
);
|
||||
console.log("(proxy)", context.name);
|
||||
console.log("Using", proxy.type);
|
||||
console.log("proxy ", proxy.host + ":" + proxy.port);
|
||||
return proxy;
|
||||
} else if (context.name == webpref) {
|
||||
if (localHost(requestDetails.url)) {
|
||||
@@ -83,28 +71,23 @@ var handleContextProxyRequest = async function(requestDetails) {
|
||||
};
|
||||
}
|
||||
}
|
||||
console.log(
|
||||
"(proxy)",
|
||||
context.name,
|
||||
"Using",
|
||||
proxy.type,
|
||||
"proxy ",
|
||||
proxy.host + ":" + proxy.port
|
||||
);
|
||||
console.log("(proxy)", context.name);
|
||||
console.log("Using", proxy.type);
|
||||
console.log("proxy ", proxy.host + ":" + proxy.port);
|
||||
return proxy;
|
||||
}
|
||||
}
|
||||
if (!routerHost(requestDetails.url)) {
|
||||
if (localHost(requestDetails.url)) {
|
||||
console.log(
|
||||
"(proxy) non-routerconsole localhost url, dropping",
|
||||
"(proxy) non-routerconsole localhost url, will not interfere",
|
||||
requestDetails.url
|
||||
);
|
||||
proxy = {
|
||||
/*proxy = {
|
||||
type: "http",
|
||||
host: "localhost",
|
||||
port: "65535"
|
||||
};
|
||||
};*/
|
||||
}
|
||||
} else if (i2pHost(requestDetails.url)) {
|
||||
proxy = {
|
||||
@@ -121,15 +104,8 @@ var handleContextProxyRequest = async function(requestDetails) {
|
||||
context = await browser.contextualIdentities.get(tabInfo.cookieStoreId);
|
||||
return context;
|
||||
} catch (error) {
|
||||
console.log("(proxy)Context Error", error);
|
||||
}
|
||||
};
|
||||
var tabFind = async function(tabId) {
|
||||
try {
|
||||
console.log("(proxy) forcing context", tabId.cookieStoreId);
|
||||
return tabId;
|
||||
} catch (error) {
|
||||
console.log("(proxy)Context Error", error);
|
||||
console.error(error);
|
||||
//return; //"firefox-default";
|
||||
}
|
||||
};
|
||||
var tabGet = async function(tabId) {
|
||||
@@ -141,7 +117,12 @@ var handleContextProxyRequest = async function(requestDetails) {
|
||||
console.log("(proxy)Tab error", error);
|
||||
}
|
||||
};
|
||||
|
||||
if (
|
||||
requestDetails.cookieStoreId == "firefox-default" ||
|
||||
requestDetails.cookieStoreId == "firefox-private"
|
||||
) {
|
||||
return browser.proxy.settings.get({});
|
||||
}
|
||||
if (requestDetails.tabId > 0) {
|
||||
console.log("manifest", requestDetails);
|
||||
if (proxyHost(requestDetails.url)) {
|
||||
@@ -151,12 +132,13 @@ var handleContextProxyRequest = async function(requestDetails) {
|
||||
port: getPort()
|
||||
};
|
||||
return proxy;
|
||||
} else if (extensionHost(requestDetails.url)) {
|
||||
return;
|
||||
} else if (i2pHost(requestDetails.url)) {
|
||||
console.log("(Proxy)I2P URL detected, ");
|
||||
var tab = tabGet(requestDetails.tabId);
|
||||
var mtab = tab.then(tabFind);
|
||||
requestDetails.tabId = mtab;
|
||||
var context = mtab.then(contextGet);
|
||||
requestDetails.tabId = tab;
|
||||
var context = tab.then(contextGet);
|
||||
var proxy = await context.then(handleProxyRequest);
|
||||
console.log("(proxy)Returning I2P Proxy", proxy);
|
||||
return proxy;
|
||||
@@ -167,9 +149,9 @@ var handleContextProxyRequest = async function(requestDetails) {
|
||||
console.log("(proxy)Returning I2P Proxy", proxy);
|
||||
return proxy;
|
||||
}
|
||||
proxy = {};
|
||||
/*proxy = {};
|
||||
console.log("(proxy)Returning unset Proxy", proxy);
|
||||
return proxy;
|
||||
return proxy;*/
|
||||
}
|
||||
} catch (error) {
|
||||
console.log("(proxy)Not using I2P Proxy.", error);
|
||||
@@ -177,6 +159,116 @@ var handleContextProxyRequest = async function(requestDetails) {
|
||||
};
|
||||
|
||||
var proxy_scheme = "HTTP";
|
||||
var proxy_host = "127.0.0.1";
|
||||
var proxy_port = "4444";
|
||||
var control_host = "127.0.0.1";
|
||||
var control_port = "4444";
|
||||
var disable_history = false;
|
||||
|
||||
function SetupSettings() {
|
||||
console.log("Initialising Settings");
|
||||
function onSetupError() {
|
||||
console.log("Settings initialization error");
|
||||
}
|
||||
//
|
||||
function checkSchemeStoredSettings(storedSettings) {
|
||||
if (storedSettings.proxy_scheme === undefined) {
|
||||
proxy_scheme = "http";
|
||||
storedSettings.proxy_scheme = proxy_scheme;
|
||||
} else {
|
||||
proxy_scheme = storedSettings.proxy_scheme;
|
||||
}
|
||||
console.log("Initialising Proxy Scheme", storedSettings.proxy_scheme);
|
||||
setupProxy();
|
||||
}
|
||||
var gettingSchemeStoredSettings = browser.storage.local.get("proxy_scheme");
|
||||
gettingSchemeStoredSettings.then(checkSchemeStoredSettings, onSetupError);
|
||||
|
||||
//
|
||||
function checkHostStoredSettings(storedSettings) {
|
||||
if (storedSettings.proxy_host == undefined) {
|
||||
proxy_host = "127.0.0.1";
|
||||
storedSettings.proxy_host = proxy_host;
|
||||
} else {
|
||||
proxy_host = storedSettings.proxy_host;
|
||||
}
|
||||
console.log("Initialising Host", storedSettings.proxy_host);
|
||||
setupProxy();
|
||||
}
|
||||
var gettingHostStoredSettings = browser.storage.local.get("proxy_host");
|
||||
gettingHostStoredSettings.then(checkHostStoredSettings, onSetupError);
|
||||
|
||||
//
|
||||
function checkPortStoredSettings(storedSettings) {
|
||||
if (storedSettings.proxy_port == undefined) {
|
||||
proxy_port = "4444";
|
||||
storedSettings.proxy_port = proxy_port;
|
||||
} else {
|
||||
proxy_port = storedSettings.proxy_port;
|
||||
}
|
||||
console.log("Initialising Port", storedSettings.proxy_port);
|
||||
setupProxy();
|
||||
}
|
||||
var gettingPortStoredSettings = browser.storage.local.get("proxy_port");
|
||||
gettingPortStoredSettings.then(checkPortStoredSettings, onSetupError);
|
||||
|
||||
//
|
||||
function checkControlHostStoredSettings(storedSettings) {
|
||||
if (storedSettings.control_host == undefined) {
|
||||
control_host = "127.0.0.1";
|
||||
storedSettings.control_host = control_host;
|
||||
} else {
|
||||
control_host = storedSettings.control_host;
|
||||
}
|
||||
console.log("Initialising Control Host", storedSettings.control_host);
|
||||
setupProxy();
|
||||
}
|
||||
var gettingControlHostStoredSettings = browser.storage.local.get(
|
||||
"control_host"
|
||||
);
|
||||
gettingControlHostStoredSettings.then(
|
||||
checkControlHostStoredSettings,
|
||||
onSetupError
|
||||
);
|
||||
|
||||
//
|
||||
function checkControlPortStoredSettings(storedSettings) {
|
||||
if (storedSettings.control_port == undefined) {
|
||||
let new_control_port = "7657";
|
||||
storedSettings.control_port = new_control_port;
|
||||
} else {
|
||||
let control_port = storedSettings.control_port;
|
||||
}
|
||||
console.log("Initialising Control Port", storedSettings.control_port);
|
||||
setupProxy();
|
||||
}
|
||||
var gettingControlPortStoredSettings = browser.storage.local.get(
|
||||
"control_port"
|
||||
);
|
||||
gettingControlPortStoredSettings.then(
|
||||
checkControlPortStoredSettings,
|
||||
onSetupError
|
||||
);
|
||||
|
||||
//
|
||||
function checkHistoryStoredSettings(storedSettings) {
|
||||
if (storedSettings.disable_history == undefined) {
|
||||
disable_history = false;
|
||||
storedSettings.disable_history = disable_history;
|
||||
} else {
|
||||
disable_history = storedSettings.disable_history;
|
||||
}
|
||||
console.log(
|
||||
"Initialising Disabled History",
|
||||
storedSettings.disable_history
|
||||
);
|
||||
setupProxy();
|
||||
}
|
||||
var gettingHistoryStoredSettings = browser.storage.local.get(
|
||||
"disable_history"
|
||||
);
|
||||
gettingHistoryStoredSettings.then(checkHistoryStoredSettings, onSetupError);
|
||||
}
|
||||
|
||||
function getScheme() {
|
||||
if (proxy_scheme == undefined) {
|
||||
@@ -195,13 +287,6 @@ function getScheme() {
|
||||
return proxy_scheme;
|
||||
}
|
||||
|
||||
/*
|
||||
var proxy_host = "127.0.0.1";
|
||||
var proxy_port = "4444";
|
||||
var control_host = "127.0.0.1";
|
||||
var control_port = "4444";
|
||||
*/
|
||||
|
||||
function getHost() {
|
||||
if (proxy_host == undefined) {
|
||||
proxy_host = "127.0.0.1";
|
||||
@@ -230,18 +315,12 @@ function getControlHost() {
|
||||
|
||||
function getControlPort() {
|
||||
if (control_port == undefined) {
|
||||
return "4444";
|
||||
return "7657";
|
||||
}
|
||||
return control_port;
|
||||
}
|
||||
|
||||
function setupProxy() {
|
||||
var controlHost = getControlHost();
|
||||
var controlPort = getControlPort();
|
||||
var Host = getHost();
|
||||
var Port = getPort();
|
||||
var Scheme = getScheme();
|
||||
|
||||
/**/
|
||||
console.log("Setting up Firefox WebExtension proxy");
|
||||
browser.proxy.onRequest.addListener(handleContextProxyRequest, {
|
||||
@@ -251,107 +330,35 @@ function setupProxy() {
|
||||
/**/
|
||||
}
|
||||
|
||||
function checkStoredSettings(storedSettings) {
|
||||
function gotProxyInfo(info) {
|
||||
let defaultSettings = {};
|
||||
let host = info.value.http.split(":")[0];
|
||||
let port = info.value.http.split(":")[1];
|
||||
console.log("proxy", "'" + host + "'", ":", port);
|
||||
if (!storedSettings.proxy_scheme) {
|
||||
defaultSettings["proxy_scheme"] = "http";
|
||||
}
|
||||
if (!storedSettings.proxy_host) {
|
||||
if (host == "") {
|
||||
defaultSettings["proxy_host"] = "127.0.0.1";
|
||||
} else {
|
||||
defaultSettings["proxy_host"] = host;
|
||||
}
|
||||
} else {
|
||||
if (host != "") {
|
||||
defaultSettings["proxy_host"] = host;
|
||||
} else {
|
||||
defaultSettings["proxy_host"] = storedSettings.proxy_host;
|
||||
}
|
||||
}
|
||||
if (!storedSettings.proxy_port) {
|
||||
if (port == undefined) {
|
||||
defaultSettings["proxy_port"] = 4444;
|
||||
} else {
|
||||
defaultSettings["proxy_port"] = port;
|
||||
}
|
||||
} else {
|
||||
if (port != undefined) {
|
||||
defaultSettings["proxy_port"] = port;
|
||||
} else {
|
||||
defaultSettings["proxy_port"] = storedSettings.proxy_port;
|
||||
}
|
||||
}
|
||||
if (!storedSettings.control_host) {
|
||||
if (host == "") {
|
||||
defaultSettings["control_host"] = "127.0.0.1";
|
||||
} else {
|
||||
defaultSettings["control_host"] = host;
|
||||
}
|
||||
} else {
|
||||
if (host != "") {
|
||||
defaultSettings["control_host"] = host;
|
||||
} else {
|
||||
defaultSettings["control_host"] = storedSettings.control_host;
|
||||
}
|
||||
}
|
||||
if (!storedSettings.control_port) {
|
||||
if (port == undefined) {
|
||||
defaultSettings["control_port"] = 4444;
|
||||
} else {
|
||||
defaultSettings["control_port"] = port;
|
||||
}
|
||||
} else {
|
||||
if (port != undefined) {
|
||||
defaultSettings["control_port"] = port;
|
||||
} else {
|
||||
defaultSettings["control_port"] = storedSettings.control_port;
|
||||
}
|
||||
}
|
||||
console.log("(browserinfo) NATIVE PROXYSETTINGS", info.value);
|
||||
console.log(
|
||||
defaultSettings["proxy_host"],
|
||||
defaultSettings["proxy_port"],
|
||||
defaultSettings["control_host"],
|
||||
defaultSettings["control_port"]
|
||||
);
|
||||
chrome.storage.local.set(defaultSettings);
|
||||
}
|
||||
var gettingInfo = browser.proxy.settings.get({});
|
||||
gettingInfo.then(gotProxyInfo);
|
||||
}
|
||||
|
||||
//function gotProxyInfo(info) {
|
||||
//console.log("(browserinfo)", info.value);
|
||||
//}
|
||||
|
||||
//var gettingInfo = browser.proxy.settings.get({});
|
||||
//gettingInfo.then(gotProxyInfo);
|
||||
|
||||
function update(restoredSettings) {
|
||||
proxy_scheme = restoredSettings.proxy_scheme;
|
||||
function update() {
|
||||
console.log("restoring proxy scheme:", proxy_scheme);
|
||||
proxy_host = restoredSettings.proxy_host;
|
||||
console.log("restoring proxy host:", proxy_host);
|
||||
proxy_port = restoredSettings.proxy_port;
|
||||
console.log("restoring proxy port:", proxy_port);
|
||||
control_host = restoredSettings.control_host;
|
||||
console.log("restoring control host:", control_host);
|
||||
control_port = restoredSettings.control_port;
|
||||
console.log("restoring control port:", control_port);
|
||||
}
|
||||
|
||||
chrome.storage.local.get(function(got) {
|
||||
checkStoredSettings(got);
|
||||
update(got);
|
||||
setupProxy();
|
||||
});
|
||||
|
||||
// Theme all currently open windows
|
||||
if (!isDroid()) {
|
||||
browser.windows.getAll().then(wins => wins.forEach(themeWindow));
|
||||
function updateFromStorage() {
|
||||
console.log("updating settings from storage");
|
||||
var gettingInfo = browser.runtime.getPlatformInfo();
|
||||
gettingInfo.then(got => {
|
||||
if (got.os == "android") {
|
||||
chrome.storage.local.get(function() {
|
||||
SetupSettings();
|
||||
update();
|
||||
setupProxy();
|
||||
});
|
||||
} else {
|
||||
browser.windows.getAll().then(wins => wins.forEach(themeWindow));
|
||||
chrome.storage.local.get(function() {
|
||||
SetupSettings();
|
||||
update();
|
||||
setupProxy();
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
browser.storage.onChanged.addListener(updateFromStorage);
|
||||
SetupSettings();
|
||||
setupProxy();
|
||||
|
361
scrub.js
361
scrub.js
@@ -1,24 +1,22 @@
|
||||
var titlepref = chrome.i18n.getMessage("titlePreface");
|
||||
var titleprefpriv = chrome.i18n.getMessage("titlePrefacePrivate");
|
||||
var webpref = chrome.i18n.getMessage("webPreface");
|
||||
var webprefpriv = chrome.i18n.getMessage("webPrefacePrivate");
|
||||
var routerpref = chrome.i18n.getMessage("routerPreface");
|
||||
var routerprefpriv = chrome.i18n.getMessage("routerPrefacePrivate");
|
||||
var mailpref = chrome.i18n.getMessage("mailPreface");
|
||||
var mailprefpriv = chrome.i18n.getMessage("mailPrefacePrivate");
|
||||
var torrentpref = chrome.i18n.getMessage("torrentPreface");
|
||||
var torrentprefpriv = chrome.i18n.getMessage("torrentPrefacePrivate");
|
||||
var tunnelpref = chrome.i18n.getMessage("i2ptunnelPreface");
|
||||
var tunnelprefpriv = chrome.i18n.getMessage("i2ptunnelPrefacePrivate");
|
||||
var localpref = chrome.i18n.getMessage("localPreface");
|
||||
|
||||
var contextScrub = async function(requestDetails) {
|
||||
function onHeaderError() {
|
||||
console.log("Header scrub error");
|
||||
}
|
||||
console.log("(scrub)Scrubbing info from contextualized request");
|
||||
try {
|
||||
var headerScrub = function(context) {
|
||||
var ua = "MYOB/6.66 (AN/ON)";
|
||||
if (!context) {
|
||||
console.error("Context not found");
|
||||
console.log("Context not found", context);
|
||||
} else if (context.name == titlepref) {
|
||||
var ua = "MYOB/6.66 (AN/ON)";
|
||||
if (i2pHost(requestDetails.url)) {
|
||||
for (var header of requestDetails.requestHeaders) {
|
||||
if (header.name.toLowerCase() === "user-agent") {
|
||||
@@ -31,7 +29,6 @@ var contextScrub = async function(requestDetails) {
|
||||
requestHeaders: requestDetails.requestHeaders
|
||||
};
|
||||
} else if (context.name == routerpref) {
|
||||
var ua = "MYOB/6.66 (AN/ON)";
|
||||
if (i2pHost(requestDetails.url)) {
|
||||
for (var header of requestDetails.requestHeaders) {
|
||||
if (header.name.toLowerCase() === "user-agent") {
|
||||
@@ -39,7 +36,6 @@ var contextScrub = async function(requestDetails) {
|
||||
console.log("(scrub)User-Agent header modified", header.value);
|
||||
}
|
||||
}
|
||||
} else if (routerHost(requestDetails.url)) {
|
||||
}
|
||||
return {
|
||||
requestHeaders: requestDetails.requestHeaders
|
||||
@@ -49,22 +45,12 @@ var contextScrub = async function(requestDetails) {
|
||||
var contextGet = async function(tabInfo) {
|
||||
try {
|
||||
console.log("(scrub)Tab info from Function", tabInfo);
|
||||
context = await browser.contextualIdentities.get(tabInfo.cookieStoreId);
|
||||
let context = await browser.contextualIdentities.get(
|
||||
tabInfo.cookieStoreId
|
||||
);
|
||||
return context;
|
||||
} catch (error) {
|
||||
console.log("(scrub)Conext Error", error);
|
||||
}
|
||||
};
|
||||
var tabFind = async function(tabId) {
|
||||
try {
|
||||
context = await browser.contextualIdentities.query({
|
||||
name: titlepref
|
||||
});
|
||||
tabId.cookieStoreId = context[0].cookieStoreId;
|
||||
console.log("(scrub) forcing context", tabId.cookieStoreId);
|
||||
return tabId;
|
||||
} catch (error) {
|
||||
console.log("(scrub)Context Error", error);
|
||||
return undefined;
|
||||
}
|
||||
};
|
||||
var tabGet = async function(tabId) {
|
||||
@@ -73,7 +59,7 @@ var contextScrub = async function(requestDetails) {
|
||||
let tabInfo = await browser.tabs.get(tabId);
|
||||
return tabInfo;
|
||||
} catch (error) {
|
||||
console.log("(scrub)Tab error", error);
|
||||
return undefined;
|
||||
}
|
||||
};
|
||||
if (requestDetails.tabId > 0) {
|
||||
@@ -81,18 +67,16 @@ var contextScrub = async function(requestDetails) {
|
||||
var context = {};
|
||||
var req = {};
|
||||
if (i2pHost(requestDetails.url)) {
|
||||
console.log("(Proxy)I2P URL detected, ");
|
||||
console.log("(scrub)I2P URL detected, ");
|
||||
tab = tabGet(requestDetails.tabId);
|
||||
var mtab = tab.then(tabFind);
|
||||
requestDetails.tabId = mtab;
|
||||
context = mtab.then(contextGet);
|
||||
req = await context.then(headerScrub);
|
||||
context = tab.then(contextGet, onHeaderError);
|
||||
req = await context.then(headerScrub, onHeaderError);
|
||||
console.log("(scrub)Scrubbing I2P Request", req);
|
||||
return req;
|
||||
} else if (routerHost(requestDetails.url)) {
|
||||
tab = tabGet(requestDetails.tabId);
|
||||
context = tab.then(contextGet);
|
||||
req = await context.then(headerScrub);
|
||||
context = tab.then(contextGet, onHeaderError);
|
||||
req = await context.then(headerScrub, onHeaderError);
|
||||
console.log("(scrub)Scrubbing non-I2P Request", req);
|
||||
return req;
|
||||
}
|
||||
@@ -103,41 +87,41 @@ var contextScrub = async function(requestDetails) {
|
||||
}
|
||||
};
|
||||
|
||||
var contextSetup = async function(requestDetails) {
|
||||
var contextSetup = function(requestDetails) {
|
||||
function onContextError() {
|
||||
console.log("Context launcher error");
|
||||
}
|
||||
console.log("(isolate)Forcing I2P requests into context");
|
||||
try {
|
||||
var tabFind = async function(tabId) {
|
||||
var i2pTabFind = async function(tabId) {
|
||||
try {
|
||||
var context = await browser.contextualIdentities.query({
|
||||
name: titlepref
|
||||
});
|
||||
if (tabId.cookieStoreId != context[0].cookieStoreId) {
|
||||
console.log(
|
||||
"(isolate) forcing I2P Browsing",
|
||||
requestDetails.url,
|
||||
" context",
|
||||
tabId.cookieStoreId,
|
||||
context[0].cookieStoreId
|
||||
);
|
||||
function Create(window) {
|
||||
console.log("(isolate) I2P context", context[0].cookieStoreId);
|
||||
console.log("tab context", tabId.cookieStoreId);
|
||||
function Create() {
|
||||
function onCreated(tab) {
|
||||
console.log("(isolate) Closing old, un-isolated tab", window);
|
||||
browser.tabs.remove(tabId.id);
|
||||
browser.tabs.remove(window.tabs[0].id);
|
||||
}
|
||||
function onError(error) {
|
||||
console.log(`Error: ${error}`);
|
||||
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);
|
||||
}
|
||||
}
|
||||
closeOldTab(tab);
|
||||
}
|
||||
var created = browser.tabs.create({
|
||||
active: true,
|
||||
cookieStoreId: context[0].cookieStoreId,
|
||||
url: requestDetails.url,
|
||||
windowId: window.id
|
||||
url: requestDetails.url
|
||||
});
|
||||
created.then(onCreated, onError);
|
||||
created.then(onCreated, onContextError);
|
||||
}
|
||||
var getting = browser.windows.getCurrent();
|
||||
getting.then(Create);
|
||||
var gettab = browser.tabs.get(tabId.id);
|
||||
gettab.then(Create, onContextError);
|
||||
return tabId;
|
||||
}
|
||||
} catch (error) {
|
||||
@@ -150,32 +134,29 @@ var contextSetup = async function(requestDetails) {
|
||||
name: routerpref
|
||||
});
|
||||
if (tabId.cookieStoreId != context[0].cookieStoreId) {
|
||||
console.log(
|
||||
"(isolate) forcing Router Console",
|
||||
requestDetails.url,
|
||||
" context",
|
||||
tabId.cookieStoreId,
|
||||
context[0].cookieStoreId
|
||||
);
|
||||
function Create(window) {
|
||||
console.log("(isolate) I2P context", context[0].cookieStoreId);
|
||||
console.log("tab context", tabId.cookieStoreId);
|
||||
function Create() {
|
||||
function onCreated(tab) {
|
||||
console.log("(isolate) Closing old, un-isolated tab");
|
||||
browser.tabs.remove(tabId.id);
|
||||
browser.tabs.remove(window.tabs[0].id);
|
||||
}
|
||||
function onError(error) {
|
||||
console.log(`Error: ${error}`);
|
||||
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);
|
||||
}
|
||||
}
|
||||
closeOldTab(tab);
|
||||
}
|
||||
var created = browser.tabs.create({
|
||||
active: true,
|
||||
cookieStoreId: context[0].cookieStoreId,
|
||||
url: requestDetails.url,
|
||||
windowId: window.id
|
||||
url: requestDetails.url
|
||||
});
|
||||
created.then(onCreated, onError);
|
||||
created.then(onCreated, onContextError);
|
||||
}
|
||||
var getting = browser.windows.getCurrent();
|
||||
getting.then(Create);
|
||||
var gettab = browser.tabs.get(tabId.id);
|
||||
gettab.then(Create, onContextError);
|
||||
return tabId;
|
||||
}
|
||||
} catch (error) {
|
||||
@@ -188,34 +169,29 @@ var contextSetup = async function(requestDetails) {
|
||||
name: tunnelpref
|
||||
});
|
||||
if (tabId.cookieStoreId != context[0].cookieStoreId) {
|
||||
console.log(
|
||||
"(isolate) forcing HSM context",
|
||||
requestDetails.url,
|
||||
" context",
|
||||
tabId.cookieStoreId,
|
||||
context[0].cookieStoreId
|
||||
);
|
||||
function Create(window) {
|
||||
console.log("(isolate) I2P context", context[0].cookieStoreId);
|
||||
console.log("tab context", tabId.cookieStoreId);
|
||||
function Create() {
|
||||
function onCreated(tab) {
|
||||
console.log("(isolate) Closing old, un-isolated tab");
|
||||
browser.tabs.remove(tabId.id);
|
||||
if (window != undefined) {
|
||||
browser.tabs.remove(window.tabs[0].id);
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
function onError(error) {
|
||||
console.log(`Error: ${error}`);
|
||||
closeOldTab(tab);
|
||||
}
|
||||
var created = browser.tabs.create({
|
||||
active: true,
|
||||
cookieStoreId: context[0].cookieStoreId,
|
||||
url: requestDetails.url,
|
||||
windowId: window.id
|
||||
url: requestDetails.url
|
||||
});
|
||||
created.then(onCreated, onError);
|
||||
created.then(onCreated, onContextError);
|
||||
}
|
||||
var getting = browser.windows.getCurrent();
|
||||
getting.then(Create);
|
||||
var gettab = browser.tabs.get(tabId.id);
|
||||
gettab.then(Create, onContextError);
|
||||
return tabId;
|
||||
}
|
||||
} catch (error) {
|
||||
@@ -228,32 +204,29 @@ var contextSetup = async function(requestDetails) {
|
||||
name: torrentpref
|
||||
});
|
||||
if (tabId.cookieStoreId != context[0].cookieStoreId) {
|
||||
console.log(
|
||||
"(isolate) forcing Bittorrent",
|
||||
requestDetails.url,
|
||||
" context",
|
||||
tabId.cookieStoreId,
|
||||
context[0].cookieStoreId
|
||||
);
|
||||
function Create(window) {
|
||||
console.log("(isolate) I2P context", context[0].cookieStoreId);
|
||||
console.log("tab context", tabId.cookieStoreId);
|
||||
function Create() {
|
||||
function onCreated(tab) {
|
||||
console.log("(isolate) Closing old, un-isolated tab");
|
||||
browser.tabs.remove(tabId.id);
|
||||
browser.tabs.remove(window.tabs[0].id);
|
||||
}
|
||||
function onError(error) {
|
||||
console.log(`Error: ${error}`);
|
||||
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);
|
||||
}
|
||||
}
|
||||
closeOldTab(tab);
|
||||
}
|
||||
var created = browser.tabs.create({
|
||||
active: true,
|
||||
cookieStoreId: context[0].cookieStoreId,
|
||||
url: requestDetails.url,
|
||||
windowId: window.id
|
||||
url: requestDetails.url
|
||||
});
|
||||
created.then(onCreated, onError);
|
||||
created.then(onCreated, onContextError);
|
||||
}
|
||||
var getting = browser.windows.getCurrent();
|
||||
getting.then(Create);
|
||||
var gettab = browser.tabs.get(tabId.id);
|
||||
gettab.then(Create, onContextError);
|
||||
return tabId;
|
||||
}
|
||||
} catch (error) {
|
||||
@@ -266,32 +239,64 @@ var contextSetup = async function(requestDetails) {
|
||||
name: mailpref
|
||||
});
|
||||
if (tabId.cookieStoreId != context[0].cookieStoreId) {
|
||||
console.log(
|
||||
"(isolate) forcing Web Mail",
|
||||
requestDetails.url,
|
||||
" context",
|
||||
tabId.cookieStoreId,
|
||||
context[0].cookieStoreId
|
||||
);
|
||||
function Create(window) {
|
||||
console.log("(isolate) I2P context", context[0].cookieStoreId);
|
||||
console.log("tab context", tabId.cookieStoreId);
|
||||
function Create() {
|
||||
function onCreated(tab) {
|
||||
console.log("(isolate) Closing old, un-isolated tab");
|
||||
browser.tabs.remove(tabId.id);
|
||||
browser.tabs.remove(window.tabs[0].id);
|
||||
}
|
||||
function onError(error) {
|
||||
console.log(`Error: ${error}`);
|
||||
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);
|
||||
}
|
||||
}
|
||||
closeOldTab(tab);
|
||||
}
|
||||
var created = browser.tabs.create({
|
||||
active: true,
|
||||
cookieStoreId: context[0].cookieStoreId,
|
||||
url: requestDetails.url,
|
||||
windowId: window.id
|
||||
url: requestDetails.url
|
||||
});
|
||||
created.then(onCreated, onError);
|
||||
created.then(onCreated, onContextError);
|
||||
}
|
||||
var getting = browser.windows.getCurrent();
|
||||
getting.then(Create);
|
||||
var gettab = browser.tabs.get(tabId.id);
|
||||
gettab.then(Create, onContextError);
|
||||
return tabId;
|
||||
}
|
||||
} catch (error) {
|
||||
console.log("(isolate)Context Error", error);
|
||||
}
|
||||
};
|
||||
var localTabFind = async function(tabId) {
|
||||
try {
|
||||
var context = await browser.contextualIdentities.query({
|
||||
name: localpref
|
||||
});
|
||||
if (tabId.cookieStoreId != context[0].cookieStoreId) {
|
||||
console.log("(isolate) I2P context", context[0].cookieStoreId);
|
||||
console.log("tab context", tabId.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);
|
||||
}
|
||||
}
|
||||
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;
|
||||
}
|
||||
} catch (error) {
|
||||
@@ -309,32 +314,29 @@ var contextSetup = async function(requestDetails) {
|
||||
tabId.cookieStoreId == "firefox-private"
|
||||
) {
|
||||
if (tabId.cookieStoreId != context[0].cookieStoreId) {
|
||||
console.log(
|
||||
"(isolate) forcing Web Browsing",
|
||||
requestDetails.url,
|
||||
" context",
|
||||
tabId.cookieStoreId,
|
||||
context[0].cookieStoreId
|
||||
);
|
||||
function Create(window) {
|
||||
console.log("(isolate) I2P context", context[0].cookieStoreId);
|
||||
console.log("tab context", tabId.cookieStoreId);
|
||||
function Create() {
|
||||
function onCreated(tab) {
|
||||
console.log("(isolate) Closing old, un-isolated tab");
|
||||
browser.tabs.remove(tabId.id);
|
||||
browser.tabs.remove(window.tabs[0].id);
|
||||
}
|
||||
function onError(error) {
|
||||
console.log(`Error: ${error}`);
|
||||
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);
|
||||
}
|
||||
}
|
||||
closeOldTab(tab);
|
||||
}
|
||||
var created = browser.tabs.create({
|
||||
active: true,
|
||||
cookieStoreId: context[0].cookieStoreId,
|
||||
url: requestDetails.url,
|
||||
windowId: window.id
|
||||
url: requestDetails.url
|
||||
});
|
||||
created.then(onCreated, onError);
|
||||
created.then(onCreated, onContextError);
|
||||
}
|
||||
var getting = browser.windows.getCurrent();
|
||||
getting.then(Create);
|
||||
var gettab = browser.tabs.get(tabId.id);
|
||||
gettab.then(Create, onContextError);
|
||||
return tabId;
|
||||
}
|
||||
}
|
||||
@@ -351,6 +353,12 @@ var contextSetup = async function(requestDetails) {
|
||||
console.log("(isolate)Tab error", error);
|
||||
}
|
||||
};
|
||||
if (requestDetails == undefined) {
|
||||
return requestDetails;
|
||||
}
|
||||
if (extensionHost(requestDetails.url)) {
|
||||
return requestDetails;
|
||||
}
|
||||
if (requestDetails.tabId > 0) {
|
||||
if (proxyHost(requestDetails.url)) {
|
||||
setcookie = browser.cookies.set({
|
||||
@@ -358,48 +366,47 @@ var contextSetup = async function(requestDetails) {
|
||||
url: requestDetails.url,
|
||||
secure: true
|
||||
});
|
||||
setcookie.then(onGot, onError);
|
||||
setcookie.then(onContextGotLog, onContextError);
|
||||
return requestDetails;
|
||||
}
|
||||
console.log("(isolate)Request Details", requestDetails);
|
||||
var tab = tabGet(requestDetails.tabId);
|
||||
if (i2pHost(requestDetails.url)) {
|
||||
var setcookie = browser.cookies.set({
|
||||
firstPartyDomain: i2pHostName(requestDetails.url),
|
||||
url: requestDetails.url,
|
||||
secure: true
|
||||
});
|
||||
setcookie.then(onGot, onError);
|
||||
var tab = tabGet(requestDetails.tabId);
|
||||
var mtab = tab.then(tabFind);
|
||||
setcookie.then(onContextGotLog, onContextError);
|
||||
var i2ptab = tab.then(i2pTabFind, onContextError);
|
||||
return requestDetails;
|
||||
}
|
||||
let localhost = localHost(requestDetails.url);
|
||||
let routerhost = routerHost(requestDetails.url);
|
||||
if (!routerhost) {
|
||||
if (localhost) {
|
||||
var localtab = tab.then(localTabFind, onContextError);
|
||||
return requestDetails;
|
||||
}
|
||||
}
|
||||
if (routerhost) {
|
||||
if (routerhost === "i2ptunnelmgr") {
|
||||
var tab = tabGet(requestDetails.tabId);
|
||||
var mtab = tab.then(i2ptunnelTabFind);
|
||||
var tunneltab = tab.then(i2ptunnelTabFind, onContextError);
|
||||
return requestDetails;
|
||||
} else if (routerhost === "i2psnark") {
|
||||
var tab = tabGet(requestDetails.tabId);
|
||||
var mtab = tab.then(snarkTabFind);
|
||||
var snarktab = tab.then(snarkTabFind, onContextError);
|
||||
return requestDetails;
|
||||
} else if (routerhost === "webmail") {
|
||||
var tab = tabGet(requestDetails.tabId);
|
||||
var mtab = tab.then(mailTabFind);
|
||||
var mailtab = tab.then(mailTabFind, onContextError);
|
||||
return requestDetails;
|
||||
} else if (routerhost === "routerconsole") {
|
||||
var tab = tabGet(requestDetails.tabId);
|
||||
var mtab = tab.then(routerTabFind);
|
||||
var routertab = tab.then(routerTabFind, onContextError);
|
||||
return requestDetails;
|
||||
}
|
||||
} else {
|
||||
var tab = tabGet(requestDetails.tabId);
|
||||
var mtab = tab.then(anyTabFind);
|
||||
return requestDetails;
|
||||
}
|
||||
}
|
||||
//var tab = tabGet(requestDetails.tabId);
|
||||
//var mtab = tab.then(anyTabFind);
|
||||
return requestDetails;
|
||||
} catch (error) {
|
||||
console.log("(isolate)Not an I2P request, blackholing", error);
|
||||
}
|
||||
@@ -416,25 +423,3 @@ browser.webRequest.onBeforeSendHeaders.addListener(
|
||||
{ urls: ["<all_urls>"] },
|
||||
["blocking", "requestHeaders"]
|
||||
);
|
||||
|
||||
/*
|
||||
function notify(message) {
|
||||
var response = await fetch('https://proxy.i2p', {
|
||||
credentials: 'include'
|
||||
});
|
||||
const myJson = await response.json();
|
||||
console.log(JSON.stringify(myJson));
|
||||
|
||||
console.log(message);
|
||||
const Http = new XMLHttpRequest();
|
||||
Http.mozAnon = true;
|
||||
Http.withCredentials = true;
|
||||
const url = "http://proxy.i2p";
|
||||
Http.open("GET", url);
|
||||
Http.send();
|
||||
Http.onreadystatechange = e => {
|
||||
console.log(Http.responseText);
|
||||
browser.runtime.sendMessage(Http.responseText);
|
||||
};
|
||||
}
|
||||
*/
|
||||
|
52
window.html
52
window.html
@@ -16,7 +16,7 @@
|
||||
<div id="i2pbrowser-version"></div>
|
||||
<div id="i2pbrowser-description">
|
||||
<p id="description">You are now able to use I2P in this browser.</p>
|
||||
<p class="beta">It is experimental.</p>
|
||||
<p id="beta">It is experimental.</p>
|
||||
</div>
|
||||
<div id="readyness">
|
||||
<img class="readyness" src="http://proxy.i2p/themes/console/images/local_up.png" alt="Proxy is not ready."/>
|
||||
@@ -28,24 +28,28 @@
|
||||
<div class="panel-section-separator"></div>
|
||||
<div class="browser-info">
|
||||
<p class="hideIfI2PConsoleOff">
|
||||
<h3>Controls</h3>
|
||||
<p id="applicationExplain">These controls are used to tailor your I2P Browsing Experience</p>
|
||||
<h3 id="controlHeader">Controls</h3>
|
||||
<p id="controlExplain">These controls are used to tailor your I2P Browsing Experience</p>
|
||||
<ul>
|
||||
<a id="clear-browser-data" href="#">
|
||||
<li class="application">
|
||||
Clear Browsing Data: <span class="applicationDesc">Use this to erase your browsing data.</span>
|
||||
</li>
|
||||
</a>
|
||||
<li class="application">
|
||||
<a id="clear-browser-data" href="#">Clear Browsing Data: </a>
|
||||
<span id="clear-desc" class="applicationDesc">Use this to erase your browsing data.</span>
|
||||
</li>
|
||||
<li class="application">
|
||||
<input type="checkbox" id="enable-web-rtc" name="enablewebrtc" value="webrtc">
|
||||
<label for="enable-web-rtc">Enable WebRTC <strong>with Proxy?</strong></label>
|
||||
<span class="applicationDesc">For more information about this extension, go here:</span>
|
||||
<span id="rtcDesc" class="applicationDesc">WebRTC is disabled by default, but can be enabled by checking this box.</span>
|
||||
</li>
|
||||
<li class="application">
|
||||
<div class="panel-section-separator"></div>
|
||||
<div class="panel-section-identity">
|
||||
<div id="identity-list"></div>
|
||||
</li>
|
||||
<li class="application">
|
||||
<input type="checkbox" id="disable-history" name="disablehistory" value="history">
|
||||
<label for="disable-history">Disable History in I2P Tabs</label>
|
||||
<span id="histDesc" class="applicationDesc">History is automatically cleared when your I2P tabs are closed. If you want to clear history as you go, check this box.</span>
|
||||
</li>
|
||||
</ul>
|
||||
</p>
|
||||
</p>
|
||||
@@ -53,21 +57,25 @@
|
||||
<div class="panel-section-separator"></div>
|
||||
<div class="application-info">
|
||||
<p class="hideIfI2PConsoleOff">
|
||||
<h3>Applications</h3>
|
||||
<h3 id="applicationHeader">Applications</h3>
|
||||
<p id="applicationExplain">These applications use I2P to provide them with security and privacy.</p>
|
||||
<ul>
|
||||
<li class="application"><button id="window-visit-homepage" class="applicationName window-visit-homepage" href="#">
|
||||
Home Page <span class="applicationDesc">For more information about this extension, go here:</span>
|
||||
</button></li>
|
||||
<li class="application"><button id="window-visit-i2ptunnel" class="applicationName">
|
||||
Hidden Services Manager <span class="applicationDesc">I2P has a web-based interface for configuring .i2p services like web sites, to set up your own web sites, go here:</span>
|
||||
</button></li>
|
||||
<li class="application"><button id="window-visit-susimail" class="applicationName">
|
||||
E-Mail <span class="applicationDesc">I2P also bundles a webmail client which can be used to access in-I2P e-mail. To use it, go here:</span>
|
||||
</button></li>
|
||||
<li class="application"><button id="window-visit-snark" class="applicationName">
|
||||
BitTorrent <span class="applicationDesc">I2P is capable of anonymous Peer-to-Peer file sharing, to use the built-in bittorrent client go here:</span>
|
||||
</button></li>
|
||||
<li class="application">
|
||||
<button id="window-visit-homepage" target="_blank" class="applicationName window-visit-homepage" href="#">Home Page</button>
|
||||
<span id="abouthome" class="applicationDesc">For more information about this extension, go here:</span>
|
||||
</li>
|
||||
<li class="application">
|
||||
<button id="window-visit-i2ptunnel" target="_blank" class="applicationName">Hidden Services Manager</button>
|
||||
<span id="i2ptunnel" class="applicationDesc">I2P has a web-based interface for configuring .i2p services like web sites, to set up your own web sites, go here:</span>
|
||||
</li>
|
||||
<li class="application">
|
||||
<button id="window-visit-susimail" target="_blank" class="applicationName">E-Mail</button>
|
||||
<span id="susimail" class="applicationDesc">I2P also bundles a webmail client which can be used to access in-I2P e-mail. To use it, go here:</span>
|
||||
</li>
|
||||
<li class="application">
|
||||
<button id="window-visit-snark" target="_blank" class="applicationName">BitTorrent</button>
|
||||
<span id="snark" class="applicationDesc">I2P is capable of anonymous Peer-to-Peer file sharing, to use the built-in bittorrent client go here:</span>
|
||||
</li>
|
||||
</ul>
|
||||
</p>
|
||||
</p>
|
||||
|
Reference in New Issue
Block a user