this post was submitted on 02 Apr 2025
882 points (100.0% liked)

Technology

70285 readers
2782 users here now

This is a most excellent place for technology news and articles.


Our Rules


  1. Follow the lemmy.world rules.
  2. Only tech related news or articles.
  3. Be excellent to each other!
  4. Mod approved content bots can post up to 10 articles per day.
  5. Threads asking for personal tech support may be deleted.
  6. Politics threads may be removed.
  7. No memes allowed as posts, OK to post as comments.
  8. Only approved bots from the list below, this includes using AI responses and summaries. To ask if your bot can be added please contact a mod.
  9. Check for duplicates before posting, duplicates may be removed
  10. Accounts 7 days and younger will have their posts automatically removed.

Approved Bots


founded 2 years ago
MODERATORS
 

It garbles advertisers' data as a result, but you must disable uBlock Origin to run it; they can't work simultaneously. I recently moved to it and, so far, am never looking back!

you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 18 points 1 month ago (1 children)

Some ads have used browser exploits to infect visitors in the past. So this is a very, very bad idea, if it actually is implemented in a way that is hard to filter for ad networks.

[–] [email protected] 40 points 1 month ago (1 children)

So the way I understand this to work, it's 100% safe from the type of attack you're describing.

You are clicking the link (asking the advertiser for the data) but then never actually fetching it.

So you can never get the malicious payload to be infected.

[–] [email protected] 5 points 1 month ago (3 children)

Im too scared to trust it works out fine in the end to use it, been raised on the idea that interacting with an ad in any way other than task managering the pop up is dangerous. Wheres the part of the code that makes it safe and a write up of how it functions, otherwise im fine just blocking ads with regular ublock.

[–] [email protected] 17 points 1 month ago (1 children)

the part that's safe is in the browser. it's a basic fact of how http requests work that you can just request data and then not read it.

also, "task managering the popups"? unless i've missed some very weird development that has literally never worked, because popup windows are part of the parent process.

[–] [email protected] 4 points 1 month ago* (last edited 1 month ago) (1 children)

Back on Windows 95 through XP, each individual window was a process that could be killed in Task Manager, and popups opened in a new window.

[–] [email protected] 4 points 1 month ago (1 children)

really? sounds like a weird span of systems considering they share so little code. i'd like to read on how they did that.

[–] [email protected] 6 points 1 month ago (1 children)
[–] [email protected] 1 points 1 month ago

I was fairly young, but I do remember using Windows 95 or 98 with Netscape and there were popups that had to be killed through the task manager (or equivalent, it was 30 years ago, so I don't remember precisely).

[–] [email protected] 7 points 1 month ago

What makes you think uBlock is safe without checking relevant code sections?

[–] [email protected] 5 points 1 month ago* (last edited 1 month ago)

Here you go, from the repo:

  const visitAd = function (ad) {
    function timeoutError(xhr) {
      return onVisitError.call(xhr, {
        type: 'timeout'
      });
    }

    const url = ad && ad.targetUrl, now = markActivity();

    // tell menu/vault we have a new attempt
    broadcast({
      what: 'adAttempt',
      ad: ad
    });

    if (xhr) {

      if (xhr.delegate.attemptedTs) {

        const elapsed = (now - xhr.delegate.attemptedTs);

        // TODO: why does this happen... a redirect?
        warn('[TRYING] Attempt to reuse xhr from ' + elapsed + " ms ago");

        if (elapsed > visitTimeout)
          timeoutError();
      }
      else {

        warn('[TRYING] Attempt to reuse xhr with no attemptedTs!!', xhr);
      }
    }

    ad.attempts++;
    ad.attemptedTs = now;

    if (!validateTarget(ad)) return deleteAd(ad);

    return sendXhr(ad);
    // return openAdInNewTab(ad);
    // return popUnderAd(ad)
  };

  const sendXhr = function (ad) {

    // if we've parsed an obfuscated target, use it
    const target = ad.parsedTargetUrl || ad.targetUrl;

    log('[TRYING] ' + adinfo(ad), ad.targetUrl);

    xhr = new XMLHttpRequest();

    try {
      xhr.open('get', target, true);
      xhr.withCredentials = true;
      xhr.delegate = ad;
      xhr.timeout = visitTimeout;
      xhr.onload = onVisitResponse;
      xhr.onerror = onVisitError;
      xhr.ontimeout = onVisitError;
      xhr.responseType = ''; // 'document'?;
      xhr.send();
    } catch (e) {
      onVisitError.call(xhr, e);
    }
  }

  const onVisitResponse = function () {

    this.onload = this.onerror = this.ontimeout = null;

    markActivity();

    const ad = this.delegate;

    if (!ad) {

      return err('Request received without Ad: ' + this.responseURL);
    }

    if (!ad.id) {

      return warn("Visit response from deleted ad! ", ad);
    }

    ad.attemptedTs = 0; // reset as visit no longer in progress

    const status = this.status || 200, html = this.responseText;

    if (failAllVisits || status < 200 || status >= 300) {
      return onVisitError.call(this, {
        status: status,
        responseText: html
      });
    }

    try {

      if (!isFacebookExternal(this, ad)) {

        updateAdOnSuccess(this, ad, parseTitle(this));
      }

    } catch (e) {

      warn(e.message);
    }

    xhr = null; // end the visit
  };

That's pretty much it! Let me know if it doesn't make sense, I can annotate it