commit 46b8b8a2857abd3e77a4c9a054ae931572fd918a Author: Taken Date: Mon May 26 00:01:52 2025 +0200 Initial commit diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..44ce34d --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +web-ext-artifacts diff --git a/icons/icon128.png b/icons/icon128.png new file mode 100755 index 0000000..4e2ceb7 Binary files /dev/null and b/icons/icon128.png differ diff --git a/icons/icon16.png b/icons/icon16.png new file mode 100755 index 0000000..a364419 Binary files /dev/null and b/icons/icon16.png differ diff --git a/icons/icon48.png b/icons/icon48.png new file mode 100755 index 0000000..f43276c Binary files /dev/null and b/icons/icon48.png differ diff --git a/manifest.json b/manifest.json new file mode 100644 index 0000000..61b94b0 --- /dev/null +++ b/manifest.json @@ -0,0 +1,26 @@ +{ + "manifest_version": 3, + "browser_specific_settings": { + "gecko": { + "id": "taken@mairimashita.org", + "strict_min_version": "58.0" + } + }, + "name": "PvPRp bypass", + "version": "1.0", + "description": "Removes the requirement to sub for pack download", + "action": { + "default_popup": "popout.html", + "default_icon": { + "16": "icons/icon16.png", + "48": "icons/icon48.png", + "128": "icons/icon128.png" + } + }, + "content_scripts": [ + { + "matches": ["https://pvprp.com/*"], + "js": ["pvprp.js"] + } + ] +} diff --git a/popout.html b/popout.html new file mode 100644 index 0000000..c15c8d7 --- /dev/null +++ b/popout.html @@ -0,0 +1,44 @@ + + + + + + + + +

PvPRp Bypass

+

This extension automatically clicks on the download button silently

+

No more annoying clicking

+ + + + diff --git a/pvprp.js b/pvprp.js new file mode 100644 index 0000000..554e9fa --- /dev/null +++ b/pvprp.js @@ -0,0 +1,49 @@ +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}`) +}