tag:old-support.getadblock.com,2013-08-06:/discussions/suggestions/73-use-a-broader-array-of-null-content-types-for-redirection-of-blocked-urlsAdBlock: Discussion 2018-10-19T09:04:55Ztag:old-support.getadblock.com,2013-08-06:Comment/287318762013-09-11T00:06:27Z2013-09-11T01:04:22ZUse a broader array of null content types for redirection of blocked URLs<div><p>Here are two short relevant diffs for my experimental swap-out
build...</p>
<p>for filtering/filteroptions.js<br>
22c22</p>
<h2><a href="#-lt-elementtypes-defaulttypes-1023-" class="anchor"
name="-lt-elementtypes-defaulttypes-1023-"></a><
ElementTypes.DEFAULTTYPES = 1023;</h2>
<blockquote>
<p>ElementTypes.DEFAULTTYPES = 2047;//now blocking main
document</p>
</blockquote>
<p>for pages/resourceblock.html<br>
73c73</p>
<h2><a href="#-lt-background-image-url-img-delete-gif-" class=
"anchor" name="-lt-background-image-url-img-delete-gif-"></a><
background-image: url(../img/delete.gif);</h2>
<blockquote>
<pre>
<code> background-image: url(../img/delete.png);</code>
</pre></blockquote>
<p>The one for background.js will need to be attached.</p></div>James Edward Lewis IItag:old-support.getadblock.com,2013-08-06:Comment/287318762013-09-11T01:07:25Z2013-09-11T02:20:26ZUse a broader array of null content types for redirection of blocked URLs<div><p>Below I have attached the other relevant diff, along with the
two diffs posted above, optimized images from the bundled jquery
build, and the optimized delete.png file.</p></div>James Edward Lewis IItag:old-support.getadblock.com,2013-08-06:Comment/287318762013-09-15T17:31:00Z2013-09-15T17:31:00ZUse a broader array of null content types for redirection of blocked URLs<div><p>Hi James Edward Lewis II,</p>
<p>After testing on my computer some ads goes through and weren't
blocked by AdBlock when I used your patches. Could you test it if
all ads are blocked?</p>
<p>Tomáš</p></div>Tomáštag:old-support.getadblock.com,2013-08-06:Comment/287318762013-09-15T23:16:20Z2013-09-15T23:16:20ZUse a broader array of null content types for redirection of blocked URLs<div><p>What filter-lists do you use, and what URLs did you try? I will
try to compare stable AdBlock with this build using some set of
URLs too.</p></div>James Edward Lewis IItag:old-support.getadblock.com,2013-08-06:Comment/287318762013-09-16T01:08:50Z2013-09-16T04:14:12ZUse a broader array of null content types for redirection of blocked URLs<div><p>Okay, I just tested it with krebsonsecurity.com and found that
when my ABP custom build is enabled, even if disabled on "this
domain," neither swap-out build even hides ads, and when I tried
just the AdBlock custom build, it hid a couple ads but failed to
block the trackers, while AdBlock stable blocked both trackers.</p>
<p>I didn't notice this before because my own content-blocking
setup is so multi-layered, and I went through the trouble of
peeling off all the layers to isolate the effect of AdBlock.</p>
<p>I even made a variant that didn't try out that fancy
regex-matching, and I can't seem to get anything to redirect to a
blank application/octet-stream data URI.</p>
<p>I just noticed that the "block resource" page doesn't mention
any filter as being matched; maybe there's a problem if I try to
pack this extension with any key other than Gundlach's (and maybe
that's why there is no experimental build of AdBlock to begin
with).</p></div>James Edward Lewis IItag:old-support.getadblock.com,2013-08-06:Comment/287318762013-09-16T04:44:02Z2013-09-16T04:44:02ZUse a broader array of null content types for redirection of blocked URLs<div><p>Well I'll try more null-content redirection when or if this
extension moves to declarativeWebRequest, but for now, while
neither of my custom builds seems to work, I'm switching to
AdBlock, which unlike ABP still uses at least <em>some</em>
null-content redirection.</p></div>James Edward Lewis IItag:old-support.getadblock.com,2013-08-06:Comment/287318762013-09-26T03:39:51Z2013-09-26T04:29:33ZUse a broader array of null content types for redirection of blocked URLs<div><p>Okay, I just tried again now that I saw both AdBlock Stable and
ABP Dev updated, and I'm testing the background-page with some
breakpoints and it looks like nothing ever gets considered
"blocked" (that is, the problem shows up before the place where I
made my changes); I'm not sure the problem is with my array of
null-content redirections, but maybe there's something about the
code that makes it fail to work unless I pack the extension with
the same private key as Gundlach & Co.</p>
<p>I'm still investigating why _myfilters.blocking.matches(), as
used in Line 243 of background.js, always seems to return "false"
in my experimental build but not in the official one, even though I
didn't change any of the code that parses filters and determines
whether a URL should be blocked and I use the same set of
subscriptions and custom filters.</p>
<p><strong>EDIT</strong>: I'm not sure why, but when I just
installed my custom build as an unpacked extension, it worked
beautifully; I can't say the same for ABP, where I couldn't even
get webrequest.js to load.</p></div>James Edward Lewis IItag:old-support.getadblock.com,2013-08-06:Comment/287318762013-09-26T04:40:33Z2013-09-26T04:40:33ZUse a broader array of null content types for redirection of blocked URLs<div><p>As I said above, if you install my unofficial build of AdBlock,
it doesn't block anything, but it seems if you unpack the CRX file
and "Load unpacked extension" it works like my unofficial builds of
ABP did when I first made them (but my unofficial builds of ABP
have a more serious problem and do not work even when loaded
unpacked); to help you test this out, I have attached a ZIP file of
my latest unofficial build of AdBlock, based on the latest Stable
build (2.6.8).</p>
<p>I should mention, while looking at the documentation for the
still-experimental declarativeWebRequest, I was glad to see
built-in methods for redirecting to transparent images or blank
pages, the very two things that AdBlock Stable already does by
means of returning a redirectUrl; it's nice to know that even the
Blink developers see the utility of returning null content instead
of just cancelling the request.</p></div>James Edward Lewis IItag:old-support.getadblock.com,2013-08-06:Comment/287318762013-09-28T17:28:56Z2013-09-28T17:28:56ZUse a broader array of null content types for redirection of blocked URLs<div><p>I will try this :)</p></div>Tomáštag:old-support.getadblock.com,2013-08-06:Comment/287318762013-09-28T17:54:51Z2013-09-28T17:54:51ZUse a broader array of null content types for redirection of blocked URLs<div><p>So, I can confirm that it is working like charm :) I will
discuss this with Michael about implementing this into AdBlock.</p>
<p>Thanks,<br>
Tomáš</p></div>Tomáštag:old-support.getadblock.com,2013-08-06:Comment/287318762013-10-02T12:41:20Z2013-10-02T12:41:20ZUse a broader array of null content types for redirection of blocked URLs<div><p>What is the value in using null objects instead of blocking
requests? What does it make AdBlock do better or differently? Just
a question :)</p></div>Tomáštag:old-support.getadblock.com,2013-08-06:Comment/287318762013-10-04T05:15:42Z2013-10-04T05:15:42ZUse a broader array of null content types for redirection of blocked URLs<div><p>It may be different now (I think now you get something like
"This webpage was blocked by an extension"), but my thoughts for an
expanded set of null-content redirections were formed almost 2
years ago: <a href=
"https://adblockplus.org/forum/viewtopic.php?p=56457#p56457">https://adblockplus.org/forum/viewtopic.php?p=56457#p56457</a></p>
<blockquote>
<p>Back when WebRequest was being tested, users noticed some garish
error pages whenever content was blocked outright, so ways were
found to substitute in such things as 1x1-pixel transparent .pngs,
blank HTML pages, and the like so Chrome would have at least
<em>something</em> to render...and I imagine (with more work) that
a minimal MP4/FLV/WebM/MPEG video could be swapped in, but it would
require much more sophisticated logic to ensure it doesn't break
the plugin content.</p>
</blockquote>
<p>The idea that I had was that some websites and pieces of plugin
content would assume an ad-blocker was running if a certain URL
failed to load, but if at least <em>something</em> were returned,
preferably something with the same content-type as was requested,
some anti-adblock checks would be thwarted; I was hoping to make
some video-players, like 4OD and Hulu, load some minimal "null MP4"
or something so they'll think they're showing you an ad, rather
than displaying the message "Sorry, we were unable to load a
message from our sponsors" or something similar.</p>
<p>As for the prevention of "garish error pages," that has mostly
been done by redirecting blocked frames to about:blank and blocked
images to a 1x1 transparent PNG.</p></div>James Edward Lewis IItag:old-support.getadblock.com,2013-08-06:Comment/287318762013-10-07T15:36:37Z2013-10-07T15:36:37ZUse a broader array of null content types for redirection of blocked URLs<div><p>James,</p>
<p>Thanks for being interested in improving AdBlock.</p>
<p>If your change could in fact stop a site from blocking AdBlock,
I would be<br>
happy to incorporate it. I expect, however, that once a site has
invested<br>
enough in their ant-AdBlock solution to be checking for blocked
content,<br>
they'd be happy to respond to this change by instead checking the
content<br>
itself. (Hulu in fact already does this -- in my tests some months
back,<br>
any replacement video under a few seconds long didn't fool
Hulu.)<br>
Basically, if they've started the arms race, then this would be an
incremental change to AdBlock that they could incrementally respond
to, so<br>
it's not worth implementing. Any arms race changes worth making on
our end<br>
should make things truly difficult for the websites who want to
detect<br>
AdBlock.</p>
<p>Let me know if you think I'm mistaken.<br>
Michael</p></div>AdBlocktag:old-support.getadblock.com,2013-08-06:Comment/287318762013-10-08T11:41:37Z2013-10-08T11:41:37ZUse a broader array of null content types for redirection of blocked URLs<div><blockquote>
<p>(Hulu in fact already does this -- in my tests some months back,
any replacement video under a few seconds long didn't fool
Hulu.)</p>
</blockquote>
<p>I just got both of my experimental builds working (first ABP by
fixing an unbalanced brace, then AdBlock...not sure why port.js was
giving me "Port error: Could not establish connection. Receiving
end does not exist"), and the first thing I tried to do was fool
Hulu and I saw it wasn't working with my minimal MP4 file; I
suspect a several-second-long MP4 file would be so large that
AdBlock would no longer have a reasonable size.</p>
<p>I've noticed that AdMuncher actually does handle Hulu well,
cutting the countdown to 3 seconds, but it probably does something
that a browser extension cannot do well.</p>
<p>I wonder, however, whether the ability for the Hulu player to
readily detect that the ad-content is too small relies on the fact
that it's plugin content, while there might still be some benefit
to redirecting a blocked Javascript URL to
<code>data:text/javascript,</code> or a blocked XML URL to
<code>data:application/xml,</code> instead of just blocking the
requests, like it might be easy for a page to figure out that a
file didn't load but not so easy to tell that it's not long
enough.</p>
<p>As I may have said before, at least you've picked the
low-hanging fruit of <em>aesthetically pleasing</em> redirections:
images to a 1x1 blank PNG, and frames to about:blank. I ought to
test out whether it's worth it, from an aesthetic standpoint, to
replace blocked SWF files with a minimal SWF, or a blocked HTML5
video with a minimal MP4 or WebM, even if it makes no difference to
anti-adblock efforts.</p>
<p>On a slightly related note, do you have any plans to make some
sort of experimental build using the declarativeWebRequest API, as
ABP did with WebRequest a couple years ago?<br>
I've been thinking about trying to do this myself, but I'm not so
confident in my ability to do so; I've never even developed an
extension from scratch.</p>
<p>Thank you for your consideration.<br>
James</p></div>James Edward Lewis IItag:old-support.getadblock.com,2013-08-06:Comment/287318762013-11-15T16:18:45Z2013-11-15T16:18:45ZUse a broader array of null content types for redirection of blocked URLs<div><p>Just as an FYI to everyone watching this discussion, as of
January this experimental build, which I am still maintaining, will
not be able to be installed on Stable or Beta versions of Chrome,
because it is outside the Chrome Web Store: <a href=
"https://groups.google.com/a/chromium.org/d/msg/chromium-extensions/z6MOzMKfXXg/Wpkq_U63oPMJ">
https://groups.google.com/a/chromium.org/d/msg/chromium-extensions/...</a></p>
<p>This is the relevant announcement: <a href=
"http://blog.chromium.org/2013/11/protecting-windows-users-from-malicious.html">
http://blog.chromium.org/2013/11/protecting-windows-users-from-mali...</a></p>
<p>I might try to turn this into a full-fledged fork and host it on
the Web Store, but honestly Gundlach already covered most of the
good cases and I'm not sure it's even worth the $5 fee to keep this
effort going.</p></div>James Edward Lewis II