Start working on the i2pcontrol messaging feature

This commit is contained in:
idk
2019-10-17 18:54:39 -04:00
parent 924dd29323
commit 6cd37b51c0
4 changed files with 59 additions and 5 deletions

View File

@ -35,7 +35,7 @@ clean:
## ODD RELEASES are SELFHOSTED RELEASES
MOZ_VERSION=0.36
VERSION=0.36
VERSION=0.37
#VERSION=1.27
xpi:
@ -78,9 +78,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

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;
};
}

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": {