views:

152

answers:

0

What happens when you add/remove the current site, while logged on, as a trusted site?

When users do this on our website, and then try to click on a link or close the browser, they get the following JavaScript exception:

"Microsoft JScript runtime error: 'type' is null or not an object"

in the below library code at the line "var etype = this.type = e.type.toLowerCase();"

Sys.UI.DomEvent = function Sys$UI$DomEvent(eventObject) {
/// <summary locid="M:J#Sys.UI.DomEvent.#ctor" />
/// <param name="eventObject"></param>
/// <field name="altKey" type="Boolean" locid="F:J#Sys.UI.DomEvent.altKey"></field>
/// <field name="button" type="Sys.UI.MouseButton" locid="F:J#Sys.UI.DomEvent.button"></field>
/// <field name="charCode" type="Number" integer="true" locid="F:J#Sys.UI.DomEvent.charCode"></field>
/// <field name="clientX" type="Number" integer="true" locid="F:J#Sys.UI.DomEvent.clientX"></field>
/// <field name="clientY" type="Number" integer="true" locid="F:J#Sys.UI.DomEvent.clientY"></field>
/// <field name="ctrlKey" type="Boolean" locid="F:J#Sys.UI.DomEvent.ctrlKey"></field>
/// <field name="keyCode" type="Number" integer="true" locid="F:J#Sys.UI.DomEvent.keyCode"></field>
/// <field name="offsetX" type="Number" integer="true" locid="F:J#Sys.UI.DomEvent.offsetX"></field>
/// <field name="offsetY" type="Number" integer="true" locid="F:J#Sys.UI.DomEvent.offsetY"></field>
/// <field name="screenX" type="Number" integer="true" locid="F:J#Sys.UI.DomEvent.screenX"></field>
/// <field name="screenY" type="Number" integer="true" locid="F:J#Sys.UI.DomEvent.screenY"></field>
/// <field name="shiftKey" type="Boolean" locid="F:J#Sys.UI.DomEvent.shiftKey"></field>
/// <field name="target" locid="F:J#Sys.UI.DomEvent.target"></field>
/// <field name="type" type="String" locid="F:J#Sys.UI.DomEvent.type"></field>
var e = Function._validateParams(arguments, [
    {name: "eventObject"}
]);
if (e) throw e;
var e = eventObject;
var etype = this.type = e.type.toLowerCase();
this.rawEvent = e;
this.altKey = e.altKey;
if (typeof(e.button) !== 'undefined') {
    this.button = (typeof(e.which) !== 'undefined') ? e.button :
        (e.button === 4) ? Sys.UI.MouseButton.middleButton :
        (e.button === 2) ? Sys.UI.MouseButton.rightButton :
        Sys.UI.MouseButton.leftButton;
}
if (etype === 'keypress') {
    this.charCode = e.charCode || e.keyCode;
}
else if (e.keyCode && (e.keyCode === 46)) {
    this.keyCode = 127;
}
else {
    this.keyCode = e.keyCode;
}
this.clientX = e.clientX;
this.clientY = e.clientY;
this.ctrlKey = e.ctrlKey;
this.target = e.target ? e.target : e.srcElement;
if (!etype.startsWith('key')) {
    if ((typeof(e.offsetX) !== 'undefined') && (typeof(e.offsetY) !== 'undefined')) {
        this.offsetX = e.offsetX;
        this.offsetY = e.offsetY;
    }
    else if (this.target && (this.target.nodeType !== 3) && (typeof(e.clientX) === 'number')) {
        var loc = Sys.UI.DomElement.getLocation(this.target);
        var w = Sys.UI.DomElement._getWindow(this.target);
        this.offsetX = (w.pageXOffset || 0) + e.clientX - loc.x;
        this.offsetY = (w.pageYOffset || 0) + e.clientY - loc.y;
    }
}
this.screenX = e.screenX;
this.screenY = e.screenY;
this.shiftKey = e.shiftKey;
}

Note: the site does not require trusted privileges to function correctly.