Fixed glance opening on non-http(s) or file links such as magnet links (closes https://github.com/zen-browser/desktop/issues/7173)

This commit is contained in:
mr. m
2025-04-03 13:18:27 +02:00
parent 91494aaf1c
commit b677b9d46d

View File

@@ -497,6 +497,10 @@
if (url1.startsWith('about:')) {
return true;
}
// https://github.com/zen-browser/desktop/issues/7173: Only glance up links that are http(s) or file
if (!url1.startsWith('http') && !url1.startsWith('https') && !url1.startsWith('file')) {
return false;
}
return Services.io.newURI(url1).host !== url2.host;
} catch (e) {
return true;