Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 24 additions & 10 deletions js/links.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,33 @@
window.addEventListener("load", () => {
let list = h("div", {class: "list"});
list.append(
h("div", {}, h("a", {target:"_blank", href: "https://delta.chat"}, "Normal link: https://delta.chat (should ask to open externally)")),
h("div", {}, h("a", {target:"_blank", href: "https://wikipediа.org"}, "punycode link (should ask to open externally, this must not show wikipediа.org but xn--wikipedi-86g.org)")),
h("div", {}, h("a", {target:"_blank", href: "https://xn--wikipedi-86g.org"}, "punycode link2 (should ask to open externally, this as well must not show wikipediа.org but xn--wikipedi-86g.org)")),
h("div", {}, h("a", {href: "mailto:delta@example.org?body=test+message"}, "Mailto link")),
h("div", {}, h("a", {href: "OPENPGP4FPR:571E6FDC22C1605512A1B0C8F7AC9331B82AFB5B#a=delta%40example.org&n=TestContact&i=pHMb3fRw-JV&s=VcWU-pQSEeB"}, "old openpgp4fpr: QR verification link")),
h("div", {}, h("a", {target:"_blank", href: "https://i.delta.chat/#9AF055DB87EC48A1C009B6CA55E3712A6F7D346F&a=botsindex%40nine.testrun.org&n=Public%20Bots&i=QpBSronexvP&s=nAfQ0q_JomN"}, "New i.delta.chat invite link")),
h("div", {}, h("a", {href: "geo:48.844,2.395"}, "geo-url link (geo:)")),
h("div", {}, h("a", {href: "cabal://cabal.chat"}, "Custom scheme link")),
h("div", {}, h("a", {href: "./page.html"}, "Link to an internal HTML page")),
h("div", {}, h("a", {href: "chrome://crash"}, "chrome://crash")),
...[
h("a", {target:"_blank", href: "https://delta.chat"}, "Normal link: https://delta.chat (should ask to open externally)"),
h("a", {target:"_blank", href: "https://wikipediа.org"}, "punycode link (should ask to open externally, this must not show wikipediа.org but xn--wikipedi-86g.org)"),
h("a", {target:"_blank", href: "https://xn--wikipedi-86g.org"}, "punycode link2 (should ask to open externally, this as well must not show wikipediа.org but xn--wikipedi-86g.org)"),
h("a", {href: "mailto:delta@example.org?body=test+message"}, "Mailto link"),
h("a", {href: "OPENPGP4FPR:571E6FDC22C1605512A1B0C8F7AC9331B82AFB5B#a=delta%40example.org&n=TestContact&i=pHMb3fRw-JV&s=VcWU-pQSEeB"}, "old openpgp4fpr: QR verification link"),
h("a", {target:"_blank", href: "https://i.delta.chat/#9AF055DB87EC48A1C009B6CA55E3712A6F7D346F&a=botsindex%40nine.testrun.org&n=Public%20Bots&i=QpBSronexvP&s=nAfQ0q_JomN"}, "New i.delta.chat invite link"),
h("a", {href: "geo:48.844,2.395"}, "geo-url link (geo:)"),
h("a", {href: "cabal://cabal.chat"}, "Custom scheme link"),
h("a", {href: "./page.html"}, "Link to an internal HTML page"),
h("a", {href: "chrome://crash"}, "chrome://crash"),
].map(el => h("div", {}, el, makeSpamButton(el)))
);

document.getElementById("links-output").append(
createHeader("Links"), h("div", {class: "container"}, list)
);
});

function makeSpamButton(elToSpam) {
const button = document.createElement("button")
button.innerText = "Spam"
button.onclick = () => {
const interval = setInterval(() => {
elToSpam.click()
}, 250)
setTimeout(() => clearInterval(interval), 5000)
}
return button
}