make PLAYER checks more strict - a simple 'defined' wasn't working

This commit is contained in:
Jon Atkins
2015-10-11 15:46:00 +01:00
parent 2f781dab81
commit ccb4fea5aa

View File

@ -31,7 +31,7 @@ document.body.onload = function() {};
//originally code here parsed the <Script> tags from the page to find the one that defined the PLAYER object
//however, that's already been executed, so we can just access PLAYER - no messing around needed!
if (!window.PLAYER) {
if (typeof(window.PLAYER)!="object" || typeof(window.PLAYER.nickname) != "string") {
// page doesnt have a script tag with player information.
if(document.getElementById('header_email')) {
// however, we are logged in.