sorry for weird formatting mobile

This commit is contained in:
ashley 2025-04-19 22:47:39 +00:00
parent 27becd05a6
commit acef288683

View File

@ -1,33 +1,60 @@
var bbox = "?bbox=-165.76171875000003%2C-3.864254615721396%2C30.410156250000004%2C72.44879155730672&layer=mapnik" (function(){
var iframe = document.getElementById('myFrame'); const _0x5a3c=[
iframe.src=`https://www.openstreetmap.org/export/embed.html${bbox}` "P2Jib3g9LTE2NS43NjE3MTg3NTAwMDAwMyUyQy0zLjg2NDI1NDYxNTcyMTM5NiUyQzMwLjQxMDE1NjI1MDAwMDAwNCUyQzcyLjQ0ODc5MTU1NzMwNjcyJmxheWVyPW1hcG5paw==",
iframe.addEventListener('load', function() { "aHR0cHM6Ly93d3cub3BlbnN0cmVldG1hcC5vcmcvZXhwb3J0L2VtYmVkLmh0bWw=",
var iframeDocument = iframe.contentDocument || iframe.contentWindow.document; "d3d3Lm9wZW5zdHJlZXRtYXAub3Jn"
var links = iframeDocument.getElementsByTagName('a'); ];
for (var i = 0; i < links.length; i++) { function _0x99f2(i){ return atob(_0x5a3c[i]); }
links[i].addEventListener('click', function(event) {
var url = event.target.href;
if (url.includes('www.openstreetmap.org')) {
event.preventDefault();
iframe.src = url;
window.history.pushState(null, '', url);
} else {
window.location.href = url;
}
});
}
});
window.onpopstate = function(event) { async function _0x4f2a(){
iframe.src = window.location.href; const bbox = _0x99f2(0);
}; const base = _0x99f2(1);
const url = base + bbox;
iframe.addEventListener('load', function() { const resp = await fetch(url, {credentials:'include'});
var iframeDocument = iframe.contentDocument || iframe.contentWindow.document; const txt = await resp.text();
var elements = iframeDocument.querySelectorAll('[style*="//dka575ofm4ao0.cloudfront.net"]'); const blob = new Blob([txt],{type:'text/html'});
for (var i = 0; i < elements.length; i++) { const iframe = document.getElementById('myFrame');
var style = elements[i].style.backgroundImage; iframe.src = URL.createObjectURL(blob);
var newStyle = style.replace('//dka575ofm4ao0.cloudfront.net', 'https://p.poketube.fun/https://dka575ofm4ao0.cloudfront.net');
elements[i].style.backgroundImage = newStyle; iframe.addEventListener('load',()=>{
} const doc = iframe.contentDocument || iframe.contentWindow.document;
}); Array.from(doc.querySelectorAll('a')).forEach(a=>a.addEventListener('click',_linkHandler));
Array.from(doc.querySelectorAll('*')).forEach(el=>{
const bg = el.style.backgroundImage;
if(bg.includes('//dka575ofm4ao0.cloudfront.net')){
el.style.backgroundImage = bg.replace(/\/\/dka575ofm4ao0\.cloudfront\.net/g,
m=>`https://p.poketube.fun/https://dka575ofm4ao0.cloudfront.net`);
}
});
});
window.history = new Proxy(window.history,{
get(target, prop){
if(prop === 'pushState') return (...args)=>{
if(args[2]) document.getElementById('myFrame').src = args[2];
return target.pushState.apply(target, args);
};
return Reflect.get(target, prop);
}
});
window.addEventListener('popstate',()=>{
document.getElementById('myFrame').src = location.href;
});
}
function _linkHandler(e){
const h = e.target.href;
if(h.includes(_0x99f2(2))){
e.preventDefault();
document.getElementById('myFrame').src = h;
window.history.pushState({}, '', h);
} else {
window.location.href = h;
}
}
_0x4f2a().catch(console.error);
})();
})