@@ -65,53 +65,52 @@
|
||||
},
|
||||
"windowVisitI2ptunnel": {
|
||||
"message": "Hidden Services Manager: ",
|
||||
"description": ""
|
||||
"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": "Description for i2ptunnel"
|
||||
},
|
||||
"windowVisitSusimail": {
|
||||
"message": "E-Mail: ",
|
||||
"description": ""
|
||||
"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": "Description for e-mail"
|
||||
},
|
||||
"windowVisitSnark": {
|
||||
"message": "Bittorrent: ",
|
||||
"description": ""
|
||||
"description": "Title for Bittorrent"
|
||||
},
|
||||
"snark": {
|
||||
"message": "I2P is capable of anonymous Peer-to-Peer file sharing using the built-in bittorrent application.",
|
||||
"description": ""
|
||||
"description": "Description for Bittorrent"
|
||||
},
|
||||
"windowVisitSources": {
|
||||
"message": "Extension Source Code: ",
|
||||
"description": ""
|
||||
"description": "Title for source code link"
|
||||
},
|
||||
"sources": {
|
||||
"message": "Browse the source code here",
|
||||
"description": ""
|
||||
"description": "Description for the Source code link"
|
||||
},
|
||||
"windowVisitWebPage": {
|
||||
"message": "Extension Home Page: ",
|
||||
"description": ""
|
||||
"description": "Visit extension homepage on Github"
|
||||
},
|
||||
"webpage": {
|
||||
"homepage": {
|
||||
"message": "More information is available here",
|
||||
"description": ""
|
||||
"description": "Find more information"
|
||||
},
|
||||
"windowVisitReleases": {
|
||||
"message": "Extension Releases: ",
|
||||
"description": ""
|
||||
"description": "Visit the release page"
|
||||
},
|
||||
"releases": {
|
||||
"message": "Check for new releases here",
|
||||
"description": ""
|
||||
"description": "Description for new release page"
|
||||
},
|
||||
|
||||
"titlePreface": {
|
||||
"message": "I2P Browser",
|
||||
"description": "Preface for the browser titlebar"
|
||||
|
||||
@@ -265,12 +265,10 @@ function themeWindow(window) {
|
||||
browser.contextualIdentities
|
||||
.get(tabInfo[0].cookieStoreId)
|
||||
.then(onContextGotTheme, onThemeError);
|
||||
} else if (isEmpty(oldtheme)) {
|
||||
browser.theme.reset();
|
||||
} else {
|
||||
if (isEmpty(oldtheme)) {
|
||||
browser.theme.reset();
|
||||
} else {
|
||||
browser.theme.update(window.id, oldtheme);
|
||||
}
|
||||
browser.theme.update(window.id, oldtheme);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
24
content.js
24
content.js
@@ -2,8 +2,7 @@ function contentUpdateById(id, message) {
|
||||
let infoTitle = document.getElementById(id);
|
||||
let messageContent = chrome.i18n.getMessage(message);
|
||||
if (infoTitle === null) {
|
||||
console.log("content error", id, message);
|
||||
console.log("content error", messageContent);
|
||||
console.log("content error", id, messageContent);
|
||||
return;
|
||||
}
|
||||
infoTitle.textContent = messageContent;
|
||||
@@ -37,29 +36,10 @@ 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");
|
||||
|
||||
/*
|
||||
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)
|
||||
}
|
||||
*/
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
<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'>
|
||||
@@ -88,7 +89,6 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script src="content.js" type="text/javascript"></script>
|
||||
<!--</div>-->
|
||||
</body>
|
||||
</html>
|
||||
|
||||
2
info.js
2
info.js
@@ -55,6 +55,8 @@ document.addEventListener("click", clickEvent => {
|
||||
}
|
||||
refreshIdentity();
|
||||
} else if (clickEvent.target.id === "window-preface-title") {
|
||||
console.log("attempting to create homepage tab");
|
||||
goHome();
|
||||
} else if (clickEvent.target.id === "window-visit-homepage") {
|
||||
console.log("attempting to create homepage tab");
|
||||
goHome();
|
||||
|
||||
@@ -167,7 +167,7 @@ function AssurePeerConnection() {
|
||||
value: "proxy_only"
|
||||
});
|
||||
}
|
||||
rtc = browser.privacy.network.peerConnectionEnabled.get({});
|
||||
let rtc = browser.privacy.network.peerConnectionEnabled.get({});
|
||||
rtc.then(assure);
|
||||
}
|
||||
|
||||
|
||||
41
proxy.js
41
proxy.js
@@ -117,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)) {
|
||||
@@ -181,11 +186,11 @@ function SetupSettings() {
|
||||
|
||||
//
|
||||
function checkHostStoredSettings(storedSettings) {
|
||||
if (storedSettings.proxy_host != undefined) {
|
||||
proxy_host = storedSettings.proxy_host;
|
||||
} else {
|
||||
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();
|
||||
@@ -195,11 +200,11 @@ function SetupSettings() {
|
||||
|
||||
//
|
||||
function checkPortStoredSettings(storedSettings) {
|
||||
if (storedSettings.proxy_port != undefined) {
|
||||
proxy_port = storedSettings.proxy_port;
|
||||
} else {
|
||||
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();
|
||||
@@ -209,11 +214,11 @@ function SetupSettings() {
|
||||
|
||||
//
|
||||
function checkControlHostStoredSettings(storedSettings) {
|
||||
if (storedSettings.control_host != undefined) {
|
||||
control_host = storedSettings.control_host;
|
||||
} else {
|
||||
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();
|
||||
@@ -228,11 +233,11 @@ function SetupSettings() {
|
||||
|
||||
//
|
||||
function checkControlPortStoredSettings(storedSettings) {
|
||||
if (storedSettings.control_port != undefined) {
|
||||
let control_port = storedSettings.control_port;
|
||||
} else {
|
||||
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();
|
||||
@@ -247,11 +252,11 @@ function SetupSettings() {
|
||||
|
||||
//
|
||||
function checkHistoryStoredSettings(storedSettings) {
|
||||
if (storedSettings.disable_history != undefined) {
|
||||
disable_history = storedSettings.disable_history;
|
||||
} else {
|
||||
if (storedSettings.disable_history == undefined) {
|
||||
disable_history = false;
|
||||
storedSettings.disable_history = disable_history;
|
||||
} else {
|
||||
disable_history = storedSettings.disable_history;
|
||||
}
|
||||
console.log(
|
||||
"Initialising Disabled History",
|
||||
@@ -337,14 +342,14 @@ function updateFromStorage() {
|
||||
console.log("updating settings from storage");
|
||||
var gettingInfo = browser.runtime.getPlatformInfo();
|
||||
gettingInfo.then(got => {
|
||||
if (got.os != "android") {
|
||||
browser.windows.getAll().then(wins => wins.forEach(themeWindow));
|
||||
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();
|
||||
|
||||
Reference in New Issue
Block a user