Skip to content

Commit de85ecf

Browse files
committed
chore: treat hostname as a safelink
1 parent b801e15 commit de85ecf

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

src/base/chat/trustedLink.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,13 @@ eventManager.on('BootstrapDialog:show', (dialog) => {
5555
});
5656

5757
eventManager.on('ChatDetected', () => {
58+
// Add current domain to safe links
59+
safeLinks.add(location.hostname);
60+
5861
globalSet('link', function link(l) {
5962
const url = new URL(l).hostname;
60-
// Undercards is a safe link :D
61-
if (setting.value() && (url === location.hostname || safeLinks.has(url))) return true;
63+
// Allow going to page instantly if it's marked as a safe link
64+
if (setting.value() && safeLinks.has(url)) return true;
6265
// Cache the url for later
6366
cache.value = url;
6467
return this.super(l);

0 commit comments

Comments
 (0)