/*Спрятать подсказки*/ (function() { function onPS(e) { if ( e.target.lastChild && e.target.lastChild.nodeName == "image") return; if ( e.originalTarget.nodeName != "tooltip" || window.__attributesInspector) return; var node = e.originalTarget.ownerDocument.tooltipNode; for (; node && !(node instanceof HTMLAnchorElement); node = node.parentNode); !node && e.preventDefault(); } const observer = { observe: function(win) win.addEventListener("load", this, false), handleEvent: function(e) { var doc = e.target; var win = doc.defaultView; win.removeEventListener("load", this, false); if (doc.location.href == "chrome://browser/content/browser.xul" || win.cbttp) return; win.cbttp = true; win.addEventListener("popupshowing", onPS, true); win.addEventListener("unload", function onUL() { win.removeEventListener("unload", onUL, false); win.removeEventListener("popupshowing", onPS, true); }, false) } } addEventListener("popupshowing", onPS, true); Services.obs.addObserver(observer, "domwindowopened", false); addDestructor(function() Services.obs.removeObserver(observer, "domwindowopened")); })(); return;function winObs(aSubject, aTopic) { var windows = Cc["@mozilla.org/embedcomp/window-watcher;1"].getService(Ci.nsIWindowWatcher).getWindowEnumerator(); while( windows.hasMoreElements() ) { var win = windows.getNext(); LOG( win.name ) } }; Services.ww.registerNotification(winObs); addDestructor(function() { Services.ww.unregisterNotification(winObs) }); |