8 Replies Latest reply on Jul 16, 2015 10:34 AM by nolsen311

    Block ads silently?



      I am currently blocking the category Web Ads.  However, on many pages the block page will appear several times along one side or another.  Is there a way to block a page or image silently where it would just not load the image or page?


      See the attached image for a screenshot of the problem currently.


      Thanks in advance,


        • 1. Re: Block ads silently?



          instead of a block action you could try to use something like Stop Cycle, but combine it with an event that removes the entire body. It will case the resulting page to be entirely white. The problem with this is that you will no longer see a block page if you access that specific URL directly.


          I would try something like IF the category is "Advertisment" AND there is a "Referer" header, THEN remove the body. This should work for embedded objects, but if you call a new URL from the location bar you should see the normal block page.




          • 2. Re: Block ads silently?



            Thanks for the quick response.


            I have added the rule as you suggested but am unclear what parameters to feed the Body.Remove event.  How do I have it remove the entire body?


            Also, is my rule identifying the 'referer' from the header like you suggested?






            • 3. Re: Block ads silently?

              Hi Jim,


              I played with this a little but it doesn´t seem that removing the body works. In my tests the website was still able to load the ads. I have now tried to use a blank error template, which seems to work a little better.


              You can try to create a blank template as well (requires a new schema). Create a new block setting and hit Add at the "Collection" Drop Down:


              Edit Settings_049.png

              Use "Blank" as the name and pick auto for the file name. Click Save&Edit:


              Add Template Collection_050.png

              In the Editor open "index.html" in the file view. Add a blank HTML skeleton and click "Save Template Changes":


              Template Editor_051.png

              Now you get back to the "Edit Settings" dialog. Click "Add" to add a template:


              Edit Settings_052.png

              Choose "Blank" as a name, "Fallback" as a language, check "HTML" and click Save&Edit:


              Add Template_053.png

              Just click "Save Tempalte Changes" without adding anything.


              Template Editor_054.png

              Settings should now look like this:


              Edit Settings_055.png

              Use this new setting with a rule in the URL Filter such as this:



              Note that for the referer header you should use "Header.Request.Exist" instead of "Header.Exist"!




              - Original Block Page:




              - New Blank Blockpage:



              If you see a "Error 403" something instead of the blank area, make sure you have correctly added the blank HTML consturct into the "index.html" as shown above.


              I hope this helps.




              • 4. Re: Block ads silently?

                I have to thank you for this post.  I've been dealing with users complaining about the block page for embedded ads.  I was going to embark on trying to do this exact thing this week. 

                • 5. Re: Block ads silently?



                  That did the trick!


                  Thanks for your detailed response.



                  • 6. Re: Block ads silently?

                    Is there any way to combine this with the HTML Opener (or something else) to actually remove the space the ad originally took up on the page?  Something similar to what the Ad-Block-Plus firefox add-on does, except done at the gateway level instead of the browser level?


                    The intent would be for the page to be formatted nicely in addition to blocking/removing the ads.




                    • 7. Re: Block ads silently?



                      theoretically yes.


                      For youtube you can use something like this:





                      This will remove the iframe which actually loads the ads and "reserves" the space on top of the page. This example is very specific to Youtube, since there is not really a "global" approach. You could try removing all iframes which have an id which contains "ad" or something similar, but there is a high risk for false positives.


                      Also I have seen many websites which do not directly include the iframes into the source, but add a javascript which renders the source code in the browser, so that MWG never sees an iframe tag, as it is added when the page is rendered in the browser. This is why MWG cannot filter advertisments as reliably as it could be done by AdBlock... AdBlock will always see the rendered page with all the images and iframes, we only see parts of javascript code, which are hard/impossible to filter without causing problems with the scripts execution.




                      • 8. Re: Block ads silently?

                        Couldn't you also, perhaps, add script to your block page that would remove parent objects using jQuery or Javascript? This approach might also allow you to resize the resulting object, even if you couldn't remove it from the DOM. I'd have to assume though that if you could resize the object, you should also be able to remove it.


                        I'm looking more for ways in which the various adblock lists can be imported into MWG. Anyone have any interesting ideas?