fix: mobile Subdomains normalisieren (m.bild.de → www.bild.de)

This commit is contained in:
2026-06-12 17:17:09 +02:00
parent f19deb1897
commit b9a596a3b5

View File

@@ -15,8 +15,21 @@ export default function PaywallKiller() {
const inputRef = useRef(null);
function getTargetUrl() {
const url = inputUrl.trim();
return url.startsWith('http') ? url : 'https://' + url;
let url = inputUrl.trim();
if (!url.startsWith('http')) url = 'https://' + url;
// Mobile Subdomains auf Desktop normalisieren (m.bild.de → www.bild.de)
// damit archive.ph den richtigen Snapshot findet
try {
const u = new URL(url);
if (u.hostname.startsWith('m.')) {
u.hostname = 'www.' + u.hostname.slice(2);
url = u.toString();
} else if (u.hostname.startsWith('mobile.')) {
u.hostname = 'www.' + u.hostname.slice(7);
url = u.toString();
}
} catch {}
return url;
}
function handleSearch() {