Please help me block this pesky javascript

  • 🐕 I am attempting to get the site runnning as fast as possible. If you are experiencing slow page load times, please report it.

Hentai-Semitism

My thoughts are with the prayers.
kiwifarms.net
Joined
Apr 16, 2025
I use Windows 10 and Firefox 138 with uBlock Origin. I use this site to download age restricted videos from Youtube. I paste a link into the box, wait a few seconds and a list of available variants appears. When I click one of the green "download" buttons, it activates a script that opens a new tab and loads another site. You can clearly see the script in page source view:

<script type='text/javascript' src='//promdamagecomplain.com/1c/75/5a/1c755ae288cf77acfe873bf08cfc2107.js'></script>

I want my browser to ignore the script completely - no pop-ups, no redirects, no uBlock warning, no nothing.

- completely disabling Javascript (I use Disable Javascript) breaks the site, so I think that's out of the question.
- I can't find any about:config entries that would solve this problem. I tried browser.link.open_newwindow and the like. No dice.
- same with uBlock. I tried:

||promdamagecomplain.com/1c/75/5a/1c755ae288cf77acfe873bf08cfc2107.js$script
y2matego.com##+js(noopFunc, open)
||promdamagecomplain.com^$script

- the domain promdamagecomplain.com is on the Easy List, which is one of uBlock's importable public filter lists. It prevents the page from loading, but it doesn't stop the pop-up, which is the bigger issue. It might conflict with other measures I tried, but at this point I'm rather confused already.
 
I just gave it a go, and this static filter blocks the popup:
Code:
||promdamagecomplain.com^$popup
It still opens a new tab, but immediately closes it. I tried adding ||promdamagecomplain.com^ to block everything but that didn't seem to affect the popup. Presumably I don't understand the filter syntax fully.
 
This ViolentMonkey userscript intercepts the offending script (app.js) and removes calls to the function that opens the popup (handleAdRedirect()).

JavaScript:
// ==UserScript==
// @name        y2matego.com prevent ad redirect
// @namespace   Violentmonkey Scripts
// @match       https://www.y2matego.com/*
// @version     1.0
// @description 22/06/2025, 12:46:40
// @grant       GM_xmlhttpRequest
// @run-at      document-start
// ==/UserScript==

// Script-patching logic from:
// https://stackoverflow.com/questions/22141205/

/// Patch the app.js script text to remove handleAdRequest();
function addScript(text) {
    console.log('Patching script');
    text = text.replace(/handleAdRedirect\(\);/g, "");
    var newScript = document.createElement('script');
    newScript.type = "text/javascript";
    newScript.textContent = text;
    var head = document.getElementsByTagName('head')[0];
    head.appendChild(newScript);
}

/// Intercept the app.js script.
window.addEventListener('beforescriptexecute', function(e) {
    src = e.target.src;
    if (src.search(/app\.js/) != -1) {
        e.preventDefault();
        e.stopPropagation();
        GM_xmlhttpRequest({
            method: "GET",
            url: e.target.src,
            onload: function(response) {
                addScript(response.responseText);
            }
        });
    }
});

Edit: This only works in Firefox because of beforescriptexecute. The more recent answer on the mentioned Stack Overflow answer uses MutationObserver, but with that method I can't seem to stop the original script from executing (and adding the event listener that opens the popup). I'll have a think.
 
Last edited:
This ViolentMonkey userscript intercepts the offending script (app.js) and removes calls to the function that opens the popup (handleAdRedirect()).

JavaScript:
// ==UserScript==
// @name        y2matego.com prevent ad redirect
// @namespace   Violentmonkey Scripts
// @match       https://www.y2matego.com/*
// @version     1.0
// @description 22/06/2025, 12:46:40
// @grant       GM_xmlhttpRequest
// @run-at      document-start
// ==/UserScript==

// Script-patching logic from:
// https://stackoverflow.com/questions/22141205/

/// Patch the app.js script text to remove handleAdRequest();
function addScript(text) {
    console.log('Patching script');
    text = text.replace(/handleAdRedirect\(\);/g, "");
    var newScript = document.createElement('script');
    newScript.type = "text/javascript";
    newScript.textContent = text;
    var head = document.getElementsByTagName('head')[0];
    head.appendChild(newScript);
}

/// Intercept the app.js script.
window.addEventListener('beforescriptexecute', function(e) {
    src = e.target.src;
    if (src.search(/app\.js/) != -1) {
        e.preventDefault();
        e.stopPropagation();
        GM_xmlhttpRequest({
            method: "GET",
            url: e.target.src,
            onload: function(response) {
                addScript(response.responseText);
            }
        });
    }
});

Edit: This only works in Firefox because of beforescriptexecute. The more recent answer on the mentioned Stack Overflow answer uses MutationObserver, but with that method I can't seem to stop the original script from executing (and adding the event listener that opens the popup). I'll have a think.

Thanks for your replies. I'll give those solutions a shot and report back.
 
I tried the script and unfortunately it makes the site unusable. When I paste a Youtube URL into the box, nothing happens. Normally when you do that, the site automatically processes it, launches the Cloudflare checker and provides you with download links. Does it work on your end? My FF has lots of tweaks, maybe the script is in conflict with something.
 
You could try routing the offending domain to localhost.

in a cmd window edit your hosts file

notepad \Windows\System32\Drivers\etc\hosts
and add the following entry

127.0.0.1 www.promdamagecomplain.com promdamagecomplain.com

save and close

You may still get a popup from uBlock though.
 
Like I said, the popup is the main problem. Would it be possible to somehow download the script (I don't know how) and see what exactly it does?
Alright then route the domain to localhost in your host file and whitelist it in uBlock by adding the domain to trusted sites.

Then the script should not run and there should be no more pop-up.
 
Can't you use YT-DLP and skip the third party service?
No. I don't have a Youtube account and it's impossible to watch age restricted videos without one. The only two sites I know that can bypass this are y2matego.com and 9xbuddy.com

By the way, I present this problem as more of a challenge than a need. I want to know how to deal with annoying ads and redirects like that. I think some people might find this stimulating.
 
Looking at this thread, it's proof that JavaScript is one of the worst programming languages in existence. Fuck you Brendan Eich.
javascript itself is not the worst thing on the planet, the real stupid shit is how browsers are designed to run it instantly and not have a very annoying prompt on every js load
now the web is full of retarded javascript programs like google anal rape and whatever the fuck this one is
 
  • Like
Reactions: YoRHa No. 2 Type B
javascript itself is not the worst thing on the planet, the real stupid shit is how browsers are designed to run it instantly and not have a very annoying prompt on every js load
now the web is full of retarded javascript programs like google anal rape and whatever the fuck this one is
Also EVERY goddamn site has JS popups for newsletter and "discount" announcements. They are the most annoying thing after Captcha and Cloudflare turnstile. In many cases they can't reliably be uBlocked because they have random character strings. I spent most of my life in front of the monitor and I keep running into new annoyances I can barely deal with.
 
I tried the script and unfortunately it makes the site unusable. When I paste a Youtube URL into the box, nothing happens. Normally when you do that, the site automatically processes it, launches the Cloudflare checker and provides you with download links. Does it work on your end? My FF has lots of tweaks, maybe the script is in conflict with something.
Yeah it worked fine for me. All it does is patch out the call to handleAdRedirect().
Like I said, the popup is the main problem. Would it be possible to somehow download the script (I don't know how) and see what exactly it does?
The script you're on about (with the long name mentioned in the OP) is not what opens the pop-up, it's opened as part of the function that kicks off the video variant lookup. You can't block the script that opens the popup because it would break the site.

In https://www.y2matego.com/js/app.js?v=0.0.3 there is this function:
JavaScript:
const handleAdRedirect = () => {
    window.open('https://promdamagecomplain.com/ciqbjbjw?key=21f498dc57bc3f896b0d222a070a9380', '_blank');
};
Which gets called by click event handlers attached to the orange "download now" button (look for startButton.addEventListener) and the element that contains the green "download" buttons (look for videoResultContainer.addEventListener).

Probably I'd recommend just using the ublock filter:
Code:
||promdamagecomplain.com^$popup
This will open up another tab and then ublock will immediately close it. It's annoying but shouldn't require you to manually do anything each time.

Edit: Ublock static filter syntax for reference.

Edit, again: The flashes of grey at about 4 seconds and 15 seconds are the popup opening and being closed by ublock. It's annoying but not significant, and I have a slow computer.
 
Last edited:
Back