我们正在编写一些javascript来覆盖方法window.open和window.showModalDialog,referer将在标题中设置。
if (isIE) {
if (!window.__open) {
window.__open = window.open;
window.open = function (url, name, features) {
this.__ESSecurity.alert("my window.open");
var ww = window.__open("", name, features);
ww.location.href = url;
return ww;
};
}
if (!window.__showModalDialog) {
window.__showModalDialog = window.showModalDialog;
window.showModalDialog = function (url, obj, features) {
this.__ESSecurity.alert("my window.showModalDialog");
var Hfeatures = this.__ESSecurity.splitFeatures(features);
var features = 'left=' + Hfeatures['dialogLeft'] + ',top='+ Hfeatures['dialogTop'];
features+= ',width=' + Hfeatures['dialogWidth'] + ',height=' + Hfeatures['dialogHeight'];
features+= ',toolbar=no,menubar=no,status=no,resizable=yes,modal=yes';
var ww = window.open(url, "name", features);
return ww;
};
}
} 它在FF和IE9中工作正常,但仅在IE8中方法showModalDialog没有通过引用。
你知道可能缺少什么吗?