Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

40 lines (36 sloc) 0.915 kb
title layout author authorurl
Hating the back button, and exception abuse
post
Daniel15

Saw these snippets on the site of a company that provides "industry leading solutions". Firstly a snippet that was in the <head> of every page, intentionally breaking the back button:

{% highlight javascript %}

{% endhighlight %}

And there was also this function which abuses exceptions for control flow (I'm not too sure why):

{% highlight javascript %} function crossFrameScripting() { // TT#157678 - Prevent Frame usage. (esamson) //if (AgentUtils.isIE) //{ try {
if(self.document.domain.toString() != top.document.domain.toString()) { throw "Access is denied"; } } catch(exc) { if (top != self) { top.location=self.location; } } //} // /TT#157678 - Prevent Frame usage. (esamson) } {% endhighlight %}

Jump to Line
Something went wrong with that request. Please try again.