fix: mobile Subdomains normalisieren (m.bild.de → www.bild.de)
This commit is contained in:
@@ -15,8 +15,21 @@ export default function PaywallKiller() {
|
|||||||
const inputRef = useRef(null);
|
const inputRef = useRef(null);
|
||||||
|
|
||||||
function getTargetUrl() {
|
function getTargetUrl() {
|
||||||
const url = inputUrl.trim();
|
let url = inputUrl.trim();
|
||||||
return url.startsWith('http') ? url : 'https://' + url;
|
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() {
|
function handleSearch() {
|
||||||
|
|||||||
Reference in New Issue
Block a user