Skip to content

Commit

Permalink
Merge pull request #89 from eyedeekay/dzf
Browse files Browse the repository at this point in the history
Dzf
  • Loading branch information
eyedeekay authored Mar 24, 2020
2 parents 97ee549 + e54754a commit a8eb2b9
Show file tree
Hide file tree
Showing 12 changed files with 101 additions and 14 deletions.
14 changes: 9 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@ clean: rc clean-artifacts
## EVEN RELEASES are AMO RELEASES
## ODD RELEASES are SELFHOSTED RELEASES

MOZ_VERSION=0.68
VERSION=0.67
MOZ_VERSION=0.70
VERSION=0.69

## INCREMENT THIS EVERY TIME YOU DO A RELEASE
LAST_VERSION=0.63
LAST_VERSION=0.67

YELLOW=F7E59A
ORANGE=FFC56D
Expand Down Expand Up @@ -143,7 +143,7 @@ recreate-release: delete-release release upload

upload: upload-xpi upload-deb

full-release: release submit upload-xpi torrent upload-torrent deb upload-deb upload-rss
full-release: release submit upload-xpi torrent upload-torrent deb upload-deb upload-rss upload-updatemanifest snark-mirror

WEB_EXT_API_KEY=AMO_KEY
WEB_EXT_API_SECRET=AMO_SECRET
Expand Down Expand Up @@ -323,4 +323,8 @@ snark-mirror:
http_proxy=http://127.0.0.1:4444 wget -c -O ../i2psnark-rpc.su3 http://stats.i2p/i2p/plugins/i2psnark-rpc.su3
gothub upload -R -u eyedeekay -r I2P-in-Private-Browsing-Mode-Firefox -t $(VERSION) -n "i2psnark-rpc.su3" -f ../i2psnark-rpc.su3
http_proxy=http://127.0.0.1:4444 wget -c -O ../i2psnark-rpc-update.su3 http://stats.i2p/i2p/plugins/i2psnark-rpc-update.su3
gothub upload -R -u eyedeekay -r I2P-in-Private-Browsing-Mode-Firefox -t $(VERSION) -n "i2psnark-rpc-update.su3" -f ../i2psnark-rpc-update.su3
gothub upload -R -u eyedeekay -r I2P-in-Private-Browsing-Mode-Firefox -t $(VERSION) -n "i2psnark-rpc-update.su3" -f ../i2psnark-rpc-update.su3

seed:
cp -v "./i2ppb-$(VERSION)@eyedeekay.github.io.xpi.torrent" "$(HOME)/.i2p/i2psnark"
cp -v "../i2ppb-$(VERSION)@eyedeekay.github.io.xpi" "$(HOME)/.i2p/i2psnark"
8 changes: 8 additions & 0 deletions _locales/en/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,14 @@
"message": "Hidden Services Manager (Private)",
"description": "Preface for the browser titlebar"
},
"muwirePreface": {
"message": "MuWire",
"description": "Preface for the browser titlebar"
},
"muwirePrefacePrivate": {
"message": "MuWire (Private)",
"description": "Preface for the browser titlebar"
},
"resetMessage": {
"message": "Reset Tunnel",
"description": "Message for the Reset Tunnel button"
Expand Down
10 changes: 10 additions & 0 deletions background.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ var tunnelprefpriv = chrome.i18n.getMessage("i2ptunnelPrefacePrivate");
var localpref = chrome.i18n.getMessage("localPreface");
var localprefpriv = chrome.i18n.getMessage("localPrefacePrivate");
var extensionpref = chrome.i18n.getMessage("extensionPreface");
var muwirepref = chrome.i18n.getMessage("muwirePreface");

function onContextsGot(contexts) {
var ids = [];
Expand Down Expand Up @@ -84,6 +85,15 @@ function onContextsGot(contexts) {
})
.then(onCreated, onNotCreated);
}
if (ids.indexOf(localpref) == -1) {
browser.contextualIdentities
.create({
name: muwirepref,
color: "turquoise",
icon: "gift"
})
.then(onCreated, onNotCreated);
}
}

function onContextsError() {
Expand Down
4 changes: 1 addition & 3 deletions bookmarks.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,7 @@ gettingInfo.then(got => {
createBookmark.then(onCreated);
} else {
let createRhizomeBookmark = browser.bookmarks.create({
url:
"http://" + control_host + ":" + control_port + "/home",
url: "http://" + control_host + ":" + control_port + "/home",
title: "I2P Console",
parentId: bookmarkToolbar[0].id
});
Expand Down Expand Up @@ -176,7 +175,6 @@ gettingInfo.then(got => {
title: "I2P Console"
});
b4.then(bookConsole, onRejected);

}

var bt = browser.bookmarks.search({
Expand Down
7 changes: 7 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
i2psetproxy.js (0.69-1) UNRELEASED; urgency=low

* Add MuWire contextual ID
* Fix bug occurring on certain modded I2P installs

-- idk <[email protected]> Tue, 24 MAR 2020 0:12:02 -0400

i2psetproxy.js (0.67-1) UNRELEASED; urgency=low

* Tweak some default settings that should have gone into 65
Expand Down
4 changes: 4 additions & 0 deletions handler.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
function routerHost(url) {
let hostname = "";
let path = "";
console.log("(urlcheck)", url);
function pathcheck(str) {
if (str != undefined) {
let final = str.split("/")[0];
Expand All @@ -13,6 +14,9 @@ function routerHost(url) {
} else if (final === "webmail" || final === "susimail") {
console.log("(urlcheck) application path", final);
return "webmail";
} else if (final.startsWith("MuWire") && !final.contains("png")) {
console.log("(urlcheck) application path", final);
return "muwire";
} else if (
final === "home" ||
final === "console" ||
Expand Down
9 changes: 8 additions & 1 deletion host.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ function proxyHost(url) {
if (hostname == "proxy.i2p") {
return true;
}
if (hostname == "c6lilt4cr5x7jifxridpkesf2zgfwqfchtp6laihr4pdqomq25iq.b32.i2p") {
if (
hostname == "c6lilt4cr5x7jifxridpkesf2zgfwqfchtp6laihr4pdqomq25iq.b32.i2p"
) {
return true;
}
return false;
Expand Down Expand Up @@ -60,6 +62,7 @@ function i2pHost(url) {
function routerHost(url) {
let hostname = "";
let path = "";
console.log("(urlcheck)", url);
function pathcheck(str) {
if (str != undefined) {
let final = str.split("/")[0];
Expand All @@ -76,10 +79,14 @@ function routerHost(url) {
} else if (final === "webmail" || final === "susimail") {
console.log("(urlcheck) application path", final);
return "webmail";
} else if (final.startsWith("MuWire") && !final.contains("png")) {
console.log("(urlcheck) application path", final);
return "muwire";
} else if (
final === "home" ||
final === "console" ||
final === "dns" ||
final === "sitemap" ||
final.startsWith("config")
) {
console.log("(urlcheck) application path", final);
Expand Down
Binary file modified [email protected]
Binary file not shown.
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ <h2>Bittorrent Download:</h2>
dead).</p>

<ul>
<li><a href="magnet:?xt=urn:btih:e7bbb4695f63d068522713028987626284aa91d0">Magnet Link</a></li>
<li><a href="magnet:?xt=urn:btih:67155fd97fd5edad4afa3a9625f54b8a6ddfce6d">Magnet Link</a></li>
<li><a href="./[email protected]">Get the .torrent file</a></li>
</ul>

Expand Down
4 changes: 2 additions & 2 deletions manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
],
"manifest_version": 2,
"name": "__MSG_extensionName__",
"version": "0.66",
"version_name": "0.66",
"version": "0.69",
"version_name": "0.69",
"description": "__MSG_extensionDescription__",
"homepage_url": "https://github.com/eyedeekay/I2P-in-Private-Browsing-Mode-Firefox",
"icons": {
Expand Down
2 changes: 1 addition & 1 deletion options/options.js
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ function onError(e) {
}

function storeSettings() {
let storableSettings = {}
let storableSettings = {};
storableSettings["proxy_scheme"] = getScheme();
storableSettings["proxy_host"] = getHost();
storableSettings["proxy_port"] = getPort();
Expand Down
51 changes: 50 additions & 1 deletion scrub.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ var torrentpref = chrome.i18n.getMessage("torrentPreface");
var tunnelpref = chrome.i18n.getMessage("i2ptunnelPreface");
var localpref = chrome.i18n.getMessage("localPreface");
var extensionpref = chrome.i18n.getMessage("extensionPreface");
var muwirepref = chrome.i18n.getMessage("muwirePreface");

var contextScrub = async function(requestDetails) {
function onHeaderError() {
Expand Down Expand Up @@ -107,6 +108,9 @@ var notMyContextNotMyProblem = async function() {
var context6 = await browser.contextualIdentities.query({
name: localpref
});
var context7 = await browser.contextualIdentities.query({
name: muwirepref
});
var othercontexts = [];
console.log("Contexts:", contexts);
for (context in contexts) {
Expand All @@ -116,7 +120,8 @@ var notMyContextNotMyProblem = async function() {
contexts[context].cookieStoreId == context3[0].cookieStoreId ||
contexts[context].cookieStoreId == context4[0].cookieStoreId ||
contexts[context].cookieStoreId == context5[0].cookieStoreId ||
contexts[context].cookieStoreId == context6[0].cookieStoreId
contexts[context].cookieStoreId == context6[0].cookieStoreId ||
contexts[context].cookieStoreId == context7[0].cookieStoreId
) {
console.log(
"Context found",
Expand Down Expand Up @@ -298,6 +303,47 @@ var contextSetup = function(requestDetails) {
console.log("(isolate)Context Error", error);
}
};
var muwireTabFind = async function(tabId) {
try {
var context = await browser.contextualIdentities.query({
name: muwirepref
});
if (tabId.cookieStoreId != context[0].cookieStoreId) {
function Create() {
function onCreated(tab) {
function closeOldTab(tabs) {
if (tabId.id != tab.id) {
console.log("(isolate) Closing un-isolated tab", tabId.id);
console.log("in favor of", tab.id);
console.log("with context", tab.cookieStoreId);
browser.tabs.remove(tabId.id);
}
for (index = 0; index < tabs.length; index++) {
if (index != tabs.length - 1)
browser.tabs.remove(tabs[index].id);
}
}
var pins = browser.tabs.query({
cookieStoreId: context[0].cookieStoreId
});
pins.then(closeOldTab, onError);
}
var created = browser.tabs.create({
active: true,
pinned: true,
cookieStoreId: context[0].cookieStoreId,
url: requestDetails.url
});
created.then(onCreated, onContextError);
}
var gettab = browser.tabs.get(tabId.id);
gettab.then(Create, onContextError);
return tabId;
}
} catch (error) {
console.log("(isolate)Context Error", error);
}
};
var mailTabFind = async function(tabId) {
try {
var context = await browser.contextualIdentities.query({
Expand Down Expand Up @@ -498,6 +544,9 @@ var contextSetup = function(requestDetails) {
} else if (routerhost === "routerconsole") {
var routertab = tab.then(routerTabFind, onContextError);
return requestDetails;
} else if (routerhost === "muwire") {
var routertab = tab.then(muwireTabFind, onContextError);
return requestDetails;
}
} else {
if (localhost) {
Expand Down

0 comments on commit a8eb2b9

Please sign in to comment.