diff --git a/COLORS.md b/COLORS.md new file mode 100644 index 0000000..50fbc7d --- /dev/null +++ b/COLORS.md @@ -0,0 +1,94 @@ +WIP Style guidelines +-------------------- + + +Colors currently in use from CSS +-------------------------------- + + home.css:100: color: #41465f; + home.css:10: color: #3b6bbf; + home.css:113: color: #41465f; + home.css:125: color: #41465f; + home.css:139: color: #3b6bbf; + home.css:17: color: #81888f; + home.css:26: color: #495057; + home.css:35: color: #3b6bbf; + home.css:49: color: #495057; + home.css:58: background-color: #f8f8ff; + home.css:66: color: #495057; + search.css:20: background-color: #ddd + search.css:23: background-color: #2196f3; + search.css:24: color: #fff + + home.css:135: background: 0 0!important; + home.css:161: background: #dee2e6; + home.css:175: background: #dee2e6; + home.css:188: background: #a48fe1; + home.css:200: background: #dee2e6; + home.css:214: background: #dee2e6; + home.css:228: background: #d9d9d6; + home.css:246: background: #ffc56d; + home.css:260: background: #f7e59a; + home.css:50: background-attachment: fixed; + home.css:51: background-size: 100% 100%; + home.css:57:.background { + home.css:58: background-color: #f8f8ff; + home.css:79: background: #f8f8ff; + home.css:91: background: #f8f8ff; + search.css:20: background-color: #ddd + search.css:23: background-color: #2196f3; + search.css:5: background: #dee2e6; + + +Colors currently in use from Javascript +--------------------------------------- + + background.js:172: colors: { + background.js-173- frame: "#FFC56D", + background.js-174- toolbar: "#FFC56D" + background.js-175- } + -- + background.js:179: colors: { + background.js-180- frame: "#FFC56D", + background.js-181- toolbar: "#FFC56D" + background.js-182- } + -- + background.js:189: colors: { + background.js-190- frame: "#A4C8E1", + background.js-191- toolbar: "#A4C8E1" + background.js-192- } + -- + background.js:196: colors: { + background.js-197- frame: "#A4C8E1", + background.js-198- toolbar: "#A4C8E1" + background.js-199- } + -- + background.js:206: colors: { + background.js-207- frame: "#D9D9D6", + background.js-208- toolbar: "#D9D9D6" + background.js-209- } + -- + background.js:213: colors: { + background.js-214- frame: "#D9D9D6", + background.js-215- toolbar: "#D9D9D6" + background.js-216- } + -- + background.js:223: colors: { + background.js-224- frame: "#F7E59A", + background.js-225- toolbar: "#F7E59A" + background.js-226- } + -- + background.js:230: colors: { + background.js-231- frame: "#F7E59A", + background.js-232- toolbar: "#F7E59A" + background.js-233- } + -- + background.js:240: colors: { + background.js-241- frame: "#A48FE1", + background.js-242- toolbar: "#A48FE1" + background.js-243- } + -- + background.js:247: colors: { + background.js-248- frame: "#A48FE1", + background.js-249- toolbar: "#A48FE1" + background.js-250- } diff --git a/Makefile b/Makefile index da9e93f..cd95960 100644 --- a/Makefile +++ b/Makefile @@ -73,6 +73,7 @@ index: @echo "" >> index.html @echo " I2P in Private Browsing Mode" >> index.html @echo " " >> index.html + @echo " " >> index.html @echo "" >> index.html @echo "" >> index.html sed "s|magnetsub|[Magnet Link]($(MAGNET))|g" README.md | markdown >> index.html @@ -238,14 +239,20 @@ 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 cleancss -O1 all -O2 all --format beautify search.css -o .search.css && mv .search.css search.css + cleancss -O1 all -O2 all --format beautify sidebar.css -o .sidebar.css && mv .sidebar.css sidebar.css + cleancss -O1 all -O2 all --format beautify options/options.css -o options/.options.css && mv options/.options.css options/options.css tidy --as-xhtml --drop-empty-elements no --input-xml --tidy-mark no -indent --indent-spaces 4 -wrap 0 --new-blocklevel-tags article,header,footer --new-inline-tags video,audio,canvas,ruby,rt,rp --break-before-br yes --sort-attributes alpha --vertical-space yes index.html > .index.html; mv .index.html index.html tidy --as-xhtml --drop-empty-elements no --input-xml --tidy-mark no -indent --indent-spaces 4 -wrap 0 --new-blocklevel-tags article,header,footer --new-inline-tags video,audio,canvas,ruby,rt,rp --break-before-br yes --sort-attributes alpha --vertical-space yes window.html > .window.html; mv .window.html window.html tidy --as-xhtml --drop-empty-elements no --input-xml --tidy-mark no -indent --indent-spaces 4 -wrap 0 --new-blocklevel-tags article,header,footer --new-inline-tags video,audio,canvas,ruby,rt,rp --break-before-br yes --sort-attributes alpha --vertical-space yes home.html > .home.html; mv .home.html home.html + tidy --as-xhtml --drop-empty-elements no --input-xml --tidy-mark no -indent --indent-spaces 4 -wrap 0 --new-blocklevel-tags article,header,footer --new-inline-tags video,audio,canvas,ruby,rt,rp --break-before-br yes --sort-attributes alpha --vertical-space yes toopie.html > .toopie.html; mv .toopie.html toopie.html + tidy --as-xhtml --drop-empty-elements no --input-xml --tidy-mark no -indent --indent-spaces 4 -wrap 0 --new-blocklevel-tags article,header,footer --new-inline-tags video,audio,canvas,ruby,rt,rp --break-before-br yes --sort-attributes alpha --vertical-space yes options/options.html > options/.options.html; mv options/.options.html options/options.html find . -path ./node_modules -prune -o -name '*.js' -exec prettier --write {} \; find . -path ./node_modules -prune -o -name '*.json' -exec prettier --write {} \; lint: - eslint --color *.js + fixjsstyle *.js + gjslint *.js; true + #eslint --color *.js deborig: fmt version rm -rf ../i2psetproxy.js-$(VERSION) @@ -283,3 +290,4 @@ rss: torrent upload-rss: gothub upload -R -u eyedeekay -r I2P-in-Private-Browsing-Mode-Firefox -t docs -n "releases.atom" -f releases.atom + diff --git a/README.md b/README.md index 872db61..46f2456 100644 --- a/README.md +++ b/README.md @@ -81,11 +81,12 @@ Usage: use * ![Visiting i2ptunnel](i2ptunnel.png) * [ready] **Provide** help in a variety of languages. - * [wip] **Monitor** the health and readiness of the I2P router it is + * [done] **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. + * ![Visiting toopie.html](toopie.png) * [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 @@ -196,3 +197,5 @@ 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. + +moz-extension://d63582fc-09fc-445a-b8aa-1c888ee2ffc0/toopie.html \ No newline at end of file diff --git a/_locales/en/messages.json b/_locales/en/messages.json index cec1b52..7e8a3dc 100644 --- a/_locales/en/messages.json +++ b/_locales/en/messages.json @@ -3,6 +3,10 @@ "message": "I2P In Private Browsing", "description": "Name of the extension." }, + "toopieName": { + "message": "toopie.html", + "description": "Name of the sidebar." + }, "extensionDescription": { "message": "Your browser is now set up to use I2P.", "description": "Description of the extension." @@ -131,6 +135,10 @@ "message": "I2P Browser (Private)", "description": "Preface for the browser titlebar" }, + "extensionPreface": { + "message": "I2P Management", + "description": "Preface for the browser titlebar" + }, "webPreface": { "message": "Web Browser", "description": "Preface for the browser titlebar" @@ -203,6 +211,10 @@ "message": "Visit the I2P Forum to learn more or ask for assistance", "description": "Help Message" }, + "proxyHelpText": { + "message": "Configure your I2P proxy here.", + "description": "Help for configuring the options for the Reset Tunnel button" + }, "hostText": { "message": "Host: ", "description": "Host for the HTTP or SOCKS5 Proxy" @@ -212,7 +224,7 @@ "description": "Port for the HTTP or SOCKS5 Proxy" }, "controlHelpText": { - "message": "These options will be inert if used with the default i2p HTTP or SOCKS proxy.", + "message": "Configure your router console here.", "description": "Help for configuring the options for the Reset Tunnel button" }, "controlHostText": { diff --git a/background.js b/background.js index 42366c4..7734558 100644 --- a/background.js +++ b/background.js @@ -12,11 +12,12 @@ var tunnelpref = chrome.i18n.getMessage("i2ptunnelPreface"); var tunnelprefpriv = chrome.i18n.getMessage("i2ptunnelPrefacePrivate"); var localpref = chrome.i18n.getMessage("localPreface"); var localprefpriv = chrome.i18n.getMessage("localPrefacePrivate"); +var extensionpref = chrome.i18n.getMessage("extensionPreface"); function onContextsGot(contexts) { var ids = []; for (let context of contexts) { - console.log(`Name: ${context.name}`); + console.log(`Name : ${context.name}`); ids.push(context.name); } console.log("Checking new contexts"); @@ -90,11 +91,11 @@ function onContextsError() { } function onCreated(context) { - console.log(`New identity's ID: ${context.cookieStoreId}.`); + console.log(" ID:", context.cookieStoreId, "created."); } function onNotCreated(context) { - console.log(`identity ID: ${context.cookieStoreId} not created`); + console.log("ID:", context.cookieStoreId, "not created."); } browser.contextualIdentities.query({}).then(onContextsGot, onContextsError); @@ -402,11 +403,6 @@ gettingListenerInfo.then(got => { 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 @@ -421,30 +417,7 @@ gettingListenerInfo.then(got => { }); } }); -/* -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); - }); - } -}); -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) { console.log(`Theme was applied: ${updateInfo.theme}`); diff --git a/bookmarks.js b/bookmarks.js index 572e89a..3705f53 100644 --- a/bookmarks.js +++ b/bookmarks.js @@ -122,7 +122,7 @@ gettingInfo.then(got => { } function onRejected(error) { - console.log(`An error: ${error}`); + console.log(`An error : ${error}`); } function onCreated(node) { console.log("Bookmarked", node); diff --git a/config.js b/config.js new file mode 100644 index 0000000..0b8ff55 --- /dev/null +++ b/config.js @@ -0,0 +1,18 @@ +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 = "7657"; + +var rpc_host = "127.0.0.1"; +var rpc_port = "7657"; +var rpc_path = "jsonrpc"; +var rpc_pass = "itoopie"; + +var bt_rpc_host = "127.0.0.1"; +var bt_rpc_port = "7657"; +var bt_rpc_path = "transmission/rpc"; +var bt_rpc_pass = "transmission"; + +var disable_history = false; diff --git a/context.js b/context.js index 2fd7a15..49f4bce 100644 --- a/context.js +++ b/context.js @@ -2,12 +2,12 @@ var titlepref = chrome.i18n.getMessage("titlePreface"); function onError(error) { - console.log(`Error: ${error}`); + console.log(`Error : ${error}`); } function eventHandler(event) { function onCreated(windowInfo) { - console.log(`Created window: ${windowInfo.id}`); + console.log(`Created window : ${windowInfo.id}`); browser.tabs.create({ windowId: windowInfo.id, url: "about:blank", diff --git a/handler.js b/handler.js index 0a06d39..d48f7b5 100644 --- a/handler.js +++ b/handler.js @@ -1,3 +1,56 @@ +function routerHost(url) { + let hostname = ""; + let path = ""; + function pathcheck(str) { + if (str != undefined) { + let final = str.split("/")[0]; + if (final === "i2ptunnelmgr" || final === "i2ptunnel") { + console.log("(urlcheck) application path", final); + return "i2ptunnelmgr"; + } else if (final === "i2psnark" || final === "torrents") { + console.log("(urlcheck) application path", final); + return "i2psnark"; + } else if (final === "webmail" || final === "susimail") { + console.log("(urlcheck) application path", final); + return "webmail"; + } else if ( + final === "home" || + final === "console" || + final === "dns" || + final.startsWith("config") + ) { + console.log("(urlcheck) application path", final); + return "routerconsole"; + } + } + return true; + } + if (url.indexOf("://") > -1) { + hostname = url.split("/")[2]; + let prefix = url.substr(0, url.indexOf("://") + 3); + path = url.replace(prefix + hostname + "/", ""); + } else if (identifyProtocolHandler(url)) { + let newurl = identifyProtocolHandler(url); + return routerHost(newurl); + } else { + hostname = url.split("/")[0]; + path = url.replace(hostname + "/", ""); + } + if (hostname === control_host + ":" + control_port) { + //console.log("(hostcheck) router console found on configured ports"); + return pathcheck(path); + } + if (hostname === "localhost" + ":" + control_port) { + //console.log("(hostcheck) router console found on configured ports"); + return pathcheck(path); + } + if (hostname === "127.0.0.1" + ":" + control_port) { + return pathcheck(path); + } + + return false; +} + function identifyProtocolHandler(url) { //console.log("looking for handler-able requests") if (routerHost(url)) { diff --git a/home.css b/home.css index e4f5a53..5750d7c 100644 --- a/home.css +++ b/home.css @@ -100,7 +100,6 @@ h1 { color: #41465f; border: 1px solid #dee2e6; border-radius: 2px 2px 0 0; - width: 90%; padding-left: 5% } h2, @@ -111,7 +110,6 @@ h3 { font-size: 25px; text-transform: uppercase; color: #41465f; - border: 1px solid #dee2e6; border-radius: 2px 2px 0 0; width: 90%; padding-left: 5% @@ -167,9 +165,10 @@ li { margin: .5rem .5rem .5rem 32% } #readyness { - min-height: 5rem; - padding: .5rem; - margin: .5rem; + float: left; + padding-top: 1rem; + padding-bottom: 1rem; + margin: 1rem; width: 42%; min-width: 42%; background: #dee2e6; @@ -182,6 +181,7 @@ li { min-height: 5rem; padding: .5rem; margin: .5rem; + margin-top: 4rem; width: 42%; min-width: 42%; font-size: 2rem; @@ -192,13 +192,12 @@ li { box-shadow: inset 0 0 0 1px #fff,0 0 1px #ccc } #i2pbrowser-description { + padding-top: 1rem; + padding-bottom: 1rem; width: 50%; min-width: 50%; - min-height: 5rem; - padding: .5rem; - display: inline; + display: inline-block; background: #dee2e6; - float: right; border: 1px solid #dee2e6; border-radius: 2px; box-shadow: inset 0 0 0 1px #fff,0 0 1px #ccc @@ -224,7 +223,7 @@ li { margin: .2rem; width: 38%; min-width: 38%; - display: inline; + display: inline-block; background: #d9d9d6; float: right; text-align: center!important; @@ -238,7 +237,7 @@ li { margin: .2rem; width: 38%; min-width: 38%; - display: inline; + display: inline-block; float: right; text-align: center!important; border: 1px solid #ffc56d; @@ -252,7 +251,7 @@ li { margin: .2rem; width: 38%; min-width: 38%; - display: inline; + display: inline-block; float: left; text-align: center!important; border: 1px solid #f7e59a; diff --git a/home.html b/home.html index cab50f9..ad555c6 100644 --- a/home.html +++ b/home.html @@ -4,6 +4,7 @@ + @@ -41,27 +42,27 @@

New to I2P? Learn more here.

-

+

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.

-

+

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.

-

+

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.

-

+

There is also an anonymous e-mail service available inside of I2P, which is accessible from our browser via the menu directly below.

-

+

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.

@@ -77,12 +78,17 @@

These applications use I2P to provide them with security and privacy.

- -
-
- -
-

-

- -

Applications

- -

These applications use I2P to provide them with security and privacy.

- - - -

-

- -

-

-
- - - - -