aboutsummaryrefslogtreecommitdiffstats
path: root/src/pages/options/twitter
diff options
context:
space:
mode:
Diffstat (limited to 'src/pages/options/twitter')
-rw-r--r--src/pages/options/twitter/twitter.html21
-rw-r--r--src/pages/options/twitter/twitter.js25
-rw-r--r--src/pages/options/twitter/twitter.pug3
3 files changed, 4 insertions, 45 deletions
diff --git a/src/pages/options/twitter/twitter.html b/src/pages/options/twitter/twitter.html
index 2bd204aa..95e0a0bf 100644
--- a/src/pages/options/twitter/twitter.html
+++ b/src/pages/options/twitter/twitter.html
@@ -117,27 +117,6 @@
</form>
<div class="checklist custom-checklist"></div>
</div>
- <div class="i2p">
- <div class="some-block option-block">
- <h4 data-localise="__MSG_defaultInstances__">Default Instances</h4>
- </div>
- <div class="checklist"></div>
- <hr>
- <div class="some-block option-block">
- <h4 data-localise="__MSG_customInstances__">Custom Instances</h4>
- </div>
- <form class="custom-instance-form">
- <div class="some-block option-block">
- <input class="custom-instance" placeholder="https://nitter.i2p" type="url">
- <button class="add add-instance" type="submit">
- <svg xmlns="https://www.w3.org/2000/svg" height="20px" viewBox="0 0 24 24" width="20px" fill="currentColor">
- <path d="M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"></path>
- </svg>
- </button>
- </div>
- </form>
- <div class="checklist custom-checklist"></div>
- </div>
</div>
</section>
<script type="module" src="../init.js"></script>
diff --git a/src/pages/options/twitter/twitter.js b/src/pages/options/twitter/twitter.js
index c23007f9..72c3d926 100644
--- a/src/pages/options/twitter/twitter.js
+++ b/src/pages/options/twitter/twitter.js
@@ -1,5 +1,5 @@
import twitterHelper from "../../../assets/javascripts/helpers/twitter.js";
-import commonHelper from "../../../assets/javascripts/helpers/common.js";
+import utils from "../../../assets/javascripts/helpers/utils.js";
let disable = document.getElementById("disable-nitter");
let protocol = document.getElementById("protocol");
@@ -47,24 +47,7 @@ function changeProtocolSettings() {
}
}
-commonHelper.processDefaultCustomInstances('twitter', 'nitter', 'normal', document);
-commonHelper.processDefaultCustomInstances('twitter', 'nitter', 'tor', document)
+utils.processDefaultCustomInstances('twitter', 'nitter', 'normal', document);
+utils.processDefaultCustomInstances('twitter', 'nitter', 'tor', document)
-let latencyElement = document.getElementById("latency");
-let latencyLabel = document.getElementById("latency-label");
-latencyElement.addEventListener("click",
- async () => {
- let reloadWindow = () => location.reload();
- latencyElement.addEventListener("click", reloadWindow);
- await twitterHelper.init();
- let redirects = twitterHelper.getRedirects();
- const oldHtml = latencyLabel.innerHTML;
- latencyLabel.innerHTML = '...';
- commonHelper.testLatency(latencyLabel, redirects.nitter.normal).then(r => {
- browser.storage.local.set({ nitterLatency: r });
- latencyLabel.innerHTML = oldHtml;
- commonHelper.processDefaultCustomInstances('twitter', 'nitter', 'normal', document);
- latencyElement.removeEventListener("click", reloadWindow)
- });
- }
-); \ No newline at end of file
+utils.latency('twitter', 'nitter', document, location) \ No newline at end of file
diff --git a/src/pages/options/twitter/twitter.pug b/src/pages/options/twitter/twitter.pug
index af7b7f19..517a2727 100644
--- a/src/pages/options/twitter/twitter.pug
+++ b/src/pages/options/twitter/twitter.pug
@@ -28,9 +28,6 @@ body.option(dir="auto")
.tor
include ../../widgets/instances.pug
+instances('https://nitter.onion')
- .i2p
- include ../../widgets/instances.pug
- +instances('https://nitter.i2p')
script(type="module" src="../init.js")