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; async function _0x4f2a(){
if (url.includes('www.openstreetmap.org')) { const bbox = _0x99f2(0);
event.preventDefault(); const base = _0x99f2(1);
iframe.src = url; const url = base + bbox;
window.history.pushState(null, '', url); const resp = await fetch(url, {credentials:'include'});
} else { const txt = await resp.text();
window.location.href = url; const blob = new Blob([txt],{type:'text/html'});
const iframe = document.getElementById('myFrame');
iframe.src = URL.createObjectURL(blob);
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.onpopstate = function(event) { window.history = new Proxy(window.history,{
iframe.src = window.location.href; 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);
iframe.addEventListener('load', function() {
var iframeDocument = iframe.contentDocument || iframe.contentWindow.document;
var elements = iframeDocument.querySelectorAll('[style*="//dka575ofm4ao0.cloudfront.net"]');
for (var i = 0; i < elements.length; i++) {
var style = elements[i].style.backgroundImage;
var newStyle = style.replace('//dka575ofm4ao0.cloudfront.net', 'https://p.poketube.fun/https://dka575ofm4ao0.cloudfront.net');
elements[i].style.backgroundImage = newStyle;
} }
}); });
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);
})();
})