6 Commits
0.36 ... 0.41

Author SHA1 Message Date
idk
3d4a49827f Merge pull request #18 from eyedeekay/annoying-windows
plan document, don't open a new window automatically, just a tab
2019-10-31 12:24:25 -04:00
idk
fa579b8586 plan document, don't open a new window automatically, just a tab 2019-10-31 12:22:19 -04:00
idk
58b91e1a80 Merge pull request #17 from eyedeekay/webrtc
Webrtc
2019-10-28 01:17:26 -04:00
idk
997689806b add webrtc enable disable option, purge chrome, reformat 2019-10-28 01:12:40 -04:00
idk
df4d9e93a6 add option to re-enable WebRTC 2019-10-28 01:11:16 -04:00
idk
6cd37b51c0 Start working on the i2pcontrol messaging feature 2019-10-17 18:54:39 -04:00
14 changed files with 354 additions and 219 deletions

View File

@@ -34,8 +34,9 @@ clean:
## EVEN RELEASES are AMO RELEASES
## ODD RELEASES are SELFHOSTED RELEASES
MOZ_VERSION=0.36
VERSION=0.36
MOZ_VERSION=0.38
VERSION=0.39
VERSION=$(MOZ_VERSION)
#VERSION=1.27
xpi:
@@ -78,9 +79,14 @@ fmt:
find . -path ./node_modules -prune -o -name '*.js' -exec prettier --write {} \;
deborig:
rm -rfv ../i2psetproxy.js-$(VERSION)
cp -rv . ../i2psetproxy.js-$(VERSION)
tar --exclude='./.git' --exclude="./node_modules" -cvzf ../i2psetproxy.js_$(VERSION).orig.tar.gz .
rm -rf ../i2psetproxy.js-$(VERSION)
cp -r . ../i2psetproxy.js-$(VERSION)
tar \
-cvz \
--exclude=.git \
--exclude=i2psetproxy.js.gif \
-f ../i2psetproxy.js_$(VERSION).orig.tar.gz \
.
deb: deborig
cd ../i2psetproxy.js-$(VERSION) && debuild -us -uc -rfakeroot

70
PLAN.md Normal file
View File

@@ -0,0 +1,70 @@
The I2P Browser has made strides at improving users anonymity when browsing
the anonymous web inside of I2P. However, it has in many ways simply re-hashed
the existing work of Tor on the Tor Browser. This is mostly a good thing, but it
is unfortunate because in a sense we have failed to add I2P specific features
that could improve the user experience and set us apart from the Tor Browser.
I think that moving forward, we should try to extend the functionality of I2P
Browser into more I2P-specific realms and make an effort to make those things
more accessible and highlight that they are in use. I don't really know how to
explain what I mean without describing what I want to do, so
Let's avoid *adding* features to i2pbutton
------------------------------------------
i2pbutton contains alot of code from Tor which even they don't really want to
maintain. It's dying the same long, slow death it's always been dying, since
back before there was a Tor Browser and torbutton was just an easy way to
configure Tor in your Firefox browser. I don't relish the thought of being one
the last two groups on the planet maintaining an XUL extension, so I think that
we should always be trying to do less with i2pbutton and more with a modern
extension. Other advantages of modern extensions are better debugging tools
and easier-to-use, more understandable API's for doing the following other
things.
Contexts for Security and Placing Router Applications under their own Origin
----------------------------------------------------------------------------
It is possible, however unlikely, for an attack on a local service or a router
plugin to leak information about what's going on on the router console because
they will share the same origin. We can resolve this issue, though, by placing
applications each into their own origin under a so-called "Container Tab,"
completely separating eepWeb traffic and Router Console administration. The
origin of the application will be the same as the part of the application URL
*after* localhost:7657, so for instance "http://localhost:7657/torrents"
would become just "torrents" in the URL bar and have that origin.
Dynamic Themes
--------------
Since I2P Browsing and Router Console Administration are going to be separated
to their own contextual identities, we can manipulate the appearance of the
Firefox browser to accomplish 2 things: We can indicate which context we are in
both by manipulating the UI text and color, and manipulate UI elements based on
what context we're in or even what URL(In the router console) we're on. We can
use this to make router console applications appear more tightly integrated with
the functionality of the browser. It's kind of obliquely like how many
applications are written with user-interfaces that are actually just
browsers(Including Mattermost), but with us using the whole browser,
acknowledging it's presence and utility but quite literally highlighting(in
color) our unique features. So for instance, when the user is using snark it
could change color to match snark and change text to say "Torrent Client."
Application Integration - Torrents
----------------------------------
I2P's strengths are in it's applications, but many users never even make it to
the applications, and even if they do, the I2P applications often lack the
familiar workflows that people are used to. For instance, when one downloads
a torrent on the non-anonymous internet, you simply click a link and the browser
"Handles" the link, automatically launching the torrent client, adding the
torrent, and sometimes prompting the user for more actions. This isn't possible
yet with i2psnark and an external browser, but in I2P browser we can write a
"Protocol Handler" which talks to snark-rpc, replicating the ease of just
clicking a torrent link to automatically add it to a torrent client. Of course
that does require us to bundle the snark-rpc plugin. Besides that, once we've
added the torrent, we can keep talking to snark-rpc to keep track of the
download progress and display information about that in the already-available
Firefox downloads menu that users are already familiar with, so that they can
keep track of the files they are downloading after navigating away from the
snark interface, or perhaps even without needing to interact with snark at all.

View File

@@ -15,10 +15,15 @@ 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.
* This is the new version: [[link]](https://addons.mozilla.org/en-US/firefox/addon/i2p-in-private-browsing/)
* This is the old version: [[link]](https://addons.mozilla.org/en-US/firefox/addon/I2P-Proxy/)
Android usage:
--------------
Open the following link [Github Releases Version](https://github.com/eyedeekay/i2psetproxy.js/releases/download/1.26/i2psetproxy.js@eyedeekay.github.io.xpi)
Open the following link
[Github Releases Version](https://github.com/eyedeekay/i2psetproxy.js/releases/)
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
@@ -27,7 +32,8 @@ now configured to use I2P.
### addons.mozilla.org
If you would prefer to recieve automatic updates from AMO, the correct product
page for this plugin is [I2P-proxy](https://addons.mozilla.org/en-US/firefox/addon/I2P-proxy/).
page for this plugin is
[I2P In Private Browsing](https://addons.mozilla.org/en-US/firefox/addon/i2p-in-private-browsing/).
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
@@ -48,9 +54,13 @@ submission to AMO.
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*.
* [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.

View File

@@ -6,13 +6,6 @@ function onGot(contexts) {
}
console.log("Checking new contexts");
if (ids.indexOf("i2pbrowser") == -1) {
function onCreated(context) {
console.log(`New identity's ID: ${context.cookieStoreId}.`);
}
function onError(e) {
console.error(e);
}
browser.contextualIdentities
.create({
name: "i2pbrowser",
@@ -22,13 +15,6 @@ function onGot(contexts) {
.then(onCreated, onError);
}
if (ids.indexOf("routerconsole") == -1) {
function onCreated(context) {
console.log(`New identity's ID: ${context.cookieStoreId}.`);
}
function onError(e) {
console.error(e);
}
browser.contextualIdentities
.create({
name: "routerconsole",
@@ -39,6 +25,10 @@ function onGot(contexts) {
}
}
function onCreated(context) {
console.log(`New identity's ID: ${context.cookieStoreId}.`);
}
function onError(e) {
console.error(e);
}
@@ -47,6 +37,8 @@ browser.contextualIdentities.query({}).then(onGot, onError);
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);
}
@@ -54,16 +46,22 @@ if (!isDroid()) {
var titlepref = chrome.i18n.getMessage("titlePreface");
var titleprefpriv = chrome.i18n.getMessage("titlePrefacePrivate");
function themeWindowByTab(tab) {
getwindow = browser.windows.get(tab.windowId);
getwindow.then(themeWindow);
function themeWindowByTab(tabId) {
function tabWindow(tab) {
getwindow = browser.windows.get(tab.windowId);
getwindow.then(themeWindow);
}
if (typeof tabId === "number") {
tab = browser.tabs.get(tabId);
tab.then(tabWindow);
} else {
tabWindow(tabId);
}
}
function themeWindow(window) {
// Check if the window is in private browsing
function logTabs(tabInfo) {
console.log(tabInfo);
function onGot(context) {
if (context.name == "i2pbrowser") {
console.log("Active in I2P window");
@@ -103,10 +101,6 @@ function themeWindow(window) {
console.log("Not active in I2P window");
}
}
function onError(e) {
console.error(e);
}
if (tabInfo[0].cookieStoreId != "firefox-default") {
browser.contextualIdentities
.get(tabInfo[0].cookieStoreId)
@@ -116,9 +110,6 @@ function themeWindow(window) {
}
}
function onError(error) {
console.log(`Error: ${error}`);
}
var querying = browser.tabs.query({
currentWindow: true,
active: true
@@ -147,18 +138,12 @@ function setTitle(window) {
}
}
function onError(e) {
console.error(e);
}
if (tabInfo[0].cookieStoreId != "firefox-default")
browser.contextualIdentities
.get(tabInfo[0].cookieStoreId)
.then(onGot, onError);
}
function onError(error) {
console.log(`Error: ${error}`);
}
var querying = browser.tabs.query({
currentWindow: true,
active: true

View File

@@ -15,3 +15,22 @@ 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);
}
browser.runtime.onMessage.addListener(proxyContent);
*/
/*
function signalWebRTC(val){
console.log("signal", val)
}
*/

6
debian/changelog vendored
View File

@@ -1,3 +1,9 @@
i2psetproxy.js (0.37-1) UNRELEASED; urgency=low
* Honor contextual ID when deleting history
-- idk <hankhill19580@gmail.com> Thu, 17 OCT 2019 00:52:19 -0400
i2psetproxy.js (0.35-1) UNRELEASED; urgency=low
* Automatically activate contexts

43
i2pcontrol.js Normal file
View File

@@ -0,0 +1,43 @@
function send(json) {
const Http = new XMLHttpRequest();
Http.withCredentials = false;
const url = "http://" + "127.0.0.1" + ":" + "7650";
Http.open("POST", url);
Http.send(json);
console.log(Http);
return Http;
}
function authenticate(user, password) {
var json = {
jsonrpc: "2.0",
id: user,
method: "Authenticate",
params: {
API: 1,
Password: password
}
};
return send(json);
}
username = "";
password = "";
function echo(string, section) {
var xhr = authenticate(username, password);
xhr.onload = function() {
resp = JSON.Parse(xhr.responseText);
json = {
jsonrpc: "2.0",
id: username,
method: "Echo",
params: {
Token: resp.Token,
Echo: string
}
};
var controlMessage = document.getElementById(section);
infoMessage.textContent = xhr.responseText;
};
}

11
info.js
View File

@@ -8,7 +8,7 @@ document.addEventListener("click", e => {
type: "panel",
incognito: true
};
let creating = chrome.windows.create(createData);
let creating = browser.windows.create(createData);
creating.then(() => {
console.log("The help panel has been created");
});
@@ -17,7 +17,7 @@ document.addEventListener("click", e => {
type: "panel",
incognito: true
};
let creating = chrome.windows.create(createData);
let creating = browser.windows.create(createData);
creating.then(() => {
console.log("The news panel has been created");
});
@@ -44,6 +44,13 @@ document.addEventListener("click", e => {
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) {
browser.runtime.sendMessage({ rtc: "enableWebRTC" });
} else {
browser.runtime.sendMessage({ rtc: "disableWebRTC" });
}
return;
}
e.preventDefault();

View File

@@ -22,7 +22,7 @@
],
"manifest_version": 2,
"name": "__MSG_extensionName__",
"version": "0.36",
"version": "0.37",
"description": "__MSG_extensionDescription__",
"homepage_url": "https://github.com/eyedeekay/i2psetproxy.js",
"icons": {
@@ -39,7 +39,6 @@
},
"background": {
"scripts": [
"chromium/browser-polyfill.js",
"privacy.js",
"platform.js",
"background.js",

View File

@@ -1,23 +1,13 @@
function getChrome() {
if (browser.runtime.getBrowserInfo == undefined) {
console.log("Running in Chrome detected");
return true;
}
return false;
}
function isDroid() {
if (!getChrome()) {
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;
}
});
}
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;
}
});
return false;
}

View File

@@ -1,10 +1,3 @@
function getChrome() {
if (chrome.runtime.getBrowserInfo == undefined) {
return true;
}
return false;
}
function onSet(result) {
if (result) {
console.log("->: Value was updated");
@@ -16,52 +9,46 @@ function onSet(result) {
// This disables queries to centralized databases of bad URLs to screen for
// risky sites in your browser
function disableHyperlinkAuditing() {
if (!getChrome()) {
var setting = browser.privacy.websites.hyperlinkAuditingEnabled.set({
value: false
});
console.log("Disabling hyperlink auditing/val=", {
value: false
});
setting.then(onSet);
}
var setting = browser.privacy.websites.hyperlinkAuditingEnabled.set({
value: false
});
console.log("Disabling hyperlink auditing/val=", {
value: false
});
setting.then(onSet);
}
// This enables first-party isolation
function enableFirstPartyIsolation() {
if (!getChrome()) {
var setting = browser.privacy.websites.firstPartyIsolate.set({
value: true
});
console.log("Enabling first party isolation/val=", {
value: true
});
setting.then(onSet);
}
var setting = browser.privacy.websites.firstPartyIsolate.set({
value: true
});
console.log("Enabling first party isolation/val=", {
value: true
});
setting.then(onSet);
}
// This rejects tracking cookies and third-party cookies but it
// LEAVES "Persistent" Cookies unmodified in favor of an option in the content
// interface for now
function disableEvilCookies() {
if (!getChrome()) {
var getting = browser.privacy.websites.cookieConfig.get({});
getting.then(got => {
var setting = browser.privacy.websites.cookieConfig.set({
value: {
behavior: "reject_third_party",
nonPersistentCookies: got.value.nonPersistentCookies
}
});
console.log("Setting cookie behavior/val=", {
value: {
behavior: "reject_third_party",
nonPersistentCookies: got.value.nonPersistentCookies
}
});
setting.then(onSet);
var getting = browser.privacy.websites.cookieConfig.get({});
getting.then(got => {
var setting = browser.privacy.websites.cookieConfig.set({
value: {
behavior: "reject_third_party",
nonPersistentCookies: got.value.nonPersistentCookies
}
});
}
console.log("Setting cookie behavior/val=", {
value: {
behavior: "reject_third_party",
nonPersistentCookies: got.value.nonPersistentCookies
}
});
setting.then(onSet);
});
}
// Make sure that they're gone
@@ -77,63 +64,55 @@ function disableEvilCookies() {
// this disables the use of referrer headers
function disableReferrers() {
if (!getChrome()) {
var setting = browser.privacy.websites.referrersEnabled.set({
value: false
});
console.log("Disabling referrer headers/val=", {
value: false
});
setting.then(onSet);
}
var setting = browser.privacy.websites.referrersEnabled.set({
value: false
});
console.log("Disabling referrer headers/val=", {
value: false
});
setting.then(onSet);
}
// enable fingerprinting resistent features(letterboxing and stuff)
function enableResistFingerprinting() {
if (!getChrome()) {
var setting = browser.privacy.websites.referrersEnabled.set({
value: true
});
console.log("Enabling resist fingerprinting/val=", {
value: true
});
setting.then(onSet);
}
var setting = browser.privacy.websites.referrersEnabled.set({
value: true
});
console.log("Enabling resist fingerprinting/val=", {
value: true
});
setting.then(onSet);
}
// This is essentially a blocklist of clearnet web-sites known to do bad tracking
function enableTrackingProtection() {
if (!getChrome()) {
var setting = browser.privacy.websites.trackingProtectionMode.set({
value: "always"
});
console.log("Enabling tracking protection/val=", {
value: "always"
});
setting.then(onSet);
}
var setting = browser.privacy.websites.trackingProtectionMode.set({
value: "always"
});
console.log("Enabling tracking protection/val=", {
value: "always"
});
setting.then(onSet);
}
// This disables protected content, which is a form of digital restrictions
// management dependent on identifying information
function disableDigitalRestrictionsManagement() {
if (!getChrome()) {
var gettingInfo = browser.runtime.getPlatformInfo();
gettingInfo.then(got => {
if (got.os == "win") {
var setting = browser.privacy.websites.protectedContentEnabled.set({
var gettingInfo = browser.runtime.getPlatformInfo();
gettingInfo.then(got => {
if (got.os == "win") {
var setting = browser.privacy.websites.protectedContentEnabled.set({
value: false
});
console.log(
"Setting Protected Content(Digital Restrictions Management) false/val=",
{
value: false
});
console.log(
"Setting Protected Content(Digital Restrictions Management) false/val=",
{
value: false
}
);
setting.then(onSet);
}
});
}
}
);
setting.then(onSet);
}
});
}
function setAllPrivacy() {
@@ -149,14 +128,12 @@ function setAllPrivacy() {
setAllPrivacy();
function ResetPeerConnection() {
if (!getChrome()) {
browser.privacy.network.peerConnectionEnabled.set({
value: false
});
browser.privacy.network.networkPredictionEnabled.set({
value: false
});
}
browser.privacy.network.peerConnectionEnabled.set({
value: false
});
browser.privacy.network.networkPredictionEnabled.set({
value: false
});
chrome.privacy.network.webRTCIPHandlingPolicy.set({
value: "disable_non_proxied_udp"
});
@@ -164,14 +141,12 @@ function ResetPeerConnection() {
}
function EnablePeerConnection() {
if (!getChrome()) {
browser.privacy.network.peerConnectionEnabled.set({
value: true
});
browser.privacy.network.networkPredictionEnabled.set({
value: false
});
}
browser.privacy.network.peerConnectionEnabled.set({
value: true
});
browser.privacy.network.networkPredictionEnabled.set({
value: false
});
chrome.privacy.network.webRTCIPHandlingPolicy.set({
value: "disable_non_proxied_udp"
});
@@ -214,10 +189,8 @@ function checkStoredSettings(storedSettings) {
chrome.storage.local.set(appSettings);
}
if (!getChrome()) {
const gettingStoredSettings = browser.storage.local.get();
gettingStoredSettings.then(checkStoredSettings, onError);
}
const gettingStoredSettings = browser.storage.local.get();
gettingStoredSettings.then(checkStoredSettings, onError);
function clearCookiesContext(cookieStoreId) {}
@@ -315,7 +288,7 @@ function forgetBrowsingData(storedSettings) {
});
removing.then(onGot, onError);
}
console.log("Cleared cookies")
console.log("Cleared cookies");
}
function deepCleanContext(cookieStoreIds) {
@@ -368,8 +341,15 @@ function onGot(contexts) {
}
}
function onError(e) {
console.error(e);
}
browser.runtime.onMessage.addListener(message);
//browser.contextualIdentities.query("i2pbrowser").then(clearCookiesContext, onError);
function message(message) {
console.log(message);
if (message.rtc === "enableWebRTC") {
console.log("enableWebRTC");
EnablePeerConnection();
} else {
console.log("disableWebRTC");
ResetPeerConnection();
}
}

View File

@@ -1,9 +1,7 @@
if (!getChrome()) {
browser.privacy.network.peerConnectionEnabled.set({
value: false
});
console.log("Preliminarily disabled WebRTC.");
}
browser.privacy.network.peerConnectionEnabled.set({
value: false
});
console.log("Preliminarily disabled WebRTC.");
chrome.privacy.network.networkPredictionEnabled.set({
value: false
@@ -73,7 +71,13 @@ var handleContextProxyRequest = async function(requestDetails) {
};
if (requestDetails.tabId > 0) {
if (i2pHost(requestDetails.url)) {
if (proxyHost(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);
@@ -160,33 +164,14 @@ function setupProxy() {
var Host = getHost();
var Port = getPort();
var Scheme = getScheme();
if (!getChrome()) {
/**/
console.log("Setting up Firefox WebExtension proxy");
browser.proxy.onRequest.addListener(handleContextProxyRequest, {
urls: ["<all_urls>"]
});
console.log("i2p settings created for WebExtension Proxy");
/**/
} else {
var config = {
mode: "fixed_servers",
rules: {
singleProxy: {
scheme: Scheme,
host: Host,
port: parseInt(Port)
}
}
};
chrome.proxy.settings.set(
{
value: config,
scope: "regular"
},
function() {}
);
}
/**/
console.log("Setting up Firefox WebExtension proxy");
browser.proxy.onRequest.addListener(handleContextProxyRequest, {
urls: ["<all_urls>"]
});
console.log("i2p settings created for WebExtension Proxy");
/**/
}
function checkStoredSettings(storedSettings) {
@@ -229,8 +214,6 @@ chrome.storage.local.get(function(got) {
});
// Theme all currently open windows
if (!getChrome()) {
if (!isDroid()) {
browser.windows.getAll().then(wins => wins.forEach(themeWindow));
}
if (!isDroid()) {
browser.windows.getAll().then(wins => wins.forEach(themeWindow));
}

View File

@@ -107,7 +107,7 @@ var contextSetup = async function(requestDetails) {
});
created.then(onCreated, onError);
}
getting = browser.windows.create();
getting = browser.windows.getCurrent();
getting.then(Create);
return tabId;
}
@@ -145,7 +145,7 @@ var contextSetup = async function(requestDetails) {
});
created.then(onCreated, onError);
}
getting = browser.windows.create();
getting = browser.windows.getCurrent();
getting.then(Create);
return tabId;
}
@@ -197,6 +197,19 @@ function i2pHost(url) {
return hostname.endsWith(".i2p");
}
function proxyHost(url) {
let hostname = "";
if (url.indexOf("://") > -1) {
hostname = url.split("/")[2];
} else {
hostname = url.split("/")[0];
}
if (hostname == "proxy.i2p") {
return true;
}
return false;
}
function routerHost(url) {
let hostname = "";
if (url.indexOf("://") > -1) {
@@ -230,3 +243,25 @@ 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);
};
}
*/

View File

@@ -27,14 +27,16 @@
<!-- <a href="#" id="generate-fresh-tunnel> Generate a Fresh Tunnel</a>"-->
<!-- -->
<strong><a href="#" id="clear-browser-data">Clear all browsing data</a></strong><br>
<!--<strong><a href="#" id="temp-enable-webrtc">Temporarily enable WebRTC</a></strong><br>-->
<div class="panel-section-separator"></div>
<a href="http://i2pforum.i2p" id="window-create-forum-panel">Visit the I2P Forums</a><br>
<a href="http://i2p-projekt.i2p/blog" id="window-create-news-panel">Get the latest I2P News</a><br>
<div class="panel-section-separator"></div>
<!--<div id="proxy-health">Proxy is:</div>-->
<input type="checkbox" id="enable-web-rtc" name="enablewebrtc" value="webrtc">
<label for="enable-web-rtc">Enable WebRTC <strong>with Proxy?</strong></label>
<div class="panel-section-separator"></div>
<a href="#" id="check-i2p-control">Check I2P Router Health</a><div id="panel-section-i2pcontrol-check"></div>
<div class="panel-section-separator"></div>
<div class="panel-section-identity">
<div id="identity-list"></div>
</div>
@@ -45,7 +47,7 @@
<script src="context.js"></script>
<script src="privacy.js"></script>
<script src="info.js"></script>
<script src="content.js"></script>
<script src="content.js" crossorigin="anonymous"></script>
<script src="i2pcontrol.js"></script>
</body>