mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-26 18:31:29 +00:00
+ this marks the checkin where Ian has switched to Minefield and is no longer paying attention to 3.6
+ the TabCandy button/hot key now works to make a separate TabCandy for each window + Fixed a number of startup issues relating to multiple tab candies running at the same time
This commit is contained in:
parent
f5531902a9
commit
41dd7db5ec
@ -328,16 +328,8 @@ window.TabsManager = $.extend(new Subscribable(), {
|
||||
// Sets up the TabsManager and window.Tabs
|
||||
init: function() {
|
||||
var self = this;
|
||||
/*
|
||||
var wm = Cc["@mozilla.org/appshell/window-mediator;1"]
|
||||
.getService(Ci.nsIWindowMediator);
|
||||
var chromeWindow = wm.getMostRecentWindow("navigator:browser");
|
||||
*/
|
||||
var chromeWindow = Utils.activeWindow;
|
||||
if(!chromeWindow.getBrowser || !chromeWindow.getBrowser())
|
||||
chromeWindow = null;
|
||||
|
||||
if(!chromeWindow) {
|
||||
var chromeWindow = Utils.getCurrentWindow();
|
||||
if(!chromeWindow || !chromeWindow.getBrowser || !chromeWindow.getBrowser()) {
|
||||
setTimeout(function() {
|
||||
self.init();
|
||||
}, 100);
|
||||
|
@ -358,7 +358,31 @@ var Utils = {
|
||||
|
||||
return null;
|
||||
},
|
||||
|
||||
// ----------
|
||||
// Function: getCurrentWindow
|
||||
// Returns the nsIDOMWindowInternal for the currently active window,
|
||||
// i.e. the window belonging to the active page's DOM "window" object.
|
||||
getCurrentWindow: function() {
|
||||
var wm = Cc["@mozilla.org/appshell/window-mediator;1"]
|
||||
.getService(Ci.nsIWindowMediator);
|
||||
var browserEnumerator = wm.getEnumerator("navigator:browser");
|
||||
while (browserEnumerator.hasMoreElements()) {
|
||||
var browserWin = browserEnumerator.getNext();
|
||||
var tabbrowser = browserWin.gBrowser;
|
||||
|
||||
// Check each tab of this browser instance
|
||||
var numTabs = tabbrowser.browsers.length;
|
||||
for (var index = 0; index < numTabs; index++) {
|
||||
var currentBrowser = tabbrowser.getBrowserAtIndex(index);
|
||||
if(currentBrowser.contentWindow == window)
|
||||
return browserWin;
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
},
|
||||
|
||||
// ___ Files
|
||||
getInstallDirectory: function(id, callback) {
|
||||
if (Cc["@mozilla.org/extensions/manager;1"]) {
|
||||
@ -443,6 +467,7 @@ var Utils = {
|
||||
|
||||
log: function() { // pass as many arguments as you want, it'll print them all
|
||||
var text = this.expandArgumentsForLog(arguments);
|
||||
/* $('body').prepend(text + '<br>'); */
|
||||
consoleService.logStringMessage(text);
|
||||
},
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user