Michiel Borkent
Michiel Borkent

Reputation: 34850

Prevent site from showing content based on certain date

The site www.refdag.nl shows its content based on what day it is: on sunday they don't want their readers to read articles because of religious reasons. The Javascript which they use to accomplish this looks like this:

http://www.refdag.nl/js/common/sunday_block.js

So, changing the client's date is already a solution to work around this. Turning off all Javascript is also possible. But it would be nicer if I could just leave just the part of the script mentioned above out on the client.

What is a good solution for it? Blocking the above mentioned file does not work, because the site uses a single giant javascript file where files like these are appended to each other (http://www.refdag.nl/js/www.refdag.nl-bundle.js?rev=3994). Are there any plugins for Chrome in which you can rewrite javascript before it gets loaded or something?

Upvotes: 3

Views: 135

Answers (2)

mplungjan
mplungjan

Reputation: 178350

Not much to do other than disable script or read the page in an HTA or so. The script is inline and in an anonymous function so it is not possible to intercept the script unless you are able to rewrite the date function before the script is executed, like

javascript:void(Date=function() { return null })

or similar

I would personally use view-source:http://www.refdag.nl/ and paste it into an IDE after adding <base ref="http://www.refdag.nl/" /> and maybe my script or delete the script

Upvotes: 0

RobinJ
RobinJ

Reputation: 5263

This is not what AdBlock is made for, but I believe you should be able to tell it to block the script.

Upvotes: 1

Related Questions