mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
49 lines
1.0 KiB
JavaScript
49 lines
1.0 KiB
JavaScript
|
(function(){
|
||
|
|
||
|
const Cc = Components.classes;
|
||
|
const Ci = Components.interfaces;
|
||
|
const Cu = Components.utils;
|
||
|
const Cr = Components.results;
|
||
|
|
||
|
// Get this in a way where we can load the page automatically
|
||
|
// where it doesn't need to be focused...
|
||
|
var homeWindow = Cc["@mozilla.org/embedcomp/window-watcher;1"]
|
||
|
.getService(Ci.nsIWindowWatcher)
|
||
|
.activeWindow;
|
||
|
|
||
|
var Utils = {
|
||
|
get activeWindow(){
|
||
|
var win = Cc["@mozilla.org/embedcomp/window-watcher;1"]
|
||
|
.getService(Ci.nsIWindowWatcher)
|
||
|
.activeWindow;
|
||
|
|
||
|
if( win != null ) return win;
|
||
|
else return homeWindow;
|
||
|
},
|
||
|
|
||
|
get activeTab(){
|
||
|
var tabBrowser = this.activeWindow.gBrowser;
|
||
|
return tabBrowser.selectedTab;
|
||
|
},
|
||
|
|
||
|
|
||
|
get homeTab(){
|
||
|
for( var i=0; i<Tabs.length; i++){
|
||
|
if(Tabs[i].contentWindow.location.host == "tabcandy"){
|
||
|
return Tabs[i];
|
||
|
}
|
||
|
}
|
||
|
|
||
|
return null;
|
||
|
},
|
||
|
|
||
|
get logger(){
|
||
|
return homeWindow.Firebug.Console
|
||
|
}
|
||
|
|
||
|
}
|
||
|
|
||
|
window.Utils = Utils;
|
||
|
|
||
|
})();
|