update the links inside the homepage. The plugin hosts it's own official homepage. How's that for distributed.
This commit is contained in:
@@ -197,5 +197,3 @@ 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
|
||||
1
home.css
1
home.css
@@ -211,7 +211,6 @@ li {
|
||||
width: 30%;
|
||||
min-width: 30%;
|
||||
background: #dee2e6;
|
||||
float: left;
|
||||
text-align: center!important;
|
||||
border: 1px solid #dee2e6;
|
||||
border-radius: 2px;
|
||||
|
||||
12
home.html
12
home.html
@@ -10,7 +10,7 @@
|
||||
</head>
|
||||
<body>
|
||||
<!--<div>-->
|
||||
<script src="home.js" type="text/javascript"></script>
|
||||
<script src="home.js" type="text/javascript"></script>
|
||||
<script src="content.js" type="text/javascript"></script>
|
||||
<div class='background'>
|
||||
<div class='content'>
|
||||
@@ -120,15 +120,19 @@
|
||||
|
||||
<ul>
|
||||
<li>
|
||||
<a href="https://eyedeekay.github.io/I2P-in-Private-Browsing-Mode-Firefox/" id="window-visit-webpage">Homepage:</a> <span class="applicationDesc" id="webpage">More information is available here.</span>
|
||||
<a href="http://i2p-projekt.i2p/">I2P Project Homepage:</a> <span class="applicationDesc" id="webpage">More information is available here.</span>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="https://github.com/eyedeekay/I2P-in-Private-Browsing-Mode-Firefox" id="window-visit-sources">Source Code:</a> <span class="applicationDesc" id="sources">Browse the source or contribute here.</span>
|
||||
<a href="/index.html">Webextension Homepage:</a> <span class="applicationDesc" id="webpage">More information is available here.</span>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="https://github.com/eyedeekay/I2P-in-Private-Browsing-Mode-Firefox" id="window-visit-releases">Releases:</a> <span class="applicationDesc" id="releases">Check for new releases here.</span>
|
||||
<a href="http://gittest.i2p/idk/I2P-in-Private-Browsing-Mode-Firefox" id="window-visit-sources">Source Code:</a> <span class="applicationDesc" id="sources">Browse the source of this webextension or contribute here.</span>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="http://gittest.i2p/idk/I2P-in-Private-Browsing-Mode-Firefox/-/releases" id="window-visit-releases">Releases:</a> <span class="applicationDesc" id="releases">Check for new releases here.</span>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
@@ -51,6 +51,7 @@
|
||||
"scripts": [
|
||||
"config.js",
|
||||
"i2pcontrol/i2pcontrol.js",
|
||||
"torrent/torrent.js",
|
||||
"host.js",
|
||||
"privacy.js",
|
||||
"platform.js",
|
||||
@@ -69,11 +70,6 @@
|
||||
"name": "RouterConsole",
|
||||
"uriTemplate": "http://127.0.0.1:7657/%s"
|
||||
},
|
||||
{
|
||||
"protocol": "ext+dati2p",
|
||||
"name": "Dat over I2P",
|
||||
"uriTemplate": "/dat.html#!/%s"
|
||||
},
|
||||
{
|
||||
"protocol": "magnet",
|
||||
"name": "I2PTorrent",
|
||||
|
||||
1
proxy.js
1
proxy.js
@@ -20,7 +20,6 @@ function shouldProxyRequest(requestInfo) {
|
||||
}
|
||||
|
||||
var handleContextProxyRequest = async function(requestDetails) {
|
||||
console.log("(proxy)Searching for proxy by context");
|
||||
try {
|
||||
var handleProxyRequest = function(context) {
|
||||
proxy = {
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
var hello = "hello bittorrent";
|
||||
var hellot = "hello bittorrent";
|
||||
var xTransmissionSessionId = ""
|
||||
|
||||
function makeid(length) {
|
||||
var result = "";
|
||||
@@ -11,7 +12,7 @@ function makeid(length) {
|
||||
return result;
|
||||
}
|
||||
|
||||
function send(
|
||||
function torrentsend(
|
||||
message,
|
||||
control_host = "127.0.0.1",
|
||||
control_port = "7657",
|
||||
@@ -20,20 +21,22 @@ function send(
|
||||
async function postData(url = "", data = {}) {
|
||||
// Default options are marked with *
|
||||
let requestBody = JSON.stringify(data);
|
||||
//console.log("(i2pcontrol)", requestBody, data);
|
||||
console.log("(torrent-rpc) send", requestBody, data);
|
||||
let opts = {
|
||||
method: "POST", // *GET, POST, PUT, DELETE, etc.
|
||||
mode: "cors", // no-cors, *cors, same-origin
|
||||
cache: "no-cache", // *default, no-cache, reload, force-cache, only-if-cached
|
||||
credentials: "same-origin", // include, *same-origin, omit
|
||||
headers: {
|
||||
"Content-Type": "application/json"
|
||||
"Content-Type": "application/json",
|
||||
"X-Transmission-Session-Id": xTransmissionSessionId
|
||||
},
|
||||
redirect: "follow", // manual, *follow, error
|
||||
referrerPolicy: "no-referrer", // no-referrer, *client
|
||||
body: requestBody // body data type must match "Content-Type" header
|
||||
};
|
||||
const response = await fetch(url, opts);
|
||||
console.log("(torrent-rpc) response", response)
|
||||
return await response.json(); // parses JSON response into native JavaScript objects
|
||||
}
|
||||
|
||||
@@ -41,42 +44,48 @@ function send(
|
||||
"http://" + control_host + ":" + control_port + "/" + control_path + "/",
|
||||
message
|
||||
);
|
||||
/* return postData(
|
||||
"http://" + control_host + ":" + control_port + "/" + control_path,
|
||||
message
|
||||
);*/
|
||||
}
|
||||
|
||||
function authenticate(
|
||||
function sessionStats(
|
||||
password = "transmission",
|
||||
control_host = "127.0.0.1",
|
||||
control_port = "7657",
|
||||
control_path = "transmission/rpc"
|
||||
) {
|
||||
let store = browser.storage.local.get("rpc_pass");
|
||||
if (store != undefined) {
|
||||
console.log("Stored password found");
|
||||
password = store;
|
||||
}
|
||||
function auth(got) {
|
||||
var json = new Object();
|
||||
json["id"] = makeid(6);
|
||||
json["jsonrpc"] = "2.0";
|
||||
json["method"] = "Authenticate";
|
||||
json["params"] = new Object();
|
||||
json["params"]["API"] = 1;
|
||||
json["params"]["Password"] = password;
|
||||
return send(json);
|
||||
}
|
||||
store.then(auth);
|
||||
json["method"] = "session-stats";
|
||||
//json["params"] = new Object();
|
||||
return torrentsend(json, control_host, control_port, control_path);
|
||||
}
|
||||
|
||||
async function GetToken(
|
||||
async function GetTorrentToken(
|
||||
password,
|
||||
control_host = "127.0.0.1",
|
||||
control_port = "7657",
|
||||
control_path = "transmission/rpc"
|
||||
) {
|
||||
let me = authenticate(password);
|
||||
return await me.then(gettoken);
|
||||
let me = sessionStats(password);
|
||||
return await me.then(gettorrenttoken);
|
||||
}
|
||||
|
||||
function gettoken(authtoken) {
|
||||
function gettorrenttoken(authtoken) {
|
||||
console.log(authtoken)
|
||||
return authtoken.result.Token;
|
||||
}
|
||||
|
||||
function TorrentDone(result){
|
||||
console.log("(torrent-rpc) recv", result)
|
||||
}
|
||||
|
||||
function TorrentError(result){
|
||||
console.log("(torrent-rpc) recv err", result)
|
||||
}
|
||||
|
||||
var result = GetTorrentToken()
|
||||
result.then(TorrentDone, TorrentError)
|
||||
Reference in New Issue
Block a user