Configurability of Location Properties

Lists the configurability of Location properties using Object.getOwnPropertyDescriptor()

By
skeptic_fx 3 Seen 759 times
Tags
location document properties override
Run this test now.

Results


Tested on
Chrome - 62 - Windows 7
Property NameIs Configurable?Meta Data
window.location.replacefalsenull
window.location.assignfalsenull
window.location.hreffalsehttps://domstorm.skepticfx.com/testrunner
window.location.ancestorOriginsfalse[object Object]
window.location.originfalsehttps://domstorm.skepticfx.com
window.location.protocolfalsehttps:
window.location.hostfalsedomstorm.skepticfx.com
window.location.hostnamefalsedomstorm.skepticfx.com
window.location.portfalse
window.location.pathnamefalse/testrunner
window.location.searchfalse
window.location.hashfalse
window.location.reloadfalsenull
window.location.toStringfalsenull
window.location.valueOffalsenull

Tested on
Chrome Mobile - 41 - Android
Property NameIs Configurable?Meta Data
window.location.replacefalsenull
window.location.assignfalsenull
window.location.ancestorOriginstrue[object Object]
window.location.origintruehttps://domstorm.skepticfx.com
window.location.hashtrue
window.location.searchtrue
window.location.pathnametrue/testrunner
window.location.porttrue
window.location.hostnametruedomstorm.skepticfx.com
window.location.hosttruedomstorm.skepticfx.com
window.location.protocoltruehttps:
window.location.hreffalsehttps://domstorm.skepticfx.com/testrunner
window.location.reloadfalsenull
window.location.toStringfalsenull
window.location.valueOffalsenull

Tested on
Chrome Mobile iOS - 60 - iOS
Property NameIs Configurable?Meta Data
window.location.hreffalsehttp://domstorm.skepticfx.com/testrunner
window.location.protocolfalsehttp:
window.location.hostfalsedomstorm.skepticfx.com
window.location.hostnamefalsedomstorm.skepticfx.com
window.location.portfalse
window.location.pathnamefalse/testrunner
window.location.searchfalse
window.location.hashfalse
window.location.originfalsehttp://domstorm.skepticfx.com
window.location.ancestorOriginsfalse[object Object]
window.location.assignfalsenull
window.location.replacefalsenull
window.location.reloadfalsenull
window.location.toStringfalsenull

Tested on
Firefox - 54 - Windows 10
Property NameIs Configurable?Meta Data
window.location.hreffalsehttp://domstorm.skepticfx.com/testrunner
window.location.originfalsehttp://domstorm.skepticfx.com
window.location.protocolfalsehttp:
window.location.hostfalsedomstorm.skepticfx.com
window.location.hostnamefalsedomstorm.skepticfx.com
window.location.portfalse
window.location.pathnamefalse/testrunner
window.location.searchfalse
window.location.hashfalse
window.location.assignfalsenull
window.location.replacefalsenull
window.location.reloadfalsenull
window.location.toStringfalsenull
window.location.valueOffalsenull

Tested on
Unknown Browser - Unknown Version - Unknown OS
Property NameIs Configurable?Meta Data
window.location.replaceThe Property does not exist
window.location.assignThe Property does not exist
window.location.ancestorOriginsThe Property does not exist
window.location.originThe Property does not exist
window.location.hashThe Property does not exist
window.location.searchThe Property does not exist
window.location.pathnameThe Property does not exist
window.location.portThe Property does not exist
window.location.hostnameThe Property does not exist
window.location.hostThe Property does not exist
window.location.protocolThe Property does not exist
window.location.hrefThe Property does not exist
window.location.reloadThe Property does not exist
window.location.toStringThe Property does not exist
window.location.valueOfThe Property does not exist

Tested on
Googlebot - 2.1 - undefined
Property NameIs Configurable?Meta Data
window.location.replacefalsenull
window.location.assignfalsenull
window.location.ancestorOriginstrue[object Object]
window.location.origintruehttps://domstorm.skepticfx.com
window.location.hashtrue
window.location.searchtrue
window.location.pathnametrue/testrunner
window.location.porttrue
window.location.hostnametruedomstorm.skepticfx.com
window.location.hosttruedomstorm.skepticfx.com
window.location.protocoltruehttps:
window.location.hreffalsehttps://domstorm.skepticfx.com/testrunner
window.location.reloadfalsenull
window.location.toStringfalsenull
window.location.valueOffalsenull

Tested on
IE - 11 - Windows 7
Property NameIs Configurable?Meta Data
window.location.hostnameError Occured. Probably not configurable. No Meta Data
window.location.hashError Occured. Probably not configurable. No Meta Data
window.location.hostError Occured. Probably not configurable. No Meta Data
window.location.hrefError Occured. Probably not configurable. No Meta Data
window.location.pathnameError Occured. Probably not configurable. No Meta Data
window.location.portError Occured. Probably not configurable. No Meta Data
window.location.protocolError Occured. Probably not configurable. No Meta Data
window.location.searchError Occured. Probably not configurable. No Meta Data
window.location.assignError Occured. Probably not configurable. No Meta Data
window.location.reloadError Occured. Probably not configurable. No Meta Data
window.location.replaceError Occured. Probably not configurable. No Meta Data
window.location.toStringError Occured. Probably not configurable. No Meta Data

Tested on
Safari - 7 - Mac OS X
Property NameIs Configurable?Meta Data
window.location.replacefalsenull
window.location.assignfalsenull
window.location.ancestorOriginsfalse[object Object]
window.location.originfalsenull
window.location.hashfalse
window.location.searchfalse
window.location.pathnamefalseblank
window.location.portfalse
window.location.hostnamefalse
window.location.hostfalse
window.location.protocolfalseabout:
window.location.hreffalseabout:blank
window.location.reloadfalsenull
window.location.toStringfalsenull
window.location.valueOffalsenull

Tested on
Mobile Safari - 10 - iOS
Property NameIs Configurable?Meta Data
window.location.hreffalsehttp://domstorm.skepticfx.com/testrunner
window.location.protocolfalsehttp:
window.location.hostfalsedomstorm.skepticfx.com
window.location.hostnamefalsedomstorm.skepticfx.com
window.location.portfalse
window.location.pathnamefalse/testrunner
window.location.searchfalse
window.location.hashfalse
window.location.originfalsehttp://domstorm.skepticfx.com
window.location.ancestorOriginsfalse[object Object]
window.location.assignfalsenull
window.location.replacefalsenull
window.location.reloadfalsenull
window.location.toStringfalsenull

Tested on
Opera - 48 - Mac OS X
Property NameIs Configurable?Meta Data
window.location.replacefalsenull
window.location.assignfalsenull
window.location.hreffalsehttp://domstorm.skepticfx.com/testrunner
window.location.ancestorOriginsfalse[object Object]
window.location.originfalsehttp://domstorm.skepticfx.com
window.location.protocolfalsehttp:
window.location.hostfalsedomstorm.skepticfx.com
window.location.hostnamefalsedomstorm.skepticfx.com
window.location.portfalse
window.location.pathnamefalse/testrunner
window.location.searchfalse
window.location.hashfalse
window.location.reloadfalsenull
window.location.toStringfalsenull
window.location.valueOffalsenull

User Script (ENUM_FUNCTION)

					
function test(data){
	// We need to separate properties and access one by one.
try{
    console.log(data);
    var prop = Object.getOwnPropertyDescriptor(window.location, data);
    if(typeof prop != 'undefined'){
        if(prop.configurable === true){
            addError('window.location.'+ data, prop.configurable,  window.location[data]);
        } else {
            addSuccess('window.location.'+ data, prop.configurable,  window.location[data]);
        }    
    } else {
        addInfo('window.location.'+ data,  "The Property does not exist", '');
    }
}

catch(err){
	addInfo('window.location.'+ data,  'Error Occured. Probably not configurable.', ' No Meta Data');
}

}
					
				

Enum Data (ENUM_FUNCTION)

					
/*
var data = ["replace", "assign", "ancestorOrigins", "origin", "hash", "search", "pathname", 
"port", "hostname", "host", "protocol", "href", "reload", "toString", "valueOf"];
*/

var data = Object.getOwnPropertyNames(window.location);