1 dump('entering main/window.js\n');
3 if (typeof main == 'undefined') main = {};
4 main.window = function (mw,G) {
5 this.main_window = mw; this.mw = mw; this.G = G;
9 main.window.prototype = {
11 // pointer to the auth window
14 // list of open window references, used for debugging in shell
17 // list of Top Level menu interface window references
20 // list of documents for debugging. BROKEN
23 // Windows need unique names. This number helps.
24 'window_name_increment' : 0,
26 // This number gets put into the title bar for Top Level menu interface windows
27 'appshell_name_increment' : 0,
29 // From: Bryan White on netscape.public.mozilla.xpfe, Oct 13, 2004
30 // Message-ID: <ckjh7a$18q1@ripley.netscape.com>
31 // Modified by Jason for Evergreen
32 'SafeWindowOpen' : function (url,title,features) {
35 netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
36 const CI = Components.interfaces;
37 const PB = Components.classes["@mozilla.org/preferences-service;1"].getService(CI.nsIPrefBranch);
41 // pref 'dom.disable_open_during_load' is the main popup blocker preference
42 blocked = PB.getBoolPref("dom.disable_open_during_load");
43 if(blocked) PB.setBoolPref("dom.disable_open_during_load",false);
45 w = window.open(url,title,features);
47 this.G.error.sdump('D_ERROR','window.SafeWindowOpen: ' + E + '\n');
50 if(blocked) PB.setBoolPref("dom.disable_open_during_load",true);
55 'open' : function(url,title,features) {
56 this.G.error.sdump('D_WIN',
57 'opening ' + url + ', ' + title + ', ' + features + ' from ' + window + '\n');
58 var w = this.SafeWindowOpen(url,title,features);
59 w.mw = this.mw; w.G = this.G;
63 try { w.title = title; } catch(E) { dump('**'+E+'\n'); }
64 try { w.document.title = title; } catch(E) { dump('**'+E+'\n'); }
72 dump('exiting main/window.js\n');