Changeset 701
- Timestamp:
- 03/28/08 08:11:42 (8 months ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/manage-ui2/src/chrome/chromeFiles/content/browser.js
r694 r701 541 541 542 542 GM_BrowserUI.newUserScript = function() { 543 var windowWatcher = Components 544 .classes["@mozilla.org/embedcomp/window-watcher;1"] 545 .getService(Components.interfaces.nsIWindowWatcher); 546 windowWatcher.openWindow( 547 window, "chrome://greasemonkey/content/newscript.xul", null, 548 "chrome,dependent,centerscreen,resizable,dialog", null 549 ); 543 GM_openNewUserScriptDialog(window); 550 544 }; 551 545 … … 653 647 654 648 GM_BrowserUI.manageMenuItemClicked = function() { 655 GM_openUserScriptManager( );649 GM_openUserScriptManager(window); 656 650 }; 657 651 branches/manage-ui2/src/chrome/chromeFiles/content/newscript.js
r692 r701 11 11 12 12 // default the includes with the current page's url 13 document.getElementById("includes").value = 14 window.opener.document.getElementById("content").selectedBrowser 15 .contentWindow.location.href; 13 var win = Components.classes["@mozilla.org/appshell/window-mediator;1"] 14 .getService(Components.interfaces.nsIWindowMediator) 15 .getMostRecentWindow("navigator:browser"); 16 if (win) { 17 document.getElementById("includes").value = win.content.location.href; 18 } 16 19 }, false); 17 20 branches/manage-ui2/src/chrome/chromeFiles/content/utils.js
r694 r701 77 77 } 78 78 79 function GM_openUserScriptManager( ) {79 function GM_openUserScriptManager(parentWindow) { 80 80 var win = Components.classes["@mozilla.org/appshell/window-mediator;1"] 81 81 .getService(Components.interfaces.nsIWindowMediator) … … 84 84 win.focus(); 85 85 } else { 86 var parentWindow = (!window.opener || window.opener.closed) ? 87 window : window.opener; 88 parentWindow.openDialog("chrome://greasemonkey/content/manage.xul", 89 "_blank", "resizable,dialog=no,centerscreen"); 90 } 86 parentWindow.openDialog("chrome://greasemonkey/content/manage.xul", "", 87 "chrome,resizable,dialog=no,centerscreen"); 88 } 89 } 90 91 function GM_openNewUserScriptDialog(parentWindow) { 92 parentWindow.openDialog("chrome://greasemonkey/content/newscript.xul", "", 93 "chrome,dependent,centerscreen,resizable,dialog"); 91 94 } 92 95
