Last active
August 29, 2015 14:04
-
-
Save activedecay/167688293ff88e60fa1b to your computer and use it in GitHub Desktop.
HP ILO steals window.opener
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!-- | |
| This is a bit of code from HP that proves they are crooks. | |
| They stole the window.opener by changing its location | |
| and then closed the window that it intended to launch. | |
| Why? | |
| --> | |
| <script language="JavaScript" type="text/javascript"> | |
| //--- create the new location string with | |
| //--- cpqlogin.php and the original query string | |
| newlocation = "/cpqlogin.htm" + myLocation; /* JAGaf86592 Renamed cpqlogin.php for cpqlogin.htm*/ | |
| // close when is out window (eg. help window) | |
| if (window.opener) { | |
| if (isNetscape) { | |
| try{ | |
| newlocation = "/cpqlogin.htm"; /* JAGaf86592 Renamed cpqlogin.php for cpqlogin.htm*/ | |
| window.opener.location.replace( newlocation ); | |
| window.opener.focus(); | |
| window.close(); | |
| } | |
| catch(e) { | |
| newlocation = ""; | |
| } | |
| } else { | |
| try { | |
| var strLocation = new String(window.opener.location); | |
| if (strLocation.indexOf("mxportal") == -1){ | |
| newlocation = "/cpqlogin.htm";/* JAGaf86592 Renamed cpqlogin.php for cpqlogin.htm*/ | |
| window.opener.location.replace( newlocation ); | |
| window.opener.focus(); | |
| window.close(); | |
| } | |
| } | |
| catch(e) { | |
| newlocation = ""; | |
| } | |
| } | |
| } | |
| if(FramesAreThere) { | |
| // we need to load the login page in the parent frame | |
| window.parent.location.href = newlocation; | |
| } | |
| </script> |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
if an intermediate page is launched with this javascript
window.opener = null;
then there is no way for the HP code to steal the window.