From 93af02942ac87bfae512d785ab55e9bf1932f755 Mon Sep 17 00:00:00 2001 From: Raptor Date: Sun, 5 Jan 2025 13:54:19 +0100 Subject: [PATCH] Added support for RFC 5870 geo-URIs --- src/public/app/services/link.ts | 4 ++-- src/services/html_sanitizer.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/public/app/services/link.ts b/src/public/app/services/link.ts index 3d44a624d..752a39e4b 100644 --- a/src/public/app/services/link.ts +++ b/src/public/app/services/link.ts @@ -276,7 +276,7 @@ function goToLinkExt(evt: MouseEvent | JQuery.ClickEvent, hrefLink: string | und ) { if (hrefLink.toLowerCase().startsWith('http') || hrefLink.startsWith("api/")) { window.open(hrefLink, '_blank'); - } else if (hrefLink.toLowerCase().startsWith('file:') && utils.isElectron()) { + } else if ((hrefLink.toLowerCase().startsWith('file:') || hrefLink.toLowerCase().startsWith('geo:')) && utils.isElectron()) { const electron = utils.dynamicRequire('electron'); electron.shell.openPath(hrefLink); } else { @@ -287,7 +287,7 @@ function goToLinkExt(evt: MouseEvent | JQuery.ClickEvent, hrefLink: string | und 'http', 'https', 'ftp', 'ftps', 'mailto', 'data', 'evernote', 'file', 'facetime', 'gemini', 'git', 'gopher', 'imap', 'irc', 'irc6', 'jabber', 'jar', 'lastfm', 'ldap', 'ldaps', 'magnet', 'message', 'mumble', 'nfs', 'onenote', 'pop', 'rmi', 's3', 'sftp', 'skype', 'sms', 'spotify', 'steam', 'svn', 'udp', - 'view-source', 'vlc', 'vnc', 'ws', 'wss', 'xmpp', 'jdbc', 'slack', 'tel', 'smb', 'zotero' + 'view-source', 'vlc', 'vnc', 'ws', 'wss', 'xmpp', 'jdbc', 'slack', 'tel', 'smb', 'zotero', 'geo' ]; if (allowedSchemes.some(protocol => hrefLink.toLowerCase().startsWith(protocol+':'))){ window.open(hrefLink, '_blank'); diff --git a/src/services/html_sanitizer.ts b/src/services/html_sanitizer.ts index 0dc9b3d18..684730097 100644 --- a/src/services/html_sanitizer.ts +++ b/src/services/html_sanitizer.ts @@ -60,7 +60,7 @@ function sanitize(dirtyHtml: string) { 'http', 'https', 'ftp', 'ftps', 'mailto', 'data', 'evernote', 'file', 'facetime', 'gemini', 'git', 'gopher', 'imap', 'irc', 'irc6', 'jabber', 'jar', 'lastfm', 'ldap', 'ldaps', 'magnet', 'message', 'mumble', 'nfs', 'onenote', 'pop', 'rmi', 's3', 'sftp', 'skype', 'sms', 'spotify', 'steam', 'svn', 'udp', - 'view-source', 'vlc', 'vnc', 'ws', 'wss', 'xmpp', 'jdbc', 'slack', 'tel', 'smb', 'zotero' + 'view-source', 'vlc', 'vnc', 'ws', 'wss', 'xmpp', 'jdbc', 'slack', 'tel', 'smb', 'zotero', 'geo' ], nonTextTags: [ 'head'