Translation update done using Pootle.
[phpmyadmin.git] / js / cross_framing_protection.js
blobe69d162b3c7485e5a464d6eace307eca09d1b8b4
1 /* vim: set expandtab sw=4 ts=4 sts=4: */
2 /**
3  * Conditionally called from libraries/header_scripts.inc.php
4  * if third-party framing is not allowed
5  *
6  */
8 try {
9     // can't access this if on a different domain
10     var topdomain = top.document.domain;
11     // double-check just for sure
12     if (topdomain != self.document.domain) {
13         alert("Redirecting...");
14         top.location.replace(self.document.URL.substring(0, self.document.URL.lastIndexOf("/")+1));
15     }
17 catch(e) {
18     alert("Redirecting... (error: " + e);
19     top.location.replace(self.document.URL.substring(0, self.document.URL.lastIndexOf("/")+1));