Open links from QR payloads: Ctrl+O opens the decoded URL (browser) instead of the image; clickable Open-link chips in link and QR previews

This commit is contained in:
2026-09-05 22:56:26 +01:00
parent 66ba5bd3db
commit 6da0c42847
6 changed files with 123 additions and 2 deletions
+10
View File
@@ -213,6 +213,16 @@ function urlDomain(url) {
return m ? m[1] : ""
}
// First URL inside arbitrary text ("visit https://x.io/a for more", QR
// payloads, …). Returns "" when none. Bare domains are NOT extracted here —
// too noisy for prose; the shell-side open script has its own fallback.
function extractUrl(text) {
var m = /https?:\/\/[^\s\]"'<>]+/i.exec(String(text || ""))
if (m) return m[0].replace(/[.,;:)!]+$/, "")
m = /(?:^|\s)(www\.[^\s\]"<>]+)/i.exec(String(text || ""))
return m ? m[1].replace(/[.,;:)!]+$/, "") : ""
}
// ---------------------------------------------------------------- apps
var APP_NAMES = {