Files
pvprp-bypass/pvprp.js
2025-05-26 00:01:52 +02:00

50 lines
1.3 KiB
JavaScript

log("Loaded extension")
const downloadButton = document.querySelector('a.activ-download')
const originalHref = downloadButton.href;
const originalTarget = downloadButton.getAttribute('target');
const originalWindowOpen = window.open;
const originalAssign = window.location.assign;
const originalReplace = window.location.replace;
window.open = function() {
log('Intercepted window.open with:', arguments);
return { closed: false };
};
window.location.assign = function(url) {
log('Intercepted location.assign with:', url);
};
window.location.replace = function(url) {
log('Intercepted location.replace with:', url);
};
downloadButton.removeAttribute('target');
downloadButton.href = 'javascript:void(0)';
const clickHandler = downloadButton["click"];
if (typeof clickHandler === 'function') {
try {
clickHandler.call(downloadButton);
} catch (e) {
error('Error executing click handler:', e);
}
}
downloadButton.href = originalHref;
if (originalTarget) {
downloadButton.setAttribute('target', originalTarget);
}
window.open = originalWindowOpen;
window.location.assign = originalAssign;
window.location.replace = originalReplace;
function log(msg) {
console.log(`[PvPRp Bypass]: ${msg}`)
}
function error(msg) {
console.error(`[PvPRp Bypass]: ${msg}`)
}