>Форум Mozilla Россия http://forum.mozilla-russia.org/index.php >Сustom Buttons http://forum.mozilla-russia.org/viewforum.php?id=34 >[CB]Undo Close Tabs http://forum.mozilla-russia.org/viewtopic.php?id=56267 |
Infocatcher > 04-09-2012 22:16:41 |
Undo Close Tabs 0.3.3.2 (2020-03-14) ЛКМ – отменить закрытие вкладки СКМ по любому из пунктов меню – восстановить окно/вкладку без скрытия меню Shift+ПКМ (а также ПКМ с любой другой клавишей-модификатором) – показать оригинальное меню кнопки Скриншот: Установить: Выделить код Код:custombutton://%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%0D%0A%3Ccustombutton%20xmlns%3Acb%3D%22http%3A//xsms.nm.ru/custombuttons/%22%3E%0A%20%20%3Cname%3EUndo%20Close%20Tab%3C/name%3E%0A%20%20%3Cimage%3E%3C%21%5BCDATA%5Bdata%3Aimage/png%3Bbase64%2CiVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAABZVBMVEX////w8PD09PTx8fHw8PCPkIvv7++LjIfw8PDu7u6ZmZXv7+/29vbw8PD///+Txdt8lJ2RkY2Sk4+bzeJcnLsbcp6LjIcwf6bg4N/m//+XyuDf7/+LvNGmr68ufqbg4N9OhaLm8PJvrstCjrPg4N9Rk7Q8hqfk8PRoqMc5h60vgKk9ia/f4N7w8PDi7/ZgpMOLtMny9fYmeaIqfaff4N6hpKLv7+/h8PVwqcTB1N3L3ebv7+9trMqLjIeOj4rf39719vbM7PaMt81hpMPL7fmbnJeoqaXr6+tin774+/vF2t+lq6qKlI+hop38/Pz7+/v5+fn9/f29vruLjIeqq6f7+/v5+fnGxsSLjId5rcfg8vw4ibN8ud3n8vgacZ2extrA5//4+/wacp4yha8ZcZ18wuyIxuthrNc5irdvt+KRzvO62ep+w+7N6PeY1/+U1v+h2/9am7sbcp4keaXm8/ovgq07jLe+yJo8AAAAWXRSTlMAES5KZr+CMJ7X7Lr4ZwHdD4f0yftxJtP6Cj4Q/EIe9HPg/tXy/kvL/fr++fGfuf3Bzv787+6DptCRyLvRDs/u+P3O+TSw5Or8ovXiHqKWW0aBpyVHNSZMDw1FfDAAAACvSURBVHhehchTcwRBAIXRXmewtG3btm0jtn9/elPZmpqnnKd7P0DgADK5glyUQpH4b0pYkJo730t1PADxBSiKhlVvT4v11myBgSHD8Vz+cP388rr7rGlg0CIIojccrx5v7u4fjDCYMAxLWm1f33bHcuWEwXUBuT3eS58/cBuEIcQ8iURj8cT7RwqkM1n6LzabXtgUS6BcqdLO6o1mC7Q7XepZrz8YgtGYQphMZ+BfP976HHRDoNUhAAAAAElFTkSuQmCC%5D%5D%3E%3C/image%3E%0A%20%20%3Cmode%3E0%3C/mode%3E%0A%20%20%3Cinitcode%3E%3C%21%5BCDATA%5B//%20http%3A//infocatcher.ucoz.net/js/cb/undoCloseTabs.js%0A//%20https%3A//forum.mozilla-russia.org/viewtopic.php%3Fid%3D56267%0A//%20https%3A//github.com/Infocatcher/Custom_Buttons/tree/master/Undo_Close_Tabs%0A%0A//%20Undo%20Close%20Tabs%20button%20for%20Custom%20Buttons%0A//%20%28code%20for%20%22initialization%22%20section%29%0A%0A//%20%28c%29%20Infocatcher%202009-2015%2C%202017-2020%0A//%20version%200.3.3.2%20-%202020-03-14%0A%0Avar%20options%20%3D%20%7B%0A%09menuTemplate%3A%20%5B%0A%09%09%22closedWindows%22%2C%0A%09%09%22separator%22%2C%0A%09%09%22restoreClosedWindows%22%2C%0A%09%09%22clearClosedWindows%22%2C%0A%09%09%22separator%22%2C%0A%09%09%22closedTabs%22%2C%0A%09%09%22separator%22%2C%0A%09%09%22restoreClosedTabs%22%2C%0A%09%09%22clearClosedTabs%22%2C%0A%09%09%22separator%22%2C%0A%09%09%22clearAll%22%2C%0A%09%09%22separator%22%2C%0A%09%09%22restoreLastSession%22%2C%0A%09%09%22separator%22%2C%0A%09%09%22buttonMenu%22%0A%09%5D%2C%0A%09showInTabContextMenu%3A%20false%2C%0A%09/*%0A%09menuTemplateTabContext%3A%20%5B%20//%20like%20menuTemplate%0A%09%09%22closedTabs%22%2C%0A%09%09%22separator%22%2C%0A%09%09%22restoreClosedTabs%22%2C%0A%09%09%22clearClosedTabs%22%0A%09%5D%2C%0A%09*/%0A%09windowItemTemplate%3A%20%22%28%25count%29%20%25title%22%2C%0A%09windowSelectedTabPrefix%3A%20%22*%22%2C%0A%09buttonTipTemplate%3A%20%5B%22header%22%2C%20%22title%22%2C%20%22url%22%2C%20%22closedAt%22%5D%2C%0A%09itemTipTemplate%3A%20%5B%22title%22%2C%20%22url%22%2C%20%22closedAt%22%5D%2C%0A%09hideRestoreAllForSingleEntry%3A%20false%2C%0A%09allowDeleteEntries%3A%20true%2C%0A%09accesskeys%3A%20%7B%20//%20Empty%20string%20%28%22%22%29%20to%20disable%20or%20string%20with%20possible%20values%20%28%220123...%22%2C%20%22abcd...%22%29%0A%09%09closedTabs%3A%20%22%22%2C%0A%09%09closedWindows%3A%20%22%22%0A%09%7D%2C%0A%09accesskeySeparator%3A%20%22%20%22%2C%20//%20%3Caccesskey%3E%3Cseparator%3E%3Clabel%3E%0A%09openMenuOnMouseover%3A%20false%2C%0A%09useMenu%3A%20false%2C%0A%09rightClickToUndoCloseTab%3A%20false%20//%20Useful%20with%20%22useMenu%3A%20true%22%0A%7D%3B%0A%0Afunction%20_localize%28sid%29%20%7B%0A%09var%20strings%20%3D%20%7B%0A%09%09en%3A%20%7B%0A%09%09%09restoreTab%3A%20%22Restore%20the%20most%20recently%20closed%20tab%22%2C%0A%0A%09%09%09restoreAllTabs%3A%20%22Restore%20all%20tabs%22%2C%0A%09%09%09restoreAllTabsAccesskey%3A%20%22t%22%2C%0A%09%09%09clearTabsHistory%3A%20%22Clear%20history%20of%20closed%20tabs%22%2C%0A%09%09%09clearTabsHistoryAccesskey%3A%20%22b%22%2C%0A%0A%09%09%09restoreAllWindows%3A%20%22Restore%20all%20windows%22%2C%0A%09%09%09restoreAllWindowsAccesskey%3A%20%22w%22%2C%0A%09%09%09clearWindowsHistory%3A%20%22Clear%20history%20of%20closed%20windows%22%2C%0A%09%09%09clearWindowsHistoryAccesskey%3A%20%22d%22%2C%0A%0A%09%09%09clearAllHistory%3A%20%22Clear%20all%20history%22%2C%0A%09%09%09clearAllHistoryAccesskey%3A%20%22C%22%2C%0A%0A%09%09%09restoreLastSession%3A%20%22Restore%20last%20session%22%2C%0A%09%09%09restoreLastSessionAccesskey%3A%20%22s%22%2C%0A%0A%09%09%09deleteUndoEntry%3A%20%22Delete%22%2C%0A%0A%09%09%09buttonMenu%3A%20%22Button%20menu%22%2C%0A%09%09%09buttonMenuAccesskey%3A%20%22m%22%2C%0A%0A%09%09%09tabContextMenu%3A%20%22Recently%20Closed%20Tabs%22%2C%0A%09%09%09tabContextMenuAccesskey%3A%20%22y%22%2C%0A%0A%09%09%09itemTip%3A%20%22%25ago%20ago%2C%20%25date%22%2C%0A%09%09%09day%3A%20%22d%22%0A%09%09%7D%2C%0A%09%09ru%3A%20%7B%0A%09%09%09restoreTab%3A%20%22%u0412%u043E%u0441%u0441%u0442%u0430%u043D%u043E%u0432%u0438%u0442%u044C%20%u043F%u043E%u0441%u043B%u0435%u0434%u043D%u044E%u044E%20%u0437%u0430%u043A%u0440%u044B%u0442%u0443%u044E%20%u0432%u043A%u043B%u0430%u0434%u043A%u0443%22%2C%0A%0A%09%09%09restoreAllTabs%3A%20%22%u0412%u043E%u0441%u0441%u0442%u0430%u043D%u043E%u0432%u0438%u0442%u044C%20%u0432%u0441%u0435%20%u0432%u043A%u043B%u0430%u0434%u043A%u0438%22%2C%0A%09%09%09restoreAllTabsAccesskey%3A%20%22%u043B%22%2C%0A%09%09%09clearTabsHistory%3A%20%22%u041E%u0447%u0438%u0441%u0442%u0438%u0442%u044C%20%u0438%u0441%u0442%u043E%u0440%u0438%u044E%20%u0437%u0430%u043A%u0440%u044B%u0442%u044B%u0445%20%u0432%u043A%u043B%u0430%u0434%u043E%u043A%22%2C%0A%09%09%09clearTabsHistoryAccesskey%3A%20%22%u0434%22%2C%0A%0A%09%09%09restoreAllWindows%3A%20%22%u0412%u043E%u0441%u0441%u0442%u0430%u043D%u043E%u0432%u0438%u0442%u044C%20%u0432%u0441%u0435%20%u043E%u043A%u043D%u0430%22%2C%0A%09%09%09restoreAllWindowsAccesskey%3A%20%22%u043E%22%2C%0A%09%09%09clearWindowsHistory%3A%20%22%u041E%u0447%u0438%u0441%u0442%u0438%u0442%u044C%20%u0438%u0441%u0442%u043E%u0440%u0438%u044E%20%u0437%u0430%u043A%u0440%u044B%u0442%u044B%u0445%20%u043E%u043A%u043E%u043D%22%2C%0A%09%09%09clearWindowsHistoryAccesskey%3A%20%22%u043D%22%2C%0A%0A%09%09%09clearAllHistory%3A%20%22%u041E%u0447%u0438%u0441%u0442%u0438%u0442%u044C%20%u0432%u0441%u044E%20%u0438%u0441%u0442%u043E%u0440%u0438%u044E%22%2C%0A%09%09%09clearAllHistoryAccesskey%3A%20%22%u0447%22%2C%0A%0A%09%09%09restoreLastSession%3A%20%22%u0412%u043E%u0441%u0441%u0442%u0430%u043D%u043E%u0432%u0438%u0442%u044C%20%u043F%u043E%u0441%u043B%u0435%u0434%u043D%u044E%u044E%20%u0441%u0435%u0441%u0441%u0438%u044E%22%2C%0A%09%09%09restoreLastSessionAccesskey%3A%20%22%u0441%22%2C%0A%0A%09%09%09deleteUndoEntry%3A%20%22%u0423%u0434%u0430%u043B%u0438%u0442%u044C%22%2C%0A%0A%09%09%09buttonMenu%3A%20%22%u041C%u0435%u043D%u044E%20%u043A%u043D%u043E%u043F%u043A%u0438%22%2C%0A%09%09%09buttonMenuAccesskey%3A%20%22%u041C%22%2C%0A%0A%09%09%09tabContextMenu%3A%20%22%u041D%u0435%u0434%u0430%u0432%u043D%u043E%20%u0437%u0430%u043A%u0440%u044B%u0442%u044B%u0435%20%u0432%u043A%u043B%u0430%u0434%u043A%u0438%22%2C%0A%09%09%09tabContextMenuAccesskey%3A%20%22%u043E%22%2C%0A%0A%09%09%09itemTip%3A%20%22%25ago%20%u043D%u0430%u0437%u0430%u0434%2C%20%25date%22%2C%0A%09%09%09day%3A%20%22%u0434%22%0A%09%09%7D%0A%09%7D%3B%0A%09var%20locale%20%3D%20%28function%28%29%20%7B%0A%09%09if%28%22Services%22%20in%20window%20%26%26%20%22locale%22%20in%20Services%29%20%7B%0A%09%09%09var%20locales%20%3D%20Services.locale.requestedLocales%20//%20Firefox%2064+%0A%09%09%09%09%7C%7C%20Services.locale.getRequestedLocales%20%26%26%20Services.locale.getRequestedLocales%28%29%3B%0A%09%09%09if%28locales%29%0A%09%09%09%09return%20locales%5B0%5D%3B%0A%09%09%7D%0A%09%09var%20prefs%20%3D%20%22Services%22%20in%20window%20%26%26%20Services.prefs%0A%09%09%09%7C%7C%20Components.classes%5B%22@mozilla.org/preferences-service%3B1%22%5D%0A%09%09%09%09.getService%28Components.interfaces.nsIPrefBranch%29%3B%0A%09%09function%20pref%28name%2C%20type%29%20%7B%0A%09%09%09return%20prefs.getPrefType%28name%29%20%21%3D%20prefs.PREF_INVALID%20%3F%20prefs%5B%22get%22%20+%20type%20+%20%22Pref%22%5D%28name%29%20%3A%20undefined%3B%0A%09%09%7D%0A%09%09if%28%21pref%28%22intl.locale.matchOS%22%2C%20%22Bool%22%29%29%20%7B%20//%20Also%20see%20https%3A//bugzilla.mozilla.org/show_bug.cgi%3Fid%3D1414390%0A%09%09%09var%20locale%20%3D%20pref%28%22general.useragent.locale%22%2C%20%22Char%22%29%3B%0A%09%09%09if%28locale%20%26%26%20locale.substr%280%2C%209%29%20%21%3D%20%22chrome%3A//%22%29%0A%09%09%09%09return%20locale%3B%0A%09%09%7D%0A%09%09return%20Components.classes%5B%22@mozilla.org/chrome/chrome-registry%3B1%22%5D%0A%09%09%09.getService%28Components.interfaces.nsIXULChromeRegistry%29%0A%09%09%09.getSelectedLocale%28%22global%22%29%3B%0A%09%7D%29%28%29.match%28/%5E%5Ba-z%5D*/%29%5B0%5D%3B%0A%09_localize%20%3D%20function%28sid%29%20%7B%0A%09%09return%20strings%5Blocale%5D%20%26%26%20strings%5Blocale%5D%5Bsid%5D%20%7C%7C%20strings.en%5Bsid%5D%20%7C%7C%20sid%3B%0A%09%7D%3B%0A%09return%20_localize.apply%28this%2C%20arguments%29%3B%0A%7D%0A%0Avar%20JSON%20%3D%20%22JSON%22%20in%20window%0A%09%3F%20window.JSON%0A%09%3A%20%22nsIJSON%22%20in%20Components.interfaces%0A%09%09%3F%20%7B%0A%09%09%09parse%3A%20function%28s%29%20%7B%0A%09%09%09%09return%20Components.classes%5B%22@mozilla.org/dom/json%3B1%22%5D%0A%09%09%09%09%09.createInstance%28Components.interfaces.nsIJSON%29%0A%09%09%09%09%09.decode%28s%29%3B%0A%09%09%09%7D%0A%09%09%7D%0A%09%09%3A%20%7B%0A%09%09%09parse%3A%20function%28s%29%20%7B%0A%09%09%09%09return%20Components.utils.evalInSandbox%28%22%28%22%20+%20s%20+%20%22%29%22%2C%20new%20Components.utils.Sandbox%28%22about%3Ablank%22%29%29%3B%0A%09%09%09%7D%0A%09%09%7D%3B%0A%0Athis.onclick%20%3D%20function%28e%29%20%7B%0A%09if%28e.target%20%21%3D%20this%29%0A%09%09return%3B%0A%09if%28e.button%20%3D%3D%201%20%7C%7C%20e.button%20%3D%3D%200%20%26%26%20%28e.ctrlKey%20%7C%7C%20e.shiftKey%20%7C%7C%20e.altKey%20%7C%7C%20e.metaKey%29%29%0A%09%09this.undoCloseTabsList.clearAllLists%28%29%3B%0A%09else%20if%28%0A%09%09e.button%20%3D%3D%200%0A%09%09%7C%7C%20e.button%20%3D%3D%202%20%26%26%20%21e.ctrlKey%20%26%26%20%21e.shiftKey%20%26%26%20%21e.altKey%20%26%26%20%21e.metaKey%0A%09%09%09%26%26%20this.undoCloseTabsList.options.rightClickToUndoCloseTab%0A%09%29%20%7B%0A%09%09if%28%0A%09%09%09e.button%20%3D%3D%200%20%26%26%20%21this.undoCloseTabsList.options.useMenu%0A%09%09%09%7C%7C%20e.button%20%3D%3D%202%20%26%26%20this.undoCloseTabsList.options.rightClickToUndoCloseTab%0A%09%09%29%20%7B%0A%09%09%09if%28this.undoCloseTabsList.closedTabCount%29%0A%09%09%09%09this.undoCloseTabsList.undoCloseTab%28%29%3B%0A%09%09%09else%0A%09%09%09%09this.undoCloseTabsList.drawUndoList%28%29%20%26%26%20this.undoCloseTabsList.showMenu%28e%29%3B%0A%09%09%7D%0A%09%09//%20Allow%20use%20%22command%22%20section%20only%20from%20hotkey%3A%0A%09%09e.preventDefault%28%29%3B%0A%09%09e.stopPropagation%28%29%3B%0A%09%7D%0A%7D%3B%0Aif%28%21this.hasOwnProperty%28%22defaultContextId%22%29%29%0A%09this.defaultContextId%20%3D%20this.getAttribute%28%22context%22%29%20%7C%7C%20%22custombuttons-contextpopup%22%3B%0Athis.onmousedown%20%3D%20function%28e%29%20%7B%0A%09if%28e.target%20%21%3D%20this%29%0A%09%09return%3B%0A%09if%28this.undoCloseTabsList.options.useMenu%29%20%7B%0A%09%09if%28e.button%20%3D%3D%200%29%0A%09%09%09this.undoCloseTabsList.drawUndoList%28%29%3B%0A%09%7D%0A%09else%20if%28e.button%20%3D%3D%202%29%20%7B%0A%09%09var%20showCbMenu%20%3D%20e.ctrlKey%20%7C%7C%20e.shiftKey%20%7C%7C%20e.altKey%20%7C%7C%20e.metaKey%20%7C%7C%20%21this.undoCloseTabsList.drawUndoList%28%29%3B%0A%09%09this.setAttribute%28%0A%09%09%09%22context%22%2C%0A%09%09%09showCbMenu%0A%09%09%09%09%3F%20this.defaultContextId%0A%09%09%09%09%3A%20this.undoCloseTabsList.mpId%0A%09%09%29%3B%0A%09%7D%0A%7D%3B%0Athis.onmouseover%20%3D%20function%28e%29%20%7B%0A%09if%28e.target%20%21%3D%20this%29%0A%09%09return%3B%0A%09if%28%21this.disabled%29%0A%09%09this.undoCloseTabsList.updUI%28%29%3B%0A%09this.undoCloseTabsList.options.useMenu%20%26%26%20Array.prototype.some.call%28%0A%09%09this.parentNode.getElementsByTagName%28%22*%22%29%2C%0A%09%09function%28node%29%20%7B%0A%09%09%09if%28%0A%09%09%09%09node%20%21%3D%20this%0A%09%09%09%09%26%26%20node.namespaceURI%20%3D%3D%20xulns%0A%09%09%09%09//%20See%20https%3A//github.com/Infocatcher/Custom_Buttons/issues/28%0A%09%09%09%09//%26%26%20node.boxObject%0A%09%09%09%09//%26%26%20node.boxObject%20instanceof%20Components.interfaces.nsIMenuBoxObject%0A%09%09%09%09%26%26%20%22open%22%20in%20node%0A%09%09%09%09%26%26%20node.open%0A%09%09%09%09%26%26%20node.getElementsByTagName%28%22menupopup%22%29.length%0A%09%09%09%09%26%26%20this.undoCloseTabsList.drawUndoList%28%29%0A%09%09%09%29%20%7B%0A%09%09%09%09node.open%20%3D%20false%3B%0A%09%09%09%09this.open%20%3D%20true%3B%0A%09%09%09%09return%20true%3B%0A%09%09%09%7D%0A%09%09%09return%20false%3B%0A%09%09%7D%2C%0A%09%09this%0A%09%29%3B%0A%09if%28%0A%09%09this.undoCloseTabsList.options.openMenuOnMouseover%0A%09%09%26%26%20this.undoCloseTabsList.drawUndoList%28%29%0A%09%29%0A%09%09this.undoCloseTabsList.openMenu%28%29%3B%0A%7D%3B%0A%0Athis.undoCloseTabsList%20%3D%20%7B%0A%09button%3A%20this%2C%0A%09options%3A%20options%2C%0A%09mpId%3A%20this.id%20+%20%22-context%22%2C%0A%09cmId%3A%20this.id%20+%20%22-contextSub%22%2C%0A%09tcmId%3A%20this.id%20+%20%22-tabContextMenu%22%2C%0A%09tipId%3A%20this.id%20+%20%22-tooltip%22%2C%0A%09errPrefix%3A%20%22%5BCustom%20Buttons%20%3A%3A%20Undo%20Close%20Tabs%20List%5D%3A%20%22%2C%0A%09get%20mp%28%29%20%7B%0A%09%09var%20btn%20%3D%20this.button%3B%0A%09%09var%20mp%20%3D%20btn.getElementsByTagName%28%22menupopup%22%29%3B%0A%09%09mp%20%3D%20mp.length%20%26%26%20mp%5B0%5D%3B%0A%09%09mp%20%26%26%20mp.parentNode.removeChild%28mp%29%3B%0A%09%09mp%20%3D%20this.createElement%28%22menupopup%22%2C%20%7B%0A%09%09%09id%3A%20this.mpId%2C%0A%09%09%09onclick%3A%20%22this.parentNode.undoCloseTabsList.checkForMiddleClick%28event%29%3B%22%2C%0A%09%09%09onpopupshowing%3A%20%22if%28event.target%20%3D%3D%20this%29%20document.popupNode%20%3D%20this.parentNode%3B%22%2C%0A%09%09%09onpopuphidden%3A%20%22if%28event.target%20%3D%3D%20this%29%20document.popupNode%20%3D%20null%3B%22%0A%09%09%7D%29%3B%0A%09%09if%28this.cm%29%0A%09%09%09mp.setAttribute%28%22context%22%2C%20this.cmId%29%3B%0A%09%09var%20tb%20%3D%20btn.parentNode%3B%0A%09%09if%28%0A%09%09%09this.options.useMenu%0A%09%09%09%26%26%20tb.getAttribute%28%22orient%22%29%20%3D%3D%20%22vertical%22%0A%09%09%29%20%7B%0A%09%09%09//%20https%3A//addons.mozilla.org/firefox/addon/vertical-toolbar/%0A%09%09%09var%20isRight%20%3D%20tb.parentNode.getAttribute%28%22placement%22%29%20%3D%3D%20%22right%22%3B%0A%09%09%09mp.setAttribute%28%22position%22%2C%20isRight%20%3F%20%22start_before%22%20%3A%20%22end_before%22%29%3B%0A%09%09%7D%0A%09%09delete%20this.mp%3B%0A%09%09return%20this.mp%20%3D%20btn.appendChild%28mp%29%3B%0A%09%7D%2C%0A%09get%20useCentextMenu%28%29%20%7B%0A%09%09delete%20this.useCentextMenu%3B%0A%09%09return%20this.useCentextMenu%20%3D%20this.options.allowDeleteEntries%0A%09%09%09%26%26%20%28%22forgetClosedTab%22%20in%20this.ss%20%7C%7C%20%22forgetClosedWindow%22%20in%20this.ss%29%3B%0A%09%7D%2C%0A%09get%20cm%28%29%20%7B%0A%09%09delete%20this.cm%3B%0A%09%09if%28%21this.useCentextMenu%29%0A%09%09%09return%20this.cm%20%3D%20null%3B%0A%09%09var%20cm%20%3D%20document.getElementById%28this.cmId%29%3B%0A%09%09cm%20%26%26%20cm.parentNode.removeChild%28cm%29%3B%0A%09%09cm%20%3D%20this.createElement%28%22menupopup%22%2C%20%7B%0A%09%09%09id%3A%20this.cmId%2C%0A%09%09%09onpopupshowing%3A%20%22return%20this.undoCloseTabsList.canDeleteUndoEntry%28this.triggerNode%20%7C%7C%20document.popupNode%29%3B%22%0A%09%09%7D%29%3B%0A%09%09var%20mi%20%3D%20this.createElement%28%22menuitem%22%2C%20%7B%0A%09%09%09oncommand%3A%20%22this.parentNode.undoCloseTabsList.deleteUndoEntry%28this.parentNode.triggerNode%20%7C%7C%20document.popupNode%29%3B%22%2C%0A%09%09%09label%3A%20_localize%28%22deleteUndoEntry%22%29%2C%0A%09%09%09closemenu%3A%20%22single%22%0A%09%09%7D%29%3B%0A%09%09cm.appendChild%28mi%29%3B%0A%09%09cm.undoCloseTabsList%20%3D%20this%3B%0A%09%09return%20this.cm%20%3D%20document.getElementById%28%22mainPopupSet%22%29.appendChild%28cm%29%3B%0A%09%7D%2C%0A%09get%20cbMenu%28%29%20%7B%0A%09%09var%20cbPopup%20%3D%20document.getElementById%28this.button.defaultContextId%29%3B%0A%09%09if%28%21cbPopup%29%20%7B%0A%09%09%09Components.utils.reportError%28this.errPrefix%20+%20%22cb%20menu%20not%20found%22%29%3B%0A%09%09%09return%20this.cbMenu%20%3D%20null%3B%0A%09%09%7D%0A%09%09cbPopup%20%3D%20cbPopup.cloneNode%28true%29%3B%0A%09%09var%20id%20%3D%20%22-%22%20+%20this.button.id.match%28/%5Cd*%24/%29%5B0%5D%20+%20%22-cloned%22%3B%0A%09%09cbPopup.id%20+%3D%20id%3B%0A%09%09Array.prototype.slice.call%28cbPopup.getElementsByAttribute%28%22id%22%2C%20%22*%22%29%29.forEach%28function%28node%29%20%7B%0A%09%09%09node.id%20+%3D%20id%3B%0A%09%09%7D%29%3B%0A%09%09var%20menu%20%3D%20this.createElement%28%22menu%22%2C%20%7B%0A%09%09%09label%3A%20_localize%28%22buttonMenu%22%29%2C%0A%09%09%09accesskey%3A%20_localize%28%22buttonMenuAccesskey%22%29%0A%09%09%7D%29%3B%0A%09%09menu.appendChild%28cbPopup%29%3B%0A%09%09cbPopup.setAttribute%28%0A%09%09%09%22onpopupshowing%22%2C%0A%09%09%09%27%5C%0A%09%09%09var%20btn%20%3D%20document.popupNode%20%3D%20this.parentNode.parentNode.parentNode%5Cn%5C%0A%09%09%09%09.undoCloseTabsList.button%3B%5Cn%5C%0A%09%09%09custombutton.setContextMenuVisibility%28btn%29%3B%27%0A%09%09%29%3B%0A%09%09delete%20this.cbMenu%3B%0A%09%09return%20this.cbMenu%20%3D%20menu%3B%0A%09%7D%2C%0A%09get%20ss%28%29%20%7B%0A%09%09delete%20this.ss%3B%0A%09%09return%20this.ss%20%3D%20%22nsISessionStore%22%20in%20Components.interfaces%0A%09%09%09%3F%20%28%0A%09%09%09%09Components.classes%5B%22@mozilla.org/browser/sessionstore%3B1%22%5D%0A%09%09%09%09%7C%7C%20Components.classes%5B%22@mozilla.org/suite/sessionstore%3B1%22%5D%0A%09%09%09%29.getService%28Components.interfaces.nsISessionStore%29%0A%09%09%09%3A%20SessionStore%3B%20//%20Firefox%2061+%20https%3A//bugzilla.mozilla.org/show_bug.cgi%3Fid%3D1450559%0A%09%7D%2C%0A%09get%20appInfo%28%29%20%7B%0A%09%09delete%20this.appInfo%3B%0A%09%09return%20this.appInfo%20%3D%20Components.classes%5B%22@mozilla.org/xre/app-info%3B1%22%5D%0A%09%09%09.getService%28Components.interfaces.nsIXULAppInfo%29%3B%0A%09%7D%2C%0A%09get%20appVersion%28%29%20%7B%0A%09%09delete%20this.appVersion%3B%0A%09%09return%20this.appVersion%20%3D%20parseFloat%28this.appInfo.version%29%3B%0A%09%7D%2C%0A%09get%20appName%28%29%20%7B%0A%09%09delete%20this.appName%3B%0A%09%09return%20this.appName%20%3D%20this.appInfo.name%3B%0A%09%7D%2C%0A%0A%09init%3A%20function%28%29%20%7B%0A%09%09window.addEventListener%28%22TabClose%22%2C%20%20%20%20%20%20%20this%2C%20false%29%3B%0A%09%09window.addEventListener%28%22SSTabRestoring%22%2C%20this%2C%20false%29%3B%0A%09%09window.addEventListener%28%22unload%22%2C%20%20%20%20%20%20%20%20%20this%2C%20false%29%3B%0A%09%09if%28this.appName%20%3D%3D%20%22SeaMonkey%22%29%20//%20No%20SSTab*%20events%20in%20SeaMonkey%0A%09%09%09window.addEventListener%28%22TabOpen%22%2C%20this%2C%20false%29%3B%0A%09%09setTimeout%28function%28_this%29%20%7B%0A%09%09%09_this.mp.addEventListener%28%22DOMMenuItemActive%22%2C%20%20%20_this%2C%20false%29%3B%0A%09%09%09_this.mp.addEventListener%28%22DOMMenuItemInactive%22%2C%20_this%2C%20false%29%3B%0A%09%09%09_this.initTooltip%28%29%3B%0A%09%09%7D%2C%2050%2C%20this%29%3B%0A%09%09this.addPbExitObserver%28true%29%3B%0A%09%09this.updUIGlobal%28%29%3B%0A%09%09if%28this.options.showInTabContextMenu%29%20setTimeout%28function%28_this%29%20%7B%0A%09%09%09_this.initTabContext%28%29%3B%0A%09%09%7D%2C%20100%2C%20this%29%3B%0A%09%7D%2C%0A%09initTabContext%3A%20function%28%29%20%7B%0A%09%09var%20origMi%20%3D%20this.tabContextUndoClose%3B%0A%09%09if%28%21origMi%29%20%7B%0A%09%09%09LOG%28%22Can%27t%20find%20%5C%22Undo%20Close%20Tab%5C%22%20item%20in%20tab%20context%20menu%22%29%3B%0A%09%09%09return%3B%0A%09%09%7D%0A%09%09var%20menu%20%3D%20document.getElementById%28this.tcmId%29%3B%0A%09%09menu%20%26%26%20menu.parentNode.removeChild%28menu%29%3B%20//%20For%20SeaMonkey%0A%09%09menu%20%3D%20this.createElement%28%22menu%22%2C%20%7B%0A%09%09%09id%3A%20this.tcmId%2C%0A%09%09%09label%3A%20_localize%28%22tabContextMenu%22%29%2C%0A%09%09%09accesskey%3A%20_localize%28%22tabContextMenuAccesskey%22%29%2C%0A%09%09%09tooltip%3A%20this.tipId%2C%0A%09%09%09popupsinherittooltip%3A%20%22true%22%0A%09%09%7D%29%3B%0A%09%09menu.undoCloseTabsList%20%3D%20this%3B%0A%09%09menu.onclick%20%3D%20function%28e%29%20%7B%0A%09%09%09if%28e.target%20%21%3D%20this%29%0A%09%09%09%09return%3B%0A%09%09%09if%28e.button%20%3D%3D%201%20%7C%7C%20e.button%20%3D%3D%200%20%26%26%20%28e.ctrlKey%20%7C%7C%20e.shiftKey%20%7C%7C%20e.altKey%20%7C%7C%20e.metaKey%29%29%20%7B%0A%09%09%09%09if%28this.undoCloseTabsList.closedTabCount%29%20%7B%0A%09%09%09%09%09this.undoCloseTabsList.undoCloseTab%28%29%3B%0A%09%09%09%09%09closeMenus%28this%29%3B%0A%09%09%09%09%7D%0A%09%09%09%7D%0A%09%09%7D%3B%0A%09%09var%20origMp%20%3D%20this.mp%3B%0A%09%09var%20mp%20%3D%20origMp.cloneNode%28true%29%3B%0A%09%09mp.id%20%3D%20this.button.id%20+%20%22-tabContext%22%3B%0A%09%09var%20_this%20%3D%20this%3B%0A%09%09function%20drawUndoList%28%29%20%7B%0A%09%09%09var%20ok%20%3D%20false%3B%0A%09%09%09var%20opts%20%3D%20_this.options%3B%0A%09%09%09var%20origTemplate%20%3D%20opts.menuTemplate%3B%0A%09%09%09opts.menuTemplate%20%3D%20opts.menuTemplateTabContext%20%7C%7C%20origTemplate%3B%0A%09%09%09_this.mp%20%3D%20mp%3B%0A%09%09%09try%20%7B%0A%09%09%09%09ok%20%3D%20_this.drawUndoList%28%29%3B%0A%09%09%09%7D%0A%09%09%09catch%28e%29%20%7B%0A%09%09%09%09Components.utils.reportError%28e%29%3B%0A%09%09%09%7D%0A%09%09%09opts.menuTemplate%20%3D%20origTemplate%3B%0A%09%09%09_this.mp%20%3D%20origMp%3B%0A%09%09%09return%20ok%3B%0A%09%09%7D%0A%09%09function%20updMenu%28%29%20%7B%0A%09%09%09if%28drawUndoList%28%29%29%0A%09%09%09%09menu.removeAttribute%28%22disabled%22%29%3B%0A%09%09%09else%0A%09%09%09%09menu.setAttribute%28%22disabled%22%2C%20%22true%22%29%3B%0A%09%09%7D%0A%09%09mp._updatePopup%20%3D%20function%28e%29%20%7B%0A%09%09%09if%28e.target%20%21%3D%20this%29%0A%09%09%09%09return%3B%0A%09%09%09document.popupNode%20%3D%20_this.button%3B%0A%09%09%09drawUndoList%28%29%3B%0A%09%09%7D%3B%0A%09%09mp.setAttribute%28%22onpopupshowing%22%2C%20%22this._updatePopup%28event%29%3B%22%29%3B%0A%09%09mp.onclick%20%3D%20function%28e%29%20%7B%0A%09%09%09_this.checkForMiddleClick%28e%2C%20updMenu%29%3B%0A%09%09%7D%3B%0A%09%09menu.appendChild%28mp%29%3B%0A%09%09addEventListener%28%22popupshown%22%2C%20function%28e%29%20%7B%0A%09%09%09if%28e.target%20%3D%3D%20e.currentTarget%29%0A%09%09%09%09setTimeout%28updMenu%2C%200%29%3B%20//%20Pseudo%20async%0A%09%09%7D%2C%20false%2C%20origMi.parentNode%29%3B%0A%09%09addEventListener%28%22DOMMenuItemActive%22%2C%20%20%20this%2C%20false%2C%20mp%29%3B%0A%09%09addEventListener%28%22DOMMenuItemInactive%22%2C%20this%2C%20false%2C%20mp%29%3B%0A%09%09origMi.parentNode.insertBefore%28menu%2C%20origMi.nextSibling%29%3B%0A%09%09origMi.setAttribute%28%22hidden%22%2C%20%22true%22%29%3B%0A%09%7D%2C%0A%09initTooltip%3A%20function%28%29%20%7B%0A%09%09var%20tip%20%3D%20document.getElementById%28this.tipId%29%3B%0A%09%09tip%20%26%26%20tip.parentNode.removeChild%28tip%29%3B%0A%09%09tip%20%3D%20this.tip%20%3D%20this.createElement%28%22tooltip%22%2C%20%7B%0A%09%09%09id%3A%20this.tipId%2C%0A%09%09%09orient%3A%20%22vertical%22%2C%0A%09%09%09onpopupshowing%3A%20%22return%20this.undoCloseTabsList.updTooltip%28this%2C%20document.tooltipNode%29%3B%22%2C%0A%09%09%09onpopuphiding%3A%20%22this.cancelUpdateTimer%28%29%3B%22%0A%09%09%7D%29%3B%0A%09%09tip.undoCloseTabsList%20%3D%20this%3B%0A%09%09tip._updateTimer%20%3D%200%3B%0A%09%09tip.initUpdateTimer%20%3D%20function%28fn%2C%20context%29%20%7B%0A%09%09%09if%28this._updateTimer%29%0A%09%09%09%09clearInterval%28this._updateTimer%29%3B%0A%09%09%09this._updateTimer%20%3D%20setInterval%28function%28%29%20%7B%0A%09%09%09%09fn.call%28context%29%3B%0A%09%09%09%7D%2C%201000%29%3B%0A%09%09%7D%3B%0A%09%09tip.cancelUpdateTimer%20%3D%20function%28%29%20%7B%0A%09%09%09if%28this._updateTimer%29%20%7B%0A%09%09%09%09clearInterval%28this._updateTimer%29%3B%0A%09%09%09%09this._updateTimer%20%3D%200%3B%0A%09%09%09%7D%0A%09%09%7D%3B%0A%09%09var%20btn%20%3D%20this.button%3B%0A%09%09btn.removeAttribute%28%22tooltiptext%22%29%3B%0A%09%09btn.setAttribute%28%22tooltip%22%2C%20this.tipId%29%3B%0A%09%09btn.setAttribute%28%22popupsinherittooltip%22%2C%20%22true%22%29%3B%0A%09%09document.getElementById%28%22mainPopupSet%22%29.appendChild%28tip%29%3B%0A%09%09if%28this.appVersion%20%3E%3D%2061%20%26%26%20%22getAnonymousElementByAttribute%22%20in%20document%29%20%7B%0A%09%09%09var%20label%20%3D%20document.getAnonymousElementByAttribute%28tip%2C%20%22class%22%2C%20%22tooltip-label%22%29%3B%0A%09%09%09label%20%26%26%20label.remove%28%29%3B%0A%09%09%7D%0A%09%7D%2C%0A%09_hasPbExitObserver%3A%20false%2C%0A%09addPbExitObserver%3A%20function%28add%29%20%7B%0A%09%09if%28add%20%3D%3D%20this._hasPbExitObserver%20%7C%7C%20%21%28%22Services%22%20in%20window%29%29%0A%09%09%09return%3B%0A%09%09this._hasPbExitObserver%20%3D%20add%3B%0A%09%09if%28add%29%0A%09%09%09Services.obs.addObserver%28this%2C%20%22last-pb-context-exited%22%2C%20false%29%3B%0A%09%09else%0A%09%09%09Services.obs.removeObserver%28this%2C%20%22last-pb-context-exited%22%29%3B%0A%09%7D%2C%0A%09destroy%3A%20function%28%29%20%7B%0A%09%09window.removeEventListener%28%22TabClose%22%2C%20%20%20%20%20%20%20this%2C%20false%29%3B%0A%09%09window.removeEventListener%28%22SSTabRestoring%22%2C%20this%2C%20false%29%3B%0A%09%09window.removeEventListener%28%22unload%22%2C%20%20%20%20%20%20%20%20%20this%2C%20false%29%3B%0A%09%09if%28this.appName%20%3D%3D%20%22SeaMonkey%22%29%0A%09%09%09window.removeEventListener%28%22TabOpen%22%2C%20this%2C%20false%29%3B%0A%09%09this.mp.removeEventListener%28%22DOMMenuItemActive%22%2C%20%20%20this%2C%20false%29%3B%0A%09%09this.mp.removeEventListener%28%22DOMMenuItemInactive%22%2C%20this%2C%20false%29%3B%0A%09%09this.addPbExitObserver%28false%29%3B%0A%09%09var%20menu%20%3D%20document.getElementById%28this.tcmId%29%3B%0A%09%09if%28menu%29%20%7B%0A%09%09%09menu.parentNode.removeChild%28menu%29%3B%0A%09%09%09this.tabContextUndoClose.removeAttribute%28%22hidden%22%29%3B%0A%09%09%7D%0A%09%09var%20tip%20%3D%20this.tip%3B%0A%09%09tip%20%26%26%20tip.parentNode%20%26%26%20tip.parentNode.removeChild%28tip%29%3B%0A%09%7D%2C%0A%09handleEvent%3A%20function%28e%29%20%7B%0A%09%09switch%28e.type%29%20%7B%0A%09%09%09case%20%22TabClose%22%3A%0A%09%09%09case%20%22SSTabRestoring%22%3A%0A%09%09%09case%20%22TabOpen%22%3A%0A%09%09%09%09setTimeout%28function%28_this%29%20%7B%0A%09%09%09%09%09_this.updUI%28%29%3B%0A%09%09%09%09%7D%2C%200%2C%20this%29%3B%0A%09%09%09break%3B%0A%09%09%09case%20%22DOMMenuItemActive%22%3A%0A%09%09%09case%20%22DOMMenuItemInactive%22%3A%0A%09%09%09%09if%28%21%28%22XULBrowserWindow%22%20in%20window%29%29%0A%09%09%09%09%09break%3B%0A%09%09%09%09XULBrowserWindow.setOverLink%28%0A%09%09%09%09%09e.type%20%3D%3D%20%22DOMMenuItemActive%22%0A%09%09%09%09%09%09%3F%20%28e.target.getAttribute%28%22cb_urlDecoded%22%29%20%7C%7C%20%22%22%29%0A%09%09%09%09%09%09%09.replace%28/%20%5Cn/g%2C%20%22%2C%20%22%29%0A%09%09%09%09%09%09%3A%20%22%22%2C%0A%09%09%09%09%09null%0A%09%09%09%09%29%3B%0A%09%09%09break%3B%0A%09%09%09case%20%22unload%22%3A%0A%09%09%09%09this.updUIGlobal%28%29%3B%0A%09%09%09%09this.destroy%28%29%3B%0A%09%09%7D%0A%09%7D%2C%0A%09observe%3A%20function%28subject%2C%20topic%2C%20data%29%20%7B%0A%09%09if%28topic%20%3D%3D%20%22last-pb-context-exited%22%29%20%7B%0A%09%09%09setTimeout%28function%28_this%29%20%7B%0A%09%09%09%09_this.updUI%28%29%3B%0A%09%09%09%7D%2C%2025%2C%20this%29%3B%0A%09%09%7D%0A%09%7D%2C%0A%0A%09createElement%3A%20function%28name%2C%20attrs%29%20%7B%0A%09%09var%20node%20%3D%20document.createElementNS%28xulns%2C%20name%29%3B%0A%09%09if%28attrs%29%20for%28var%20attrName%20in%20attrs%29%20if%28attrs.hasOwnProperty%28attrName%29%29%0A%09%09%09node.setAttribute%28attrName%2C%20attrs%5BattrName%5D%29%3B%0A%09%09return%20node%3B%0A%09%7D%2C%0A%09get%20tabContextUndoClose%28%29%20%7B%0A%09%09return%20document.getElementById%28%22context_undoCloseTab%22%29%0A%09%09%09%7C%7C%20document.getElementById%28%22tabContextUndoCloseTab%22%29%20//%20Firefox%202.0%0A%09%09%09%7C%7C%20document.getAnonymousElementByAttribute%28gBrowser%2C%20%22tbattr%22%2C%20%22tabbrowser-undoclosetab%22%29%3B%20//%20SeaMonkey%0A%09%7D%2C%0A%09get%20closedWindowCount%28%29%20%7B%0A%09%09if%28%21%28%22getClosedWindowCount%22%20in%20this.ss%29%29%20%7B%0A%09%09%09delete%20this.closedWindowCount%3B%0A%09%09%09return%20this.closedWindowCount%20%3D%200%3B%0A%09%09%7D%0A%09%09this.__defineGetter__%28%22closedWindowCount%22%2C%20function%28%29%20%7B%0A%09%09%09return%20this.ss.getClosedWindowCount%28%29%3B%0A%09%09%7D%29%3B%0A%09%09return%20this.closedWindowCount%3B%0A%09%7D%2C%0A%09get%20closedTabCount%28%29%20%7B%0A%09%09return%20this.ss.getClosedTabCount%28window%29%3B%0A%09%7D%2C%0A%09undoCloseTab%3A%20function%28i%29%20%7B%0A%09%09if%28%22undoCloseTab%22%20in%20window%29%20//%20Firefox%202.0+%0A%09%09%09undoCloseTab%28i%29%3B%0A%09%09else%20//%20SeaMonkey%0A%09%09%09gBrowser.undoCloseTab%28i%29%3B%0A%09%7D%2C%0A%09clearUndoTabsList%3A%20function%28%29%20%7B%0A%09%09var%20closedTabCount%20%3D%20this.closedTabCount%3B%0A%09%09if%28%21closedTabCount%29%0A%09%09%09return%3B%0A%09%09if%28%22forgetClosedTab%22%20in%20this.ss%29%20//%20Gecko%201.9.2+%0A%09%09%09while%28closedTabCount--%29%0A%09%09%09%09this.ss.forgetClosedTab%28window%2C%200%29%3B%0A%09%09else%20%7B%0A%09%09%09//%20Doesn%27t%20work%20in%20SeaMonkey%0A%09%09%09const%20pName%20%3D%20%22browser.sessionstore.max_tabs_undo%22%3B%0A%09%09%09let%20val%20%3D%20cbu.getPrefs%28pName%29%3B%0A%09%09%09cbu.setPrefs%28pName%2C%200%29%3B%0A%09%09%09cbu.setPrefs%28pName%2C%20val%29%3B%0A%09%09%7D%0A%09%09this.updUIGlobal%28%29%3B%0A%09%7D%2C%0A%09clearUndoWindowsList%3A%20function%28%29%20%7B%0A%09%09var%20closedWindowCount%20%3D%20this.closedWindowCount%3B%0A%09%09if%28%21closedWindowCount%29%0A%09%09%09return%3B%0A%09%09if%28%22forgetClosedWindow%22%20in%20this.ss%29%20//%20Gecko%201.9.2+%0A%09%09%09while%28closedWindowCount--%29%0A%09%09%09%09this.ss.forgetClosedWindow%280%29%3B%0A%09%09else%0A%09%09%09this.ss.setWindowState%28window%2C%20%27%7B%22windows%22%3A%5B%7B%7D%5D%2C%22_closedWindows%22%3A%5B%5D%7D%27%2C%20false%29%3B%0A%09%09this.updUIGlobal%28%29%3B%0A%09%7D%2C%0A%09clearAllLists%3A%20function%28%29%20%7B%0A%09%09this.clearUndoTabsList%28%29%3B%0A%09%09this.clearUndoWindowsList%28%29%3B%0A%09%7D%2C%0A%09canDeleteUndoEntry%3A%20function%28mi%29%20%7B%0A%09%09switch%28mi.getAttribute%28%22cb_type%22%29%29%20%7B%0A%09%09%09case%20%22tab%22%3A%20%20%20%20return%20%22forgetClosedTab%22%20%20%20%20in%20this.ss%3B%0A%09%09%09case%20%22window%22%3A%20return%20%22forgetClosedWindow%22%20in%20this.ss%3B%0A%09%09%7D%0A%09%09return%20false%3B%0A%09%7D%2C%0A%09deleteUndoEntry%3A%20function%28mi%29%20%7B%0A%09%09var%20i%20%3D%20+mi.getAttribute%28%22cb_index%22%29%3B%0A%09%09if%28mi.getAttribute%28%22cb_type%22%29%20%3D%3D%20%22window%22%29%20%7B%0A%09%09%09this.ss.forgetClosedWindow%28i%29%3B%0A%09%09%09this.updUIGlobal%28%29%3B%0A%09%09%7D%0A%09%09else%20%7B%0A%09%09%09this.ss.forgetClosedTab%28window%2C%20i%29%3B%0A%09%09%09this.updUI%28%29%3B%0A%09%09%7D%0A%09%09this.drawUndoList%28%29%3B%0A%09%7D%2C%0A%09showMenu%3A%20function%28e%2C%20isContext%2C%20mp%29%20%7B%0A%09%09var%20btn%20%3D%20this.button%3B%0A%09%09document.popupNode%20%3D%20btn.ownerDocument.popupNode%20%3D%20btn%3B%0A%09%09if%28%21mp%29%0A%09%09%09mp%20%3D%20this.mp%3B%0A%09%09if%28%22openPopupAtScreen%22%20in%20mp%29%0A%09%09%09mp.openPopupAtScreen%28e.screenX%2C%20e.screenY%2C%20isContext%29%3B%0A%09%09else%0A%09%09%09mp.showPopup%28btn%2C%20e.screenX%2C%20e.screenY%2C%20isContext%20%3F%20%22context%22%20%3A%20%22popup%22%2C%20null%2C%20null%29%3B%0A%09%7D%2C%0A%09openMenu%3A%20function%28%29%20%7B%0A%09%09var%20mp%20%3D%20this.mp%3B%0A%09%09if%28%22openPopup%22%20in%20mp%29%0A%09%09%09mp.openPopup%28this.button%2C%20%22after_start%22%29%3B%0A%09%09else%0A%09%09%09mp.showPopup%28this.button%2C%20-1%2C%20-1%2C%20%22popup%22%2C%20%22bottomleft%22%2C%20%22topleft%22%29%3B%0A%09%7D%2C%0A%09drawUndoList%3A%20function%28%29%20%7B%0A%09%09var%20mp%20%3D%20this.mp%3B%0A%0A%09%09var%20wc%20%3D%20this.closedWindowCount%3B%0A%09%09var%20tc%20%3D%20this.closedTabCount%3B%0A%09%09var%20ss%20%3D%20this.ss%3B%0A%09%09var%20canRestoreLastSession%20%3D%20%22restoreLastSession%22%20in%20ss%20%26%26%20ss.canRestoreLastSession%0A%09%09if%28%21wc%20%26%26%20%21tc%20%26%26%20%21canRestoreLastSession%29%20%7B%0A%09%09%09mp.textContent%20%3D%20%22%22%3B%0A%09%09%09mp.hidePopup%28%29%3B%0A%09%09%09return%20false%3B%0A%09%09%7D%0A%0A%09%09this._undoWindowItems%20%3D%20wc%20%26%26%20JSON.parse%28ss.getClosedWindowData%28%29%29%3B%0A%09%09this._undoTabItems%20%20%20%20%3D%20tc%20%26%26%20JSON.parse%28ss.getClosedTabData%28window%29%29%3B%0A%09%09var%20df%20%3D%20document.createDocumentFragment%28%29%3B%0A%0A%09%09this.options.menuTemplate.forEach%28function%28sid%2C%20indx%2C%20arr%29%20%7B%0A%09%09%09switch%28sid%29%20%7B%0A%09%09%09%09case%20%22closedWindows%22%3A%0A%09%09%09%09%09wc%20%26%26%20this.addUndoWindowsList%28df%29%3B%0A%09%09%09%09break%3B%0A%09%09%09%09case%20%22restoreClosedWindows%22%3A%0A%09%09%09%09%09wc%20%3E%20this.options.hideRestoreAllForSingleEntry%0A%09%09%09%09%09%26%26%20df.appendChild%28this.createElement%28%22menuitem%22%2C%20%7B%0A%09%09%09%09%09%09label%3A%20_localize%28%22restoreAllWindows%22%29%2C%0A%09%09%09%09%09%09accesskey%3A%20_localize%28%22restoreAllWindowsAccesskey%22%29%2C%0A%09%09%09%09%09%09oncommand%3A%20%22for%28var%20i%20%3D%200%3B%20i%20%3C%20%22%20+%20this._undoWindowItems.length%20+%20%22%3B%20++i%29%20undoCloseWindow%28%29%3B%22%0A%09%09%09%09%09%7D%29%29%3B%0A%09%09%09%09break%3B%0A%09%09%09%09case%20%22clearClosedWindows%22%3A%0A%09%09%09%09%09wc%20%26%26%20df.appendChild%28this.createElement%28%22menuitem%22%2C%20%7B%0A%09%09%09%09%09%09label%3A%20_localize%28%22clearWindowsHistory%22%29%2C%0A%09%09%09%09%09%09accesskey%3A%20_localize%28%22clearWindowsHistoryAccesskey%22%29%2C%0A%09%09%09%09%09%09oncommand%3A%20%22this.parentNode.parentNode.undoCloseTabsList.clearUndoWindowsList%28%29%3B%22%0A%09%09%09%09%09%7D%29%29%3B%0A%09%09%09%09break%3B%0A%09%09%09%09case%20%22closedTabs%22%3A%0A%09%09%09%09%09tc%20%26%26%20this.addUndoTabsList%28df%29%3B%0A%09%09%09%09break%3B%0A%09%09%09%09case%20%22restoreClosedTabs%22%3A%0A%09%09%09%09%09tc%20%3E%20this.options.hideRestoreAllForSingleEntry%0A%09%09%09%09%09%26%26%20df.appendChild%28this.createElement%28%22menuitem%22%2C%20%7B%0A%09%09%09%09%09%09label%3A%20_localize%28%22restoreAllTabs%22%29%2C%0A%09%09%09%09%09%09accesskey%3A%20_localize%28%22restoreAllTabsAccesskey%22%29%2C%0A%09%09%09%09%09%09oncommand%3A%20%22for%28var%20i%20%3D%200%3B%20i%20%3C%20%22%20+%20this._undoTabItems.length%20+%20%22%3B%20++i%29%20this.parentNode.parentNode.undoCloseTabsList.undoCloseTab%28%29%3B%22%0A%09%09%09%09%09%7D%29%29%3B%0A%09%09%09%09break%3B%0A%09%09%09%09case%20%22clearClosedTabs%22%3A%0A%09%09%09%09%09tc%20%26%26%20df.appendChild%28this.createElement%28%22menuitem%22%2C%20%7B%0A%09%09%09%09%09%09label%3A%20_localize%28%22clearTabsHistory%22%29%2C%0A%09%09%09%09%09%09accesskey%3A%20_localize%28%22clearTabsHistoryAccesskey%22%29%2C%0A%09%09%09%09%09%09oncommand%3A%20%22this.parentNode.parentNode.undoCloseTabsList.clearUndoTabsList%28%29%3B%22%0A%09%09%09%09%09%7D%29%29%3B%0A%09%09%09%09break%3B%0A%09%09%09%09case%20%22clearAll%22%3A%0A%09%09%09%09%09%28%0A%09%09%09%09%09%09wc%20%26%26%20tc%0A%09%09%09%09%09%09%7C%7C%20wc%20%26%26%20arr.indexOf%28%22clearClosedWindows%22%29%20%3D%3D%20-1%0A%09%09%09%09%09%09%7C%7C%20tc%20%26%26%20arr.indexOf%28%22clearClosedTabs%22%29%20%3D%3D%20-1%0A%09%09%09%09%09%29%0A%09%09%09%09%09%26%26%20df.appendChild%28this.createElement%28%22menuitem%22%2C%20%7B%0A%09%09%09%09%09%09label%3A%20_localize%28%22clearAllHistory%22%29%2C%0A%09%09%09%09%09%09accesskey%3A%20_localize%28%22clearAllHistoryAccesskey%22%29%2C%0A%09%09%09%09%09%09oncommand%3A%20%22this.parentNode.parentNode.undoCloseTabsList.clearAllLists%28%29%3B%22%0A%09%09%09%09%09%7D%29%29%3B%0A%09%09%09%09break%3B%0A%09%09%09%09case%20%22restoreLastSession%22%3A%20//%20Gecko%202.0+%0A%09%09%09%09%09canRestoreLastSession%20%26%26%20df.appendChild%28this.createElement%28%22menuitem%22%2C%20%7B%0A%09%09%09%09%09%09label%3A%20_localize%28%22restoreLastSession%22%29%2C%0A%09%09%09%09%09%09accesskey%3A%20_localize%28%22restoreLastSessionAccesskey%22%29%2C%0A%09%09%09%09%09%09oncommand%3A%20%22this.parentNode.parentNode.undoCloseTabsList.ss.restoreLastSession%28%29%3B%22%0A%09%09%09%09%09%7D%29%29%3B%0A%09%09%09%09break%3B%0A%09%09%09%09case%20%22buttonMenu%22%3A%0A%09%09%09%09%09let%20cbMenu%20%3D%20this.cbMenu%3B%0A%09%09%09%09%09if%28cbMenu%29%0A%09%09%09%09%09%09df.appendChild%28cbMenu%29%3B%0A%09%09%09%09break%3B%0A%09%09%09%09case%20%22separator%22%3A%0A%09%09%09%09%09if%28df.hasChildNodes%28%29%20%26%26%20df.lastChild.localName%20%21%3D%20%22menuseparator%22%29%0A%09%09%09%09%09%09df.appendChild%28document.createElementNS%28xulns%2C%20%22menuseparator%22%29%29%3B%0A%09%09%09%09break%3B%0A%09%09%09%09default%3A%0A%09%09%09%09%09Components.utils.reportError%28this.errPrefix%20+%20%27Invalid%20template%20entry%3A%20%22%27%20+%20sid%20+%20%27%22%27%29%3B%0A%09%09%09%7D%0A%09%09%7D%2C%20this%29%3B%0A%0A%09%09while%28df.hasChildNodes%28%29%20%26%26%20df.lastChild.localName%20%3D%3D%20%22menuseparator%22%29%0A%09%09%09df.removeChild%28df.lastChild%29%3B%0A%0A%09%09this._undoWindowItems%20%3D%20this._undoTabItems%20%3D%20null%3B%0A%0A%09%09mp.textContent%20%3D%20%22%22%3B%0A%09%09if%28%21df.hasChildNodes%28%29%29%20%7B%0A%09%09%09mp.hidePopup%28%29%3B%0A%09%09%09return%20false%3B%0A%09%09%7D%0A%09%09mp.appendChild%28df%29%3B%0A%09%09return%20true%3B%0A%09%7D%2C%0A%09addUndoWindowsList%3A%20function%28undoPopup%29%20%7B%0A%09%09//%20Based%20on%20code%20from%20chrome%3A//browser/content/browser.js%0A%09%09//%20Mozilla/5.0%20%28Windows%3B%20U%3B%20Windows%20NT%205.1%3B%20en-US%3B%20rv%3A1.9.3a1pre%29%20Gecko/20090824%20Minefield/3.7a1pre%0A%0A%09%09var%20keys%20%3D%20this.options.accesskeys.closedWindows%3B%0A%09%09this._undoWindowItems.forEach%28function%28undoItem%2C%20i%29%20%7B%0A%09%09%09var%20tabs%20%3D%20undoItem.tabs%3B%0A%09%09%09var%20%5Bkey%2C%20keyPrefix%5D%20%3D%20this.getKey%28keys%2C%20i%29%3B%0A%09%09%09var%20title%20%3D%20undoItem.title%3B%0A%09%09%09var%20selectedTab%20%3D%20tabs%5BundoItem.selected%20-%201%5D%3B%0A%09%09%09var%20urls%20%3D%20%5B%5D%3B%0A%09%09%09tabs.forEach%28function%28tab%29%20%7B%0A%09%09%09%09if%28%21tab.entries%20%7C%7C%20%21tab.entries.length%29%20//%20Can%20be%20%5B%5D%20for%20about%3Ablank%0A%09%09%09%09%09return%3B%0A%09%09%09%09var%20url%20%3D%20this.convertURI%28tab.entries%5Btab.index%20-%201%5D.url%2C%20120%29%3B%0A%09%09%09%09var%20selectedPrefix%20%3D%20tab%20%3D%3D%20selectedTab%20%26%26%20tabs.length%20%3E%201%0A%09%09%09%09%09%3F%20this.options.windowSelectedTabPrefix%0A%09%09%09%09%09%3A%20%22%22%3B%0A%09%09%09%09urls.push%28selectedPrefix%20+%20url%29%3B%0A%09%09%09%7D%2C%20this%29%3B%0A%09%09%09var%20url%20%3D%20urls.join%28%22%20%5Cn%22%29%3B%0A%09%09%09var%20mi%20%3D%20this.createElement%28%22menuitem%22%2C%20%7B%0A%09%09%09%09label%3A%20keyPrefix%20+%20this.options.windowItemTemplate%0A%09%09%09%09%09.replace%28%22%25title%22%2C%20title%29%0A%09%09%09%09%09.replace%28%22%25count%22%2C%20tabs.length%29%2C%0A%09%09%09%09accesskey%3A%20key%2C%0A%09%09%09%09%22class%22%3A%20%22menuitem-iconic%20bookmark-item%20menuitem-with-favicon%22%2C%0A%09%09%09%09oncommand%3A%20%22undoCloseWindow%28%22%20+%20i%20+%20%22%29%3B%22%2C%0A%09%09%09%09cb_url%3A%20url%2C%0A%09%09%09%09cb_urlDecoded%3A%20this.convertURI%28url%29%2C%0A%09%09%09%09cb_closedAt%3A%20undoItem.closedAt%20%7C%7C%200%2C%0A%09%09%09%09cb_index%3A%20i%2C%0A%09%09%09%09cb_type%3A%20%22window%22%0A%09%09%09%7D%29%3B%0A%09%09%09if%28this.cm%29%0A%09%09%09%09mi.setAttribute%28%22context%22%2C%20this.cmId%29%3B%0A%09%09%09var%20icon%20%3D%20selectedTab.image%20%7C%7C%20selectedTab.attributes%20%26%26%20selectedTab.attributes.image%3B%0A%09%09%09if%28icon%29%0A%09%09%09%09mi.setAttribute%28%22image%22%2C%20this.cachedIcon%28icon%29%29%3B%0A%09%09%09if%28i%20%3D%3D%200%29%0A%09%09%09%09mi.setAttribute%28%22key%22%2C%20%22key_undoCloseWindow%22%29%3B%0A%09%09%09undoPopup.appendChild%28mi%29%3B%0A%09%09%7D%2C%20this%29%3B%0A%09%7D%2C%0A%09addUndoTabsList%3A%20function%28undoPopup%29%20%7B%0A%09%09//%20Based%20on%20code%20from%20chrome%3A//browser/content/browser.js%0A%09%09//%20Mozilla/5.0%20%28Windows%3B%20U%3B%20Windows%20NT%205.1%3B%20en-US%3B%20rv%3A1.9.3a1pre%29%20Gecko/20090824%20Minefield/3.7a1pre%0A%0A%09%09var%20keys%20%3D%20this.options.accesskeys.closedTabs%3B%0A%09%09this._undoTabItems.forEach%28function%28undoItem%2C%20i%29%20%7B%0A%09%09%09var%20state%20%3D%20undoItem.state%3B%0A%09%09%09var%20%5Bkey%2C%20keyPrefix%5D%20%3D%20this.getKey%28keys%2C%20i%29%3B%0A%09%09%09var%20title%20%3D%20undoItem.title%3B%0A%09%09%09var%20url%20%3D%20state%20%26%26%20state.entries%20%26%26%20state.entries%5Bstate.index%20-%201%5D.url%20%7C%7C%20%22%22%3B%0A%09%09%09var%20mi%20%3D%20this.createElement%28%22menuitem%22%2C%20%7B%0A%09%09%09%09label%3A%20keyPrefix%20+%20title%2C%0A%09%09%09%09accesskey%3A%20key%2C%0A%09%09%09%09class%3A%20%22menuitem-iconic%20bookmark-item%20menuitem-with-favicon%22%2C%0A%09%09%09%09oncommand%3A%20%22this.parentNode.parentNode.undoCloseTabsList.undoCloseTab%28%22%20+%20i%20+%20%22%29%3B%22%2C%0A%09%09%09%09cb_url%3A%20url%2C%0A%09%09%09%09cb_urlDecoded%3A%20this.convertURI%28url%29%2C%0A%09%09%09%09cb_closedAt%3A%20undoItem.closedAt%20%7C%7C%200%2C%0A%09%09%09%09cb_index%3A%20i%2C%0A%09%09%09%09cb_type%3A%20%22tab%22%0A%09%09%09%7D%29%3B%0A%09%09%09if%28%0A%09%09%09%09state%0A%09%09%09%09%26%26%20%22attributes%22%20in%20state%0A%09%09%09%09%26%26%20%22privateTab-isPrivate%22%20in%20state.attributes%0A%09%09%09%29%20//%20https%3A//addons.mozilla.org/addon/private-tab/%0A%09%09%09%09mi.setAttribute%28%22privateTab-isPrivate%22%2C%20%22true%22%29%3B%0A%09%09%09if%28this.cm%29%0A%09%09%09%09mi.setAttribute%28%22context%22%2C%20this.cmId%29%3B%0A%09%09%09var%20image%20%3D%20undoItem.image%20//%20Firefox%0A%09%09%09%09%7C%7C%20state%20%26%26%20state.attributes%20%26%26%20state.attributes.image%20//%20SeaMonkey%0A%09%09%09%09%7C%7C%20state%20%26%26%20state.xultab%0A%09%09%09%09%09%26%26%20/%28%3F%3A%5E%7C%20%29image%3D%28%5CS+%29/.test%28state.xultab%29%0A%09%09%09%09%09%26%26%20decodeURI%28RegExp.%241%29%3B%20//%20Only%20Firefox%202.0%20%3F%0A%09%09%09if%28image%29%0A%09%09%09%09mi.setAttribute%28%22image%22%2C%20this.cachedIcon%28image%29%29%3B%0A%09%09%09if%28i%20%3D%3D%200%29%0A%09%09%09%09mi.setAttribute%28%22key%22%2C%20%22key_undoCloseTab%22%29%3B%0A%09%09%09undoPopup.appendChild%28mi%29%3B%0A%09%09%7D%2C%20this%29%3B%0A%09%7D%2C%0A%09getKey%3A%20function%28keys%2C%20i%29%20%7B%0A%09%09var%20key%20%3D%20keys%20%26%26%20keys.charAt%28i%20%25%20keys.length%29%3B%0A%09%09var%20keyPrefix%20%3D%20keys%20%26%26%20%28key%20+%20this.options.accesskeySeparator%29%3B%0A%09%09return%20%5Bkey%2C%20keyPrefix%5D%3B%0A%09%7D%2C%0A%09checkForMiddleClick%3A%20function%28e%2C%20upd%29%20%7B%0A%09%09var%20mi%20%3D%20e.target%3B%0A%09%09if%28%0A%09%09%09%22doCommand%22%20in%20mi%0A%09%09%09%26%26%20e.button%20%3D%3D%201%0A%09%09%09%26%26%20mi.parentNode%20%3D%3D%20e.currentTarget%0A%09%09%29%20%7B%0A%09%09%09mi.doCommand%28%29%3B%0A%09%09%09if%28upd%29%0A%09%09%09%09upd%28%29%3B%0A%09%09%09else%0A%09%09%09%09this.drawUndoList%28%29%3B%0A%09%09%7D%0A%09%7D%2C%0A%09crop%3A%20function%28s%2C%20crop%29%20%7B%0A%09%09if%28crop%20%3D%3D%20undefined%29%0A%09%09%09crop%20%3D%20500%3B%0A%09%09if%28s.length%20%3C%3D%20crop%29%0A%09%09%09return%20s%3B%0A%09%09var%20start%20%3D%20Math.round%28crop*0.6%29%3B%0A%09%09return%20s.substr%280%2C%20start%29%20+%20%22%u2026%22%20+%20s.substr%28start%20-%20crop%29%3B%0A%09%7D%2C%0A%09convertURI%3A%20function%28uri%2C%20crop%29%20%7B%0A%09%09if%28%21uri%20%7C%7C%20uri.indexOf%28%22%5Cn%22%29%20%21%3D%20-1%29%0A%09%09%09return%20uri%3B%0A%09%09uri%20%3D%20this.losslessDecodeURI%28uri%29%3B%0A%09%09return%20this.crop%28uri%2C%20crop%29%3B%0A%09%7D%2C%0A%09losslessDecodeURI%3A%20function%28uri%29%20%7B%0A%09%09if%28uri%29%20try%20%7B%0A%09%09%09return%20this._losslessDecodeURI%28uri%29%3B%0A%09%09%7D%0A%09%09catch%28e%29%20%7B%0A%09%09%09Components.utils.reportError%28e%29%3B%0A%09%09%7D%0A%09%09return%20uri%3B%0A%09%7D%2C%0A%09get%20_losslessDecodeURI%28%29%20%7B%0A%09%09var%20ldu%3B%0A%09%09if%28%22losslessDecodeURI%22%20in%20window%29%0A%09%09%09ldu%20%3D%20losslessDecodeURI%3B%0A%09%09else%20if%28%22UrlbarInput%22%20in%20window%29%20//%20Firefox%2075+%0A%09%09%09ldu%20%3D%20Components.utils.import%28%22resource%3A///modules/UrlbarInput.jsm%22%2C%20%7B%7D%29.losslessDecodeURI%3B%0A%09%09delete%20this._losslessDecodeURI%3B%0A%09%09return%20this._losslessDecodeURI%20%3D%20ldu%0A%09%09%09%3F%20function%28uri%29%20%7B%0A%09%09%09%09return%20ldu%28makeURI%28uri%29%29%3B%0A%09%09%09%7D%0A%09%09%09%3A%20decodeURI%3B%0A%09%7D%2C%0A%09cachedIcon%3A%20function%28src%29%20%7B%0A%09%09src%20%3D%20src.replace%28/%5B%26%23%5D-moz-resolution%3D%5Cd+%2C%5Cd+%24/%2C%20%22%22%29%3B%20//%20Firefox%2022+%0A%09%09if%28%0A%09%09%09%21/%5Ehttps%3F%3A/.test%28src%29%0A%09%09%09//%20IDN%2C%20see%20https%3A//bugzilla.mozilla.org/show_bug.cgi%3Fid%3D311045%0A%09%09%09%7C%7C%20/%5Ehttps%3F%3A%5C/%5C/%5B%5E.%3A%5C/%5D+%5C.%5B%5Ea-z0-9-%5D+%28%3F%3A%5C/%7C%24%29/.test%28src%29%0A%09%09%09%7C%7C%20this.appName%20%3D%3D%20%22SeaMonkey%22%20%26%26%20this.appVersion%20%3C%3D%202%0A%09%09%09%7C%7C%20this.appName%20%3D%3D%20%22Firefox%22%20%20%20%26%26%20this.appVersion%20%3C%3D%203.5%0A%09%09%29%0A%09%09%09return%20src%3B%0A%09%09return%20%22moz-anno%3Afavicon%3A%22%20+%20src%3B%20//%20https%3A//bugzilla.mozilla.org/show_bug.cgi%3Fid%3D467828%0A%09%7D%2C%0A%09updUI%3A%20function%28%29%20%7B%0A%09%09var%20tabsCount%20%3D%20this.closedTabCount%3B%0A%09%09var%20dis%20%3D%20%21tabsCount%20%26%26%20%21this.closedWindowCount%3B%0A%09%09if%28%0A%09%09%09dis%0A%09%09%09%26%26%20this.options.useMenu%0A%09%09%09%26%26%20this.options.menuTemplate.indexOf%28%22restoreLastSession%22%29%20%21%3D%20-1%0A%09%09%09%26%26%20%22restoreLastSession%22%20in%20this.ss%20%26%26%20this.ss.canRestoreLastSession%0A%09%09%29%0A%09%09%09dis%20%3D%20false%3B%0A%09%09this.button.disabled%20%3D%20dis%3B%0A%09%7D%2C%0A%09updTooltip%3A%20function%28tip%2C%20tn%29%20%7B%0A%09%09var%20template%2C%20header%2C%20title%2C%20url%2C%20closedAt%3B%0A%09%09if%28tn%20%3D%3D%20this.button%29%20%7B%0A%09%09%09template%20%3D%20this.options.buttonTipTemplate%3B%0A%09%09%09header%20%3D%20_localize%28%22restoreTab%22%29%3B%0A%09%09%09let%20undoTabItems%20%3D%20JSON.parse%28this.ss.getClosedTabData%28window%29%29%3B%0A%09%09%09if%28undoTabItems.length%29%20%7B%0A%09%09%09%09let%20lastItem%20%3D%20undoTabItems%5B0%5D%3B%0A%09%09%09%09title%20%3D%20lastItem.title%3B%0A%09%09%09%09url%20%3D%20lastItem.state%20%26%26%20lastItem.state.entries%0A%09%09%09%09%09%26%26%20lastItem.state.entries%5BlastItem.state.index%20-%201%5D.url%3B%0A%09%09%09%09closedAt%20%3D%20lastItem.closedAt%20%7C%7C%200%3B%0A%09%09%09%7D%0A%09%09%7D%0A%09%09else%20if%28tn.hasAttribute%28%22cb_index%22%29%29%20%7B%0A%09%09%09template%20%3D%20this.options.itemTipTemplate%3B%0A%09%09%09title%20%3D%20tn.getAttribute%28%22label%22%29%3B%0A%09%09%09url%20%3D%20tn.getAttribute%28%22cb_url%22%29%3B%0A%09%09%09closedAt%20%3D%20+tn.getAttribute%28%22cb_closedAt%22%29%3B%0A%09%09%7D%0A%09%09else%20%7B%0A%09%09%09return%20false%3B%0A%09%09%7D%0A%0A%09%09var%20tipData%20%3D%20this.getTooltipData%28template%2C%20header%2C%20title%2C%20url%2C%20closedAt%29%3B%0A%09%09tip.textContent%20%3D%20%22%22%3B%0A%09%09tip.appendChild%28tipData%29%3B%0A%09%09if%28closedAt%20%26%26%20template.indexOf%28%22closedAt%22%29%20%21%3D%20-1%29%20%7B%0A%09%09%09tip.initUpdateTimer%28function%28%29%20%7B%0A%09%09%09%09var%20tipData%20%3D%20this.getTooltipData%28template%2C%20header%2C%20title%2C%20url%2C%20closedAt%29%3B%0A%09%09%09%09if%28tipData.textContent%20%21%3D%20tip.textContent%29%20%7B%0A%09%09%09%09%09tip.textContent%20%3D%20%22%22%3B%0A%09%09%09%09%09tip.appendChild%28tipData%29%3B%0A%09%09%09%09%7D%0A%09%09%09%7D%2C%20this%29%3B%0A%09%09%7D%0A%09%09return%20tip.hasChildNodes%28%29%3B%0A%09%7D%2C%0A%09getTooltipData%3A%20function%28template%2C%20header%2C%20title%2C%20url%2C%20closedAt%29%20%7B%0A%09%09var%20df%20%3D%20document.createDocumentFragment%28%29%3B%0A%09%09var%20hasHeader%20%3D%20header%20%26%26%20template.indexOf%28%22header%22%29%20%21%3D%20-1%3B%0A%09%09function%20item%28key%2C%20val%29%20%7B%0A%09%09%09var%20lbl%20%3D%20document.createElementNS%28xulns%2C%20%22label%22%29%3B%0A%09%09%09lbl.className%20%3D%20%22cb-%22%20+%20key%20+%20%22%20tooltip-label%22%3B%0A%09%09%09lbl.textContent%20%3D%20val%3B%0A%09%09%09lbl.setAttribute%28%22maxwidth%22%2C%20%22450%22%29%3B%20//%20Trick%20to%20restore%20right%20border%20for%20long%20lines%0A%09%09%09if%28key%20%3D%3D%20%22closedAt%22%20%7C%7C%20hasHeader%20%26%26%20key%20%21%3D%20%22header%22%29%0A%09%09%09%09lbl.style.color%20%3D%20%22grayText%22%3B%0A%09%09%09return%20df.appendChild%28lbl%29%3B%0A%09%09%7D%0A%09%09template.forEach%28function%28key%29%20%7B%0A%09%09%09switch%28key%29%20%7B%0A%09%09%09%09case%20%22header%22%3A%0A%09%09%09%09%09if%28header%29%0A%09%09%09%09%09%09item%28key%2C%20header%29%3B%0A%09%09%09%09break%3B%0A%09%09%09%09case%20%22title%22%3A%0A%09%09%09%09%09if%28title%20%26%26%20title%20%21%3D%20url%29%0A%09%09%09%09%09%09item%28key%2C%20title%29%3B%0A%09%09%09%09break%3B%0A%09%09%09%09case%20%22url%22%3A%0A%09%09%09%09%09if%28url%29%0A%09%09%09%09%09%09item%28key%2C%20this.convertURI%28url%29%29%3B%0A%09%09%09%09break%3B%0A%09%09%09%09case%20%22closedAt%22%3A%0A%09%09%09%09%09if%28%21closedAt%29%0A%09%09%09%09%09%09break%3B%0A%09%09%09%09%09let%20dt%20%3D%20Math.round%28Math.max%280%2C%20Date.now%28%29%20-%20closedAt%29/1000%29%3B%0A%09%09%09%09%09let%20days%20%3D%20Math.floor%28dt/24/3600%29%3B%0A%09%09%09%09%09dt%20-%3D%20days*24*3600%3B%0A%09%09%09%09%09let%20d%20%3D%20new%20Date%28%28dt%20+%20new%20Date%28dt%29.getTimezoneOffset%28%29*60%29*1000%29%3B%0A%09%09%09%09%09let%20m%20%3D%20d.getMinutes%28%29%3B%0A%09%09%09%09%09let%20ts%20%3D%20d.getHours%28%29%20+%20%22%3A%22%20+%20%28m%20%3E%209%20%3F%20m%20%3A%20%220%22%20+%20m%29%3B%0A%09%09%09%09%09if%28days%29%0A%09%09%09%09%09%09ts%20%3D%20days%20+%20_localize%28%22day%22%29%20+%20%22%20%22%20+%20ts%3B%0A%09%09%09%09%09let%20tsTip%20%3D%20_localize%28%22itemTip%22%29%0A%09%09%09%09%09%09.replace%28%22%25ago%22%2C%20ts%29%0A%09%09%09%09%09%09.replace%28%22%25date%22%2C%20new%20Date%28closedAt%29.toLocaleString%28%29%29%3B%0A%09%09%09%09%09item%28key%2C%20tsTip%29%3B%0A%09%09%09%7D%0A%09%09%7D%2C%20this%29%3B%0A%09%09return%20df%3B%0A%09%7D%2C%0A%09get%20wm%28%29%20%7B%0A%09%09delete%20this.wm%3B%0A%09%09return%20this.wm%20%3D%20Components.classes%5B%22@mozilla.org/appshell/window-mediator%3B1%22%5D%0A%09%09%09.getService%28Components.interfaces.nsIWindowMediator%29%3B%0A%09%7D%2C%0A%09updUIGlobal%3A%20function%28%29%20%7B%0A%09%09var%20isSeaMonkey%20%3D%20this.appName%20%3D%3D%20%22SeaMonkey%22%3B%0A%09%09var%20ws%20%3D%20this.wm.getEnumerator%28isSeaMonkey%20%3F%20null%20%3A%20%22navigator%3Abrowser%22%29%3B%0A%09%09const%20id%20%3D%20this.button.id%3B%0A%09%09while%28ws.hasMoreElements%28%29%29%20%7B%0A%09%09%09let%20win%20%3D%20ws.getNext%28%29%3B%0A%09%09%09if%28isSeaMonkey%20%26%26%20%21this.isBrowserWindow%28win%29%29%0A%09%09%09%09continue%3B%0A%09%09%09let%20btn%20%3D%20win.document.getElementById%28id%29%3B%0A%09%09%09if%28btn%20%26%26%20%22undoCloseTabsList%22%20in%20btn%29%20%7B%0A%09%09%09%09let%20ucl%20%3D%20btn.undoCloseTabsList%3B%0A%09%09%09%09ucl.ensureSessionsInitialized%28ucl.updUI%2C%20ucl%29%3B%0A%09%09%09%7D%0A%09%09%7D%0A%09%7D%2C%0A%09isBrowserWindow%3A%20function%28win%29%20%7B%0A%09%09var%20loc%20%3D%20window.location.href%3B%0A%09%09return%20loc%20%3D%3D%20%22chrome%3A//browser/content/browser.xul%22%0A%09%09%09%7C%7C%20loc%20%3D%3D%20%22chrome%3A//navigator/content/navigator.xul%22%3B%0A%09%7D%2C%0A%09ensureSessionsInitialized%3A%20function%28callback%2C%20context%29%20%7B%0A%09%09var%20_this%20%3D%20this%3B%0A%09%09var%20stopTime%20%3D%20Date.now%28%29%20+%203e3%3B%0A%09%09%28function%20ensureInitialized%28%29%20%7B%0A%09%09%09try%20%7B%0A%09%09%09%09_this.ss.getClosedTabCount%28window%29%3B%0A%09%09%09%09callback.call%28context%29%3B%0A%09%09%09%09return%3B%0A%09%09%09%7D%0A%09%09%09catch%28e%29%20%7B%0A%09%09%09%09if%28Date.now%28%29%20%3E%20stopTime%29%20%7B%0A%09%09%09%09%09Components.utils.reportError%28%0A%09%09%09%09%09%09_this.errPrefix%0A%09%09%09%09%09%09+%20%22Can%27t%20initialize%3A%20nsISessionStore.getClosedTabCount%28%29%20failed%22%0A%09%09%09%09%09%29%3B%0A%09%09%09%09%09Components.utils.reportError%28e%29%3B%0A%09%09%09%09%09return%3B%0A%09%09%09%09%7D%0A%09%09%09%7D%0A%09%09%09setTimeout%28ensureInitialized%2C%2050%29%3B%0A%09%09%7D%29%28%29%3B%0A%09%7D%0A%7D%3B%0A%0Aif%28%21this.undoCloseTabsList.options.useMenu%20%26%26%20this.undoCloseTabsList.useCentextMenu%29%20%7B%0A%09this.oncontextmenu%20%3D%20function%28e%29%20%7B%0A%09%09if%28%0A%09%09%09e.target%20%21%3D%20this%0A%09%09%09%7C%7C%20e.ctrlKey%20%7C%7C%20e.shiftKey%20%7C%7C%20e.altKey%20%7C%7C%20e.metaKey%0A%09%09%09%7C%7C%20%21this.undoCloseTabsList.mp.hasChildNodes%28%29%0A%09%09%29%0A%09%09%09return%3B%0A%09%09e.preventDefault%28%29%3B%0A%09%09this.undoCloseTabsList.showMenu%28e%29%3B%20//%20Show%20menu%20without%20%22context%22%20flag%0A%09%7D%3B%0A%7D%0Aif%28this.undoCloseTabsList.options.rightClickToUndoCloseTab%29%20%7B%0A%09this.oncontextmenu%20%3D%20function%28e%29%20%7B%0A%09%09if%28e.target%20%3D%3D%20this%20%26%26%20%21e.ctrlKey%20%26%26%20%21e.shiftKey%20%26%26%20%21e.altKey%20%26%26%20%21e.metaKey%29%0A%09%09%09e.preventDefault%28%29%3B%0A%09%7D%3B%0A%7D%0A%0Athis.disabled%20%3D%20true%3B%0AsetTimeout%28function%28_this%29%20%7B%0A%09_this.undoCloseTabsList.init%28%29%3B%0A%7D%2C%200%2C%20this%29%3B%0A%0A//%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%0A//%20Styles%0A//%20Used%20icons%20from%20Undo%20Closed%20Tabs%20Button%20extension%0A%0A//%20Styles%20can%27t%20override%20hardcoded%20icon%0Aif%28%20//%20Remove%20icon%20only%20if%20nsIStyleSheetService%20works%20on-the-fly%20%28Firefox%203.0+%29%0A%09%21Components.ID%28%22%7B41d979dc-ea03-4235-86ff-1e3c090c5630%7D%22%29%0A%09%09.equals%28Components.interfaces.nsIStyleSheetService%29%0A%29%20%7B%0A%09let%20icon%20%3D%20this.icon%0A%09%09%7C%7C%20this.ownerDocument.getAnonymousElementByAttribute%28this%2C%20%22class%22%2C%20%22toolbarbutton-icon%22%29%3B%0A%09if%28icon%29%0A%09%09icon.src%20%3D%20%22%22%3B%0A%09else%0A%09%09this.image%20%3D%20%22%22%3B%0A%7D%0A%0Avar%20cssStr%20%3D%20%27%5C%0A%09@namespace%20url%28%22http%3A//www.mozilla.org/keymaster/gatekeeper/there.is.only.xul%22%29%3B%5Cn%5C%0A%09@-moz-document%20url%28%22%25windowURL%25%22%29%20%7B%5Cn%5C%0A%09%09%25button%25%20%7B%5Cn%5C%0A%09%09%09list-style-image%3A%20url%28%22data%3Aimage/png%3Bbase64%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%22%29%20%21important%3B%5Cn%5C%0A%09%09%09-moz-image-region%3A%20rect%280%2C%2024px%2C%2024px%2C%200%29%20%21important%3B%5Cn%5C%0A%09%09%7D%5Cn%5C%0A%09%09%25button%25%3Ahover%20%7B%5Cn%5C%0A%09%09%09-moz-image-region%3A%20rect%280%2C%2048px%2C%2024px%2C%2024px%29%20%21important%3B%5Cn%5C%0A%09%09%7D%5Cn%5C%0A%09%09%25button%25%5Bdisabled%3D%22true%22%5D%20%7B%5Cn%5C%0A%09%09%09-moz-image-region%3A%20rect%280%2C%2072px%2C%2024px%2C%2048px%29%20%21important%3B%5Cn%5C%0A%09%09%7D%5Cn%5C%0A%09%09toolbar%5Biconsize%3D%22small%22%5D%20%25button%25%20%7B%5Cn%5C%0A%09%09%09-moz-image-region%3A%20rect%2824px%2C%2016px%2C%2040px%2C%200%29%20%21important%3B%5Cn%5C%0A%09%09%7D%5Cn%5C%0A%09%09toolbar%5Biconsize%3D%22small%22%5D%20%25button%25%3Ahover%20%7B%5Cn%5C%0A%09%09%09-moz-image-region%3A%20rect%2824px%2C%2032px%2C%2040px%2C%2016px%29%20%21important%3B%5Cn%5C%0A%09%09%7D%5Cn%5C%0A%09%09toolbar%5Biconsize%3D%22small%22%5D%20%25button%25%5Bdisabled%3D%22true%22%5D%20%7B%5Cn%5C%0A%09%09%09-moz-image-region%3A%20rect%2824px%2C%2048px%2C%2040px%2C%2032px%29%20%21important%3B%5Cn%5C%0A%09%09%7D%5Cn%5C%0A%09%7D%27%0A%09.replace%28/%25windowURL%25/g%2C%20window.location.href%29%0A%09.replace%28/%25button%25/g%2C%20%22%23%22%20+%20this.id%29%3B%0Avar%20cssURI%20%3D%20this.cssURI%20%3D%20Components.classes%5B%22@mozilla.org/network/io-service%3B1%22%5D%0A%09.getService%28Components.interfaces.nsIIOService%29%0A%09.newURI%28%22data%3Atext/css%2C%22%20+%20encodeURIComponent%28cssStr%29%2C%20null%2C%20null%29%3B%0Avar%20sss%20%3D%20this.sss%20%3D%20Components.classes%5B%22@mozilla.org/content/style-sheet-service%3B1%22%5D%0A%09.getService%28Components.interfaces.nsIStyleSheetService%29%3B%0Aif%28%21sss.sheetRegistered%28cssURI%2C%20sss.USER_SHEET%29%29%0A%09sss.loadAndRegisterSheet%28cssURI%2C%20sss.USER_SHEET%29%3B%0A%0A%0Athis.onDestroy%20%3D%20function%28reason%29%20%7B%0A%09this.undoCloseTabsList.destroy%28%29%3B%0A%09if%28reason%20%3D%3D%20%22destructor%22%29%20//%20May%20happens%20before%20%22unload%22%0A%09%09this.undoCloseTabsList.updUIGlobal%28%29%3B%0A%09if%28reason%20%3D%3D%20%22update%22%20%7C%7C%20reason%20%3D%3D%20%22delete%22%29%20%7B%0A%09%09let%20sss%20%3D%20this.sss%3B%0A%09%09let%20cssURI%20%3D%20this.cssURI%3B%0A%09%09if%28sss.sheetRegistered%28cssURI%2C%20sss.USER_SHEET%29%29%0A%09%09%09sss.unregisterSheet%28cssURI%2C%20sss.USER_SHEET%29%3B%0A%09%7D%0A%7D%3B%0Aif%28this.undoCloseTabsList.options.useMenu%29%20%7B%0A%09this.type%20%3D%20%22menu%22%3B%0A%09this.orient%20%3D%20%22horizontal%22%3B%0A%7D%5D%5D%3E%3C/initcode%3E%0A%20%20%3Ccode%3E%3C%21%5BCDATA%5Bif%28%21event.target%29%20//%20Button%27s%20hotkey%20pressed%0A%09this.undoCloseTabsList.drawUndoList%28%29%20%26%26%20this.undoCloseTabsList.openMenu%28%29%3B%5D%5D%3E%3C/code%3E%0A%20%20%3Caccelkey%3E%3C%21%5BCDATA%5B%5D%5D%3E%3C/accelkey%3E%0A%20%20%3Chelp%3E%3C%21%5BCDATA%5B%5D%5D%3E%3C/help%3E%0A%20%20%3Cattributes/%3E%0A%3C/custombutton%3E
|
Infocatcher > 04-09-2012 22:54:40 |
Тестовая версия, будьте осторожны! |
Infocatcher > 23-01-2013 21:07:19 |
Undo Close Tabs 0.3.0 (2013-01-23) |
bunda1 > 08-04-2013 20:42:35 |
Пожалуйста добавь настройку которая скрывает список закрытых окон или отключает сохранение такого списка. |
Infocatcher > 08-04-2013 20:48:38 |
bunda1 пишет
Если я ничего не сломал , из массива menuTemplate можно убрать лишнее: Выделить код Код:var options = { menuTemplate: [ "closedWindows", "separator", "restoreClosedWindows", "clearClosedWindows", "separator", "closedTabs", "separator", "restoreClosedTabs", "clearClosedTabs", "separator", "clearAll", "separator", "restoreLastSession", "separator", "buttonMenu" ], bunda1 пишет
Это встроенная настройка browser.sessionstore.max_windows_undo. |
bunda1 > 08-04-2013 21:17:22 |
Спасибо , кстати остроумная настройка для кнопки эта menuTemplate |
bunda1 > 04-08-2013 16:45:34 |
Если отменить закрытие вкладки и потом опять её закрыть то браузер переключится на ту группу вкладок из которой была вкладка. Можно это починить ? |
Infocatcher > 04-08-2013 20:06:45 |
bunda1 пишет
Не воспроизводится. |
bunda1 > 04-08-2013 20:37:53 |
Infocatcher пишет
Нужно что бы группа вкладок из которой была вкладка была открыта. |
Infocatcher > 05-08-2013 21:04:27 |
bunda1 пишет
bunda1 пишет
Что-то я запутался. Если группа вкладок, из которой была закрыта вкладка, в данный момент открыта, то куда при этом переключится браузер? На всякий случай уточню: группы вкладок – в панораме (Ctrl+Shift+E)? Вот я делаю две группы вкладок. Воспроизводится ли на новом профиле? И какая версия браузера. |
bunda1 > 05-08-2013 21:21:17 |
Infocatcher Выделить код Код:// Переключаться на левую вкладку после закрытии текущей вкладки ................................ function tabCloseHandler(e) { var tab = e.target; if ( tab == gBrowser.mCurrentTab ) { gBrowser.visibleTabs.length ? gBrowser.mTabContainer.selectedIndex-- : gBrowser.addTab("about:blank") ; } } addEventListener("TabClose", tabCloseHandler, true, gBrowser.tabContainer ); |
Infocatcher > 05-08-2013 21:35:59 |
bunda1 Выделить код Код:if(tab == gBrowser.mCurrentTab) { if(!gBrowser.visibleTabs.length) gBrowser.addTab("about:blank"); else { var tabs = gBrowser.tabs; for(var i = gBrowser.mTabContainer.selectedIndex; i >= 0; --i) { var tab = tabs[i]; if(!tab.hidden) { gBrowser.selectedTab = tab; break; } } } } Ну, и если видимую вкладку слева не нашло, можно поискать вправо. |
bunda1 > 05-08-2013 21:45:33 |
Infocatcher |
bunda1 > 05-08-2013 22:34:44 |
Вот так вроде нормально работает: Выделить код Код:// Переключаться на левую вкладку после закрытии текущей вкладки ................................ function tabCloseHandler(e) { var tab = e.target; if ( tab == gBrowser.mCurrentTab ) { if ( !gBrowser.visibleTabs.length ) gBrowser.addTab("about:blank"); else if ( !tab.hasAttribute('first-visible-tab') ) { gBrowser.mTabContainer.advanceSelectedTab(-1,true) }; } } addEventListener("TabClose", tabCloseHandler, true, gBrowser.tabContainer ); |
Northtech > 10-10-2013 16:49:34 |
А можете сделать отдельно кнопку повторяющую функционал этого расширения с добавлением очистки списка закрытых окон (практически тоже самое, только это меню во вкладке) или добавить соответствующую настройку в нынешнюю кнопку? |
Infocatcher > 11-10-2013 13:10:09 |
Northtech Отдельную кнопку делать лень – потом синхронизировать сложно. |
Northtech > 11-10-2013 17:52:35 |
Так я и написал в этой теме, просто конкретно не обращался, прошу пардону. А за настройку (как впрочем и кнопку) большое спасибо, это то, что нужно было. |
Infocatcher > 20-10-2013 23:26:26 |
Undo Close Tabs 0.3.1 (2013-10-17) |
bunda1 > 09-11-2013 17:40:08 |
Иногда при старте браузера кнопка Undo Close Tabs 0.3.1 (или 0.3.0) на FF25 показывает в консоли ошибок:
после появления этой ошибки также не работают некоторые мои кнопки. Лечится всё это рестартом. |
Infocatcher > 10-11-2013 00:22:17 |
bunda1 Если добавить сразу в инициализацию Выделить код Код:Components.classes["@mozilla.org/browser/sessionstore;1"] .getService(Components.interfaces.nsISessionStore) .getClosedTabCount(window); , то воспроизводится всегда. А если после появления ошибки открыть редактирование кнопки и (ничего не меняя) нажать OK, то будет работать? |
bunda1 > 10-11-2013 00:34:20 |
Infocatcher пишет
Добавил в инициализацию, ошибка воспроизводится всегда и если после появления ошибки открыть редактирование кнопки и (ничего не меняя) нажать OK начинает работать. Всё так. 10-11-2013 00:37:59 Выделить код Код:Components.classes["@mozilla.org/browser/sessionstore;1"] .getService(Components.interfaces.nsISessionStore) .getClosedTabCount(window); то не помогает, ошибка происходит после каждого старта. |
Infocatcher > 10-11-2013 01:18:12 |
bunda1 |
bunda1 > 10-11-2013 01:26:28 |
Спасибо и за это |
vitalek > 24-11-2013 14:54:41 |
Подскажите как поменять местами функции левой и правой кнопок мышки? |
Infocatcher > 24-11-2013 19:34:42 |
vitalek пишет
Чтобы клик левой кнопкой по кнопке открывал меню? А в разрабатываемую версию добавлена настройка rightClickToUndoCloseTab. |
vitalek > 24-11-2013 20:11:18 |
Infocatcher пишет
Благодарю, то что надо. |
xrun1 > 13-12-2013 11:19:17 |
Конфигурация: Mozilla Firefox 26.0, Custom Buttons 0.0.5.7, Tab Mix Plus 0.4.1.2.02 |
Infocatcher > 15-12-2013 18:26:11 |
xrun1 пишет
У меня так и работает... |
lokiju > 18-12-2013 00:34:55 |
На после перезапуска исчезает контекстное меню(Undo Close Tabs) вкладок. То есть востанавливается "родной" пункт меню "Восстановить закрытую вкладку". Временное лечение: Меню кнопки - Редактировать - Ок. До следующего перезапуска. |
Infocatcher > 18-12-2013 09:52:07 |
lokiju пишет
Где находится кнопка? В новом настраиваемом меню? Там кнопки инициализируются при первом открытии меню. В качестве временного решения можно добавить вот такое в инициализацию какой-нибудь другой кнопки: Выделить код Код:var openedKey = "_cbPanelUIOpened"; if(openedKey in window) return; window[openedKey] = true; var menuBtn = document.getElementById("PanelUI-menu-button"); var menuPanel = document.getElementById("PanelUI-popup"); menuPanel.collapsed = true; menuPanel.addEventListener("popupshown", function hideMenu(e) { menuPanel.removeEventListener(e.type, hideMenu, false); menuBtn.click(); // Hides menu setTimeout(function() { menuPanel.collapsed = false; }, 0); }, false); menuBtn.click(); // Opens menu |
lokiju > 18-12-2013 18:25:06 |
Infocatcher пишет
На id="toolbar-menubar" toolbarname="Панель меню" Infocatcher пишет
Не помогает |
Infocatcher > 18-12-2013 19:50:16 |
lokiju пишет
Странно, там у меня работает нормально. на Выделить код Код:LOG("[UCT] init"); this.onDestroy = function(reason) { LOG("[UCT] onDestroy(" + reason + ")"); , какие будут сообщения в консоли ошибок? lokiju пишет
Да, это только для кнопки-меню. |
lokiju > 18-12-2013 20:21:26 |
После замены пункт появился в 2х экземплярах. Консоль: |
Infocatcher > 18-12-2013 20:55:09 |
lokiju пишет
По идее, это должно быть исправлено в разрабатываемой версии. lokiju пишет
Это, возможно, тоже исправлено, если ошибка где-нибудь в |
lokiju > 18-12-2013 21:19:44 |
Infocatcher пишет
Заменил undoCloseTabs.js. Всё работает как надо. Спасибо. |
Northtech > 22-12-2013 13:48:20 |
Функция showInTabContextMenu не работает в firefox 27. |
Infocatcher > 22-12-2013 15:43:49 |
Northtech пишет
Видимо, тоже следует использовать разрабатываемую версию. У меня, правда, перестало воспроизводиться вообще. |
Northtech > 22-12-2013 19:34:20 |
Заработало, спасибо. |
Infocatcher > 23-12-2013 01:07:09 |
Undo Close Tabs 0.3.2 (2013-12-23) |
Inko7 > 13-01-2014 12:15:28 |
Infocatcher |
Infocatcher > 13-01-2014 15:27:11 |
Inko7 пишет
Можно доработать dontRememberClosedNewTabs.js примерно вот так: скрытый текст Выделить код Код:addEventListener("TabClose", function(e) { function isNewTabURL(url) { // See chrome://browser/content/utilityOverlay.js return url == window.BROWSER_NEW_TAB_URL || url.startsWith("about:"); } var tab = e.target; var browser = tab.linkedBrowser; if(!isNewTabURL(browser.currentURI.spec)) return; //var sh = browser.sessionHistory; //if(!(sh instanceof Components.interfaces.nsISHistory) || sh.count > 1) // return; //LOG("Try forget about closed tab"); var ss = ( Components.classes["@mozilla.org/browser/sessionstore;1"] || Components.classes["@mozilla.org/suite/sessionstore;1"] ).getService(Components.interfaces.nsISessionStore); var closedTabs = JSON.parse(ss.getClosedTabData(window)); for(var i = 0, l = closedTabs.length; i < l; ++i) { var closedTab = closedTabs[i]; if( closedTab.state.entries.every(function(entry) { return isNewTabURL(entry.url); }) ) { ss.forgetClosedTab(window, i); //LOG("Forget about closed tab #" + i); break; } } }, false); (добавить в инициализацию любой кнопки) |
Inko7 > 13-01-2014 16:23:21 |
Infocatcher |
difabor > 14-01-2014 02:05:13 |
Не знаю, насколько это имеет отношение к Undo Close Tabs, но к Табам - это точно имеет отношение и имхо - важно. |
difabor > 14-01-2014 02:59:48 |
okkamas_knife пишет Спасибо, но бар таб - не совсем то... |
SendInfo > 14-01-2014 03:14:34 |
difabor, |
difabor > 14-01-2014 03:54:42 |
SendInfo пишет
Спасибо, но этот код просто закрывает вкладку, если её хотят открыть, когда 10 уже открыто... А я имел в виду, что такие УРЛ ставятся в очередь и "подкачиваются" с закрытием очередной вкладки. Кроме того нет ограничителя на одновременно открываемые вкладки (т.е. он тоже 10 ). |
Pony_Smile_Pack > 14-01-2014 05:34:21 |
difabor пишет
|
difabor > 14-01-2014 12:20:34 |
Pony_Smile_Pack, спасибо, но он - несовместим. |
bunda1 > 14-01-2014 19:36:05 |
difabor пишет
Ну думаю такое можно просто сделать, но обсуждать это надо в Custom Buttons | Форум Mozilla Россия |
difabor > 14-01-2014 22:12:56 |
bunda1 пишет
Спасибо, я написал там - 8207 |
Vladimir_S > 28-04-2014 11:39:50 |
Вот сейчас только что обнаружил: отвалилась кнопка на Fx 29.0 RC1. Дома на Авроре проверю. Исправьте, пожалуйста. P.S. Так, пока - отбой. После перезапуска браузера заработала. Понаблюдаю. |
Infocatcher > 28-04-2014 13:35:34 |
Vladimir_S пишет
У меня, вроде бы, тоже работает – проверил на 29.0 RC1 и 31.0a1 (2014-04-27). |
feas > 28-04-2014 17:37:33 |
Vladimir_S пишет
разок тоже глюканула, правда как я выяснил глюканула вся инициализация |
villa7 > 24-08-2014 22:21:47 |
Только у меня в 32 вкладки из выпадающего списка открывает не те на которые нажимаешь, жмешь одно, открывает другое? |
Infocatcher > 25-08-2014 01:25:31 |
villa7 пишет
У меня нормально. Видимо, какое-то расширение успевает изменить список вкладок пока открыто меню. |
villa7 > 25-08-2014 01:37:00 |
Infocatcher |
Infocatcher > 12-10-2014 22:43:03 |
Undo Close Tabs 0.3.3 (2014-10-12) |
ifln > 14-10-2014 15:11:01 |
Спасибо за кнопку! |
Infocatcher > 14-10-2014 15:33:21 |
ifln пишет
Есть две встроенные настройки: browser.sessionstore.max_tabs_undo и browser.sessionstore.max_windows_undo. |
ifln > 14-10-2014 17:04:15 |
Infocatcher, от души спасибо. |
Александр Колесников > 22-01-2015 16:03:26 |
Infocatcher, спасибо за кнопочку! Возможно ли использование хоткея - по Опере Ctrl-Z пальцы запомнили :-) ? Чтобы нажатие хоткея было равносильно клику ЛКМ по кнопке. P.S. Стандартная возможность назначить хоткей кнопке не работает - просто ничего не происходит. Даже с отмеченным пунктом "Запретить стандартное действие...". Пробую именно Ctrl+Z . Да и вообще никакие хоткеи не цепляются... |
Infocatcher > 22-01-2015 16:51:50 |
Александр Колесников А для восстановления вкладки надо в секцию «код» вписать вот такое: |
Александр Колесников > 23-01-2015 02:02:51 |
Спасибо, теперь всё, как и хотелось! 23-01-2015 02:05:17 Infocatcher пишет
P.S. Может, эту инфу в шапку поднять? Имхо, удобно... |
Infocatcher > 23-01-2015 09:47:13 |
Александр Колесников |
Александр Колесников > 03-02-2015 00:42:38 |
Скрипт закрывает закреплённую вкладку http://www.trackitonline.ru/?do=list&pg=1 , где я отслеживаю посылки с eBay... |
Infocatcher > 03-02-2015 09:55:04 |
Александр Колесников |
Александр Колесников > 04-02-2015 12:16:47 |
Infocatcher I`m sorry.. Не туда написал почему-то... Ну раз уж здесь начал и это по поводу Вашего расширения, то ... вот что происходит: скрытый текст --------------------- Имя: Firefox Сообщения о падениях за последние 3 дня Все сообщения о падениях (включая 1 ожидающее отправки сообщение в заданном диапазоне времени) Расширения Имя: Генератор безопасных паролей Имя: Скрыть Элемент Помощника для Adblock Plus Имя: about:addons-memory Имя: Adblock Plus Имя: Advanced Locationbar Имя: anonymoX Имя: Close Download Tabs Имя: Custom Buttons Имя: Fast Dial Имя: FindBar Tweak Имя: FireGestures Имя: Flashblock Имя: Google™ Translator Имя: Imagus Имя: Keylogger Beater Имя: Link Properties Plus Имя: Make Link Имя: Mozilla Archive Format Имя: Print Edit Имя: ProfileSwitcher Имя: Restartless Restart Имя: SaveFrom.net помощник Имя: Search Site Имя: Secure Login Имя: TextMarker Go Имя: TryAgain Имя: Update Scanner Имя: Avast Online Security Имя: YesScript Графика Аппаратно ускоренные окна: 3/3 Direct3D 11 (OMTC) Важные изменённые настройки accessibility.typeaheadfind: true Важные заблокированные настройки JavaScript Инкрементальный GC: true Поддержка доступности Активирована: false Версии библиотек NSPR NSS NSSSMIME NSSSSL NSSUTIL Экспериментальные возможности Ну и с десяток кнопок CB... это те, что, имхо, могут каким-то боком иметь воздействие: скрытый текст //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // https://github.com/Infocatcher/Custom_Buttons/blob/master/code_snippets/mergeInitialization.js // Example for safely use only one button for initialization of many "buttons" without UI (Для любителей засовывать кучу разных кодов в инициализацию одной кнопки). //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// var _destructors = []; function destructor() { var args = arguments; _destructors.forEach(function(destructor) { try { destructor.apply(this, args); } catch(e) { Components.utils.reportError(e); } }, this); } if("defineProperty" in Object) { // Firefox 4+ Object.defineProperty(this, "onDestroy", { get: function() { return _destructors.length ? destructor : undefined; }, set: function(f) { _destructors.push(f); }, enumerable: true, configurable: true }); } else { this.__defineGetter__("onDestroy", function() { return _destructors.length ? destructor : undefined; }); this.__defineSetter__("onDestroy", function(f) { _destructors.push(f); }); } //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// var node = document.getElementById("duplicateTab"); //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // Открывать библиотеку во вкладке и последнюю активную папку библиотеки, от 05.11.2014. ............................ if ( !/showPlacesOrganizer|DownloadsUI|DownloadsPanel/.test( command ) ) return; // получить нужную папку // закрыть меню большой кнопки и кнопки загрузок //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// var longMiddleClick = false, mousedownTime = 0; //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// (function() { const reloadButtonIcon = "data:image/x-icon;base64,AAABAAEADAwAAAEAIACYAgAAFgAAACgAAAAMAAAAGAAAAAEAIAAAAAAAcAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEBAgIAAQECAAAAAAAAAAAAAAAAAAAAAAABAQIAAQICAAAAAAAAAAAAAAAAAAEBAQAAAAAEBggGDydSUhM6g40SOYONCyNRUgEDCAYAAAAAAAEBAQAAAAAAAQICAAAAAA4XIR4nXLvNJGnx/yNq9/0jaff9I2jx/x1Suc0FDh4eAAAAAAABAQIAAAAACAoGBDNluMopaOn/LWnf/jJnw90zacTdLmvf/Stq6v8jU7PJAQIEAwAAAAAAAAAAJDpVVTV27f8ta+H/Jkh9hAgJBAEGCAQAK09+gzJw4/8vb+v/ESdPVAAAAAAAAAAANFmJjDR7/P8tZcncBQcKCAAAAAAAAAAACQwLBzhyzNwyefv/HUKFjAAAAAAAAAAAOV+LjDyI//8wbc3bAgUJBgEBAAAAAAABCAsKBjx5z9s6hf//IkqIjAAAAAAAAAAAMEhcVk6c//8+ivH/J1GHigMEBAIBAAAALlV/f0SP8/9Flf//HDhZVgAAAAAAAAAACgoIBVqXzcpPqP//QHq5wBYgJR0/d7C0TJ/8/06j//9GiMzNBAYIBQAAAAABAQICAAAAABggIx5mqt/iOWiNiyAvNjBpv///Xbj//1KWz9ESHSUhAAAAAAEBAgIAAAAAAQEBAQAAAAAJCwoHOllqZRYgJR0mO0VANVVnZAcJCAYAAAAAAQEBAQAAAAAAAAAAAAAAAAECAgIBAQECAAAAAAEBAgEAAAEBAAAAAAABAQIBAQICAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA="; const tabContextMenu = document.getElementById("tabContextMenu"); function createNode(nodeName, attrs) { setTimeout(function() { n.button = createNode("toolbarbutton", { n.parent.removeChild(n.throbber) n.parent.removeChild(n.clonedLabel); n.parent.removeChild(n.button); Cc["@mozilla.org/browser/sessionstore;1"] setTimeout(function() { ].forEach(function(args) { addEventListener.apply(this, args) }); //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// function dragAndGo(e) { switch ( e.type ) { case "dragover": case "drop": { e.preventDefault(); // получить направление перетаскивания, L налево, R направо, U верх, D вниз // Ссылки .... if ( direction == "U" ) { if ( direction == "U" ) { // Подсказка кнопки ............................................................................ P.S. Вот сейчас заметил - после аварийной перезагрузки браузера вкладка "самоудалилась"... |
Infocatcher > 05-02-2015 14:31:39 |
Александр Колесников |
tom911 > 24-12-2015 00:53:24 |
Подскажите как поменять иконку кнопки, подставляю свою в "изображение" редактирование кнопки, и ничего не меняется! |
Infocatcher > 24-12-2015 01:27:02 |
tom911 пишет
Надо отредактировать вот эту строку в коде: Там по три варианта иконок для обычных и больших значков. |
tom911 > 24-12-2015 15:07:50 |
Infocatcher пишет
Может подскажите как переместить кнопку в url |
Infocatcher > 24-12-2015 15:17:44 |
tom911 пишет
В смысле кнопку? Выделить код Код:data:image/png;base64,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 Сохранить, отредактировать, потом в редакторе кнопки сконвертировать в base64 и вставить вместо оригинальной ссылки. |
emlen > 20-02-2016 01:51:33 |
Было бы круто в виде выпадающих меню по закрытым вкладкам меню со списком их истории, чобы не надо было восстанавливать всю сессию таба, если нужна только одна страничка предыдущая той на которой таб закрыл, к примеру.. |
Infocatcher > 25-02-2016 14:35:45 |
emlen пишет
Не знаю, больше никто такого не просил никогда. |
xrun1 > 14-12-2016 14:55:38 |
Заметил сейчас, 50-й. СКМ по кнопке очищает историю закрытых вкладок, но после перезапуска они снова появляются в списке/истории. Если очищать через меню ПКМ --> Очистить историю закрытых вкладок, то после перезапуска в истории чисто. Это только у меня так? |
Infocatcher > 14-12-2016 21:35:06 |
xrun1 пишет
Мне кажется, это все от нового и особо наоптимизированного механизма сохранения сессий – там отложенная запись, можно успеть перезапуститься до того, как пройдет сохранение. Код вызывается один и тот же... чистит историю одинаково, но, видимо, пока меню закрывается, проходит чуть больше времени. |
xrun1 > 15-12-2016 00:38:55 |
Infocatcher скрытый текст |
Stkvsky > 25-02-2018 12:24:39 |
Infocatcher пишет
Что то не получается вставить другую иконку, подставляю этот код но ничего не меняется, подскажите пожалуйста Выделить код Код:data:image/svg+xml;utf8;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iaXNvLTg4NTktMSI/Pgo8IS0tIEdlbmVyYXRvcjogQWRvYmUgSWxsdXN0cmF0b3IgMTYuMC4wLCBTVkcgRXhwb3J0IFBsdWctSW4gLiBTVkcgVmVyc2lvbjogNi4wMCBCdWlsZCAwKSAgLS0+CjwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+CjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiBpZD0iQ2FwYV8xIiB4PSIwcHgiIHk9IjBweCIgd2lkdGg9IjE2cHgiIGhlaWdodD0iMTZweCIgdmlld0JveD0iMCAwIDMwNiAzMDYiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDMwNiAzMDY7IiB4bWw6c3BhY2U9InByZXNlcnZlIj4KPGc+Cgk8ZyBpZD0iY2hldnJvbi1sZWZ0Ij4KCQk8cG9seWdvbiBwb2ludHM9IjI0Ny4zNSwzNS43IDIxMS42NSwwIDU4LjY1LDE1MyAyMTEuNjUsMzA2IDI0Ny4zNSwyNzAuMyAxMzAuMDUsMTUzICAgIiBmaWxsPSIjMDAwMDAwIi8+Cgk8L2c+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPC9zdmc+Cg== |
SendInfo > 26-02-2018 00:12:36 |
Stkvsky пишет
Возьми картинку в png, jpg не svg |
Stkvsky > 26-02-2018 00:41:12 |
Вставил эту, не поменялась Выделить код Код:data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAQAAAC1+jfqAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAAmJLR0QAAKqNIzIAAAAJcEhZcwAADdcAAA3XAUIom3gAAAAHdElNRQfiAhkWIDaCHDWlAAAAnUlEQVQoz42RPQrCQBBGH1gKosTCwkMoljmHlQdIkyI3sE4K8TyCpVhZxjKKCElaK7vPwixhN65kppv3GOYHesea3A8HpAj5cMAB+YUFtwa3+eLEluFXuHewyScrgOVfZQYw5ejMEBBRI0Rqtth1howQ4toWNhSWMEeIyn+bGCEuv+GIhBIh9jZw96kZ24KNH4Rua9PhzZmMSa8nfwCt/V657HyxNgAAACV0RVh0ZGF0ZTpjcmVhdGUAMjAxOC0wMi0yNVQyMjozMjo1NCswMTowMAHduCcAAAAldEVYdGRhdGU6bW9kaWZ5ADIwMTgtMDItMjVUMjI6MzI6NTQrMDE6MDBwgACbAAAAGXRFWHRTb2Z0d2FyZQB3d3cuaW5rc2NhcGUub3Jnm+48GgAAAABJRU5ErkJggg== |
drage2 > 26-02-2018 12:26:14 |
Как прилепить иконку "очистить историю закрытых вкладок" |
SendInfo > 26-02-2018 14:36:03 |
Stkvsky пишет
Открой картинку кнопки в браузере и сравни со своей. |
Stkvsky > 26-02-2018 18:08:51 |
SendInfo пишет
Можешь подсказать как вставить свою иконку? |
SendInfo > 26-02-2018 19:15:48 |
Stkvsky пишет
Лень. Если интересно, сравнивай код оригинальной кнопки с кодом кнопки, в которой твоя картинка скрытый текст Выделить код Код:custombutton://%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%0A%3Ccustombutton%20xmlns%3Acb%3D%22http%3A//xsms.nm.ru/custombuttons/%22%3E%0A%20%20%3Cname%3EUndo%20Close%20Tabs%3C/name%3E%0A%20%20%3Cimage%3E%3C%21%5BCDATA%5B%20data%3Aimage/png%3Bbase64%2CiVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAQAAAC1+jfqAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAAmJLR0QAAKqNIzIAAAAJcEhZcwAADdcAAA3XAUIom3gAAAAHdElNRQfiAhkWIDaCHDWlAAAAnUlEQVQoz42RPQrCQBBGH1gKosTCwkMoljmHlQdIkyI3sE4K8TyCpVhZxjKKCElaK7vPwixhN65kppv3GOYHesea3A8HpAj5cMAB+YUFtwa3+eLEluFXuHewyScrgOVfZQYw5ejMEBBRI0Rqtth1howQ4toWNhSWMEeIyn+bGCEuv+GIhBIh9jZw96kZ24KNH4Rua9PhzZmMSa8nfwCt/V657HyxNgAAACV0RVh0ZGF0ZTpjcmVhdGUAMjAxOC0wMi0yNVQyMjozMjo1NCswMTowMAHduCcAAAAldEVYdGRhdGU6bW9kaWZ5ADIwMTgtMDItMjVUMjI6MzI6NTQrMDE6MDBwgACbAAAAGXRFWHRTb2Z0d2FyZQB3d3cuaW5rc2NhcGUub3Jnm+48GgAAAABJRU5ErkJggg%3D%3D%5D%5D%3E%3C/image%3E%0A%20%20%3Cmode%3E0%3C/mode%3E%0A%20%20%3Cinitcode%3E%3C%21%5BCDATA%5B//%20http%3A//infocatcher.ucoz.net/js/cb/undoCloseTabs.js%0A//%20https%3A//forum.mozilla-russia.org/viewtopic.php%3Fid%3D56267%0A//%20https%3A//github.com/Infocatcher/Custom_Buttons/tree/master/Undo_Close_Tabs%0A%0A//%20Undo%20Close%20Tabs%20button%20for%20Custom%20Buttons%0A//%20%28code%20for%20%22initialization%22%20section%29%0A%0A//%20%28c%29%20Infocatcher%202009-2014%0A//%20version%200.3.3%20-%202014-10-12%0A%0Avar%20options%20%3D%20%7B%0A%09menuTemplate%3A%20%5B%0A%09%09%22closedWindows%22%2C%0A%09%09%22separator%22%2C%0A%09%09%22restoreClosedWindows%22%2C%0A%09%09%22clearClosedWindows%22%2C%0A%09%09%22separator%22%2C%0A%09%09%22closedTabs%22%2C%0A%09%09%22separator%22%2C%0A%09%09%22restoreClosedTabs%22%2C%0A%09%09%22clearClosedTabs%22%2C%0A%09%09%22separator%22%2C%0A%09%09%22clearAll%22%2C%0A%09%09%22separator%22%2C%0A%09%09%22restoreLastSession%22%2C%0A%09%09%22separator%22%2C%0A%09%09%22buttonMenu%22%0A%09%5D%2C%0A%09showInTabContextMenu%3A%20false%2C%0A%09/*%0A%09menuTemplateTabContext%3A%20%5B%20//%20like%20menuTemplate%0A%09%09%22closedTabs%22%2C%0A%09%09%22separator%22%2C%0A%09%09%22restoreClosedTabs%22%2C%0A%09%09%22clearClosedTabs%22%0A%09%5D%2C%0A%09*/%0A%09windowItemTemplate%3A%20%22%28%25count%29%20%25title%22%2C%0A%09windowSelectedTabPrefix%3A%20%22*%22%2C%0A%09buttonTipTemplate%3A%20%5B%22header%22%2C%20%22title%22%2C%20%22url%22%2C%20%22closedAt%22%5D%2C%0A%09itemTipTemplate%3A%20%5B%22title%22%2C%20%22url%22%2C%20%22closedAt%22%5D%2C%0A%09hideRestoreAllForSingleEntry%3A%20false%2C%0A%09allowDeleteEntries%3A%20true%2C%0A%09accesskeys%3A%20%7B%20//%20Empty%20string%20%28%22%22%29%20to%20disable%20or%20string%20with%20possible%20values%20%28%220123...%22%2C%20%22abcd...%22%29%0A%09%09closedTabs%3A%20%22%22%2C%0A%09%09closedWindows%3A%20%22%22%0A%09%7D%2C%0A%09accesskeyPostfix%3A%20%22%20%22%2C%20//%20%3Caccesskey%3E%3Cpostfix%3E%3Clabel%3E%0A%09openMenuOnMouseover%3A%20false%2C%0A%09useMenu%3A%20false%2C%0A%09rightClickToUndoCloseTab%3A%20false%20//%20Useful%20with%20%22useMenu%3A%20true%22%0A%7D%3B%0A%0Afunction%20_localize%28sid%29%20%7B%0A%09var%20strings%20%3D%20%7B%0A%09%09en%3A%20%7B%0A%09%09%09restoreTab%3A%20%22Restore%20the%20most%20recently%20closed%20tab%22%2C%0A%0A%09%09%09restoreAllTabs%3A%20%22Restore%20all%20tabs%22%2C%0A%09%09%09restoreAllTabsAccesskey%3A%20%22t%22%2C%0A%09%09%09clearTabsHistory%3A%20%22Clear%20history%20of%20closed%20tabs%22%2C%0A%09%09%09clearTabsHistoryAccesskey%3A%20%22b%22%2C%0A%0A%09%09%09restoreAllWindows%3A%20%22Restore%20all%20windows%22%2C%0A%09%09%09restoreAllWindowsAccesskey%3A%20%22w%22%2C%0A%09%09%09clearWindowsHistory%3A%20%22Clear%20history%20of%20closed%20windows%22%2C%0A%09%09%09clearWindowsHistoryAccesskey%3A%20%22d%22%2C%0A%0A%09%09%09clearAllHistory%3A%20%22Clear%20all%20history%22%2C%0A%09%09%09clearAllHistoryAccesskey%3A%20%22C%22%2C%0A%0A%09%09%09restoreLastSession%3A%20%22Restore%20last%20session%22%2C%0A%09%09%09restoreLastSessionAccesskey%3A%20%22s%22%2C%0A%0A%09%09%09deleteUndoEntry%3A%20%22Delete%22%2C%0A%0A%09%09%09buttonMenu%3A%20%22Button%20menu%22%2C%0A%09%09%09buttonMenuAccesskey%3A%20%22m%22%2C%0A%0A%09%09%09tabContextMenu%3A%20%22Recently%20Closed%20Tabs%22%2C%0A%09%09%09tabContextMenuAccesskey%3A%20%22y%22%2C%0A%0A%09%09%09itemTip%3A%20%22%25ago%20ago%2C%20%25date%22%2C%0A%09%09%09day%3A%20%22d%22%0A%09%09%7D%2C%0A%09%09ru%3A%20%7B%0A%09%09%09restoreTab%3A%20%22%u0412%u043E%u0441%u0441%u0442%u0430%u043D%u043E%u0432%u0438%u0442%u044C%20%u043F%u043E%u0441%u043B%u0435%u0434%u043D%u044E%u044E%20%u0437%u0430%u043A%u0440%u044B%u0442%u0443%u044E%20%u0432%u043A%u043B%u0430%u0434%u043A%u0443%22%2C%0A%0A%09%09%09restoreAllTabs%3A%20%22%u0412%u043E%u0441%u0441%u0442%u0430%u043D%u043E%u0432%u0438%u0442%u044C%20%u0432%u0441%u0435%20%u0432%u043A%u043B%u0430%u0434%u043A%u0438%22%2C%0A%09%09%09restoreAllTabsAccesskey%3A%20%22%u043B%22%2C%0A%09%09%09clearTabsHistory%3A%20%22%u041E%u0447%u0438%u0441%u0442%u0438%u0442%u044C%20%u0438%u0441%u0442%u043E%u0440%u0438%u044E%20%u0437%u0430%u043A%u0440%u044B%u0442%u044B%u0445%20%u0432%u043A%u043B%u0430%u0434%u043E%u043A%22%2C%0A%09%09%09clearTabsHistoryAccesskey%3A%20%22%u0434%22%2C%0A%0A%09%09%09restoreAllWindows%3A%20%22%u0412%u043E%u0441%u0441%u0442%u0430%u043D%u043E%u0432%u0438%u0442%u044C%20%u0432%u0441%u0435%20%u043E%u043A%u043D%u0430%22%2C%0A%09%09%09restoreAllWindowsAccesskey%3A%20%22%u043E%22%2C%0A%09%09%09clearWindowsHistory%3A%20%22%u041E%u0447%u0438%u0441%u0442%u0438%u0442%u044C%20%u0438%u0441%u0442%u043E%u0440%u0438%u044E%20%u0437%u0430%u043A%u0440%u044B%u0442%u044B%u0445%20%u043E%u043A%u043E%u043D%22%2C%0A%09%09%09clearWindowsHistoryAccesskey%3A%20%22%u043D%22%2C%0A%0A%09%09%09clearAllHistory%3A%20%22%u041E%u0447%u0438%u0441%u0442%u0438%u0442%u044C%20%u0432%u0441%u044E%20%u0438%u0441%u0442%u043E%u0440%u0438%u044E%22%2C%0A%09%09%09clearAllHistoryAccesskey%3A%20%22%u0447%22%2C%0A%0A%09%09%09restoreLastSession%3A%20%22%u0412%u043E%u0441%u0441%u0442%u0430%u043D%u043E%u0432%u0438%u0442%u044C%20%u043F%u043E%u0441%u043B%u0435%u0434%u043D%u044E%u044E%20%u0441%u0435%u0441%u0441%u0438%u044E%22%2C%0A%09%09%09restoreLastSessionAccesskey%3A%20%22%u0441%22%2C%0A%0A%09%09%09deleteUndoEntry%3A%20%22%u0423%u0434%u0430%u043B%u0438%u0442%u044C%22%2C%0A%0A%09%09%09buttonMenu%3A%20%22%u041C%u0435%u043D%u044E%20%u043A%u043D%u043E%u043F%u043A%u0438%22%2C%0A%09%09%09buttonMenuAccesskey%3A%20%22%u041C%22%2C%0A%0A%09%09%09tabContextMenu%3A%20%22%u041D%u0435%u0434%u0430%u0432%u043D%u043E%20%u0437%u0430%u043A%u0440%u044B%u0442%u044B%u0435%20%u0432%u043A%u043B%u0430%u0434%u043A%u0438%22%2C%0A%09%09%09tabContextMenuAccesskey%3A%20%22%u043E%22%2C%0A%0A%09%09%09itemTip%3A%20%22%25ago%20%u043D%u0430%u0437%u0430%u0434%2C%20%25date%22%2C%0A%09%09%09day%3A%20%22%u0434%22%0A%09%09%7D%0A%09%7D%3B%0A%09var%20locale%20%3D%20%28function%28%29%20%7B%0A%09%09if%28%22Services%22%20in%20window%20%26%26%20Services.locale%20%26%26%20Services.locale.getRequestedLocales%29%20%7B%0A%09%09%09var%20locales%20%3D%20Services.locale.getRequestedLocales%28%29%3B%0A%09%09%09return%20locales%20%26%26%20locales%5B0%5D%3B%0A%09%09%7D%0A%09%09var%20prefs%20%3D%20%22Services%22%20in%20window%20%26%26%20Services.prefs%0A%09%09%09%7C%7C%20Components.classes%5B%22@mozilla.org/preferences-service%3B1%22%5D%0A%09%09%09%09.getService%28Components.interfaces.nsIPrefBranch%29%3B%0A%09%09function%20pref%28name%2C%20type%29%20%7B%0A%09%09%09return%20prefs.getPrefType%28name%29%20%21%3D%20prefs.PREF_INVALID%20%3F%20prefs%5B%22get%22%20+%20type%20+%20%22Pref%22%5D%28name%29%20%3A%20undefined%3B%0A%09%09%7D%0A%09%09if%28%21pref%28%22intl.locale.matchOS%22%2C%20%22Bool%22%29%29%20%7B%20//%20Also%20see%20https%3A//bugzilla.mozilla.org/show_bug.cgi%3Fid%3D1414390%0A%09%09%09var%20locale%20%3D%20pref%28%22general.useragent.locale%22%2C%20%22Char%22%29%3B%0A%09%09%09if%28locale%20%26%26%20locale.substr%280%2C%209%29%20%21%3D%20%22chrome%3A//%22%29%0A%09%09%09%09return%20locale%3B%0A%09%09%7D%0A%09%09return%20Components.classes%5B%22@mozilla.org/chrome/chrome-registry%3B1%22%5D%0A%09%09%09.getService%28Components.interfaces.nsIXULChromeRegistry%29%0A%09%09%09.getSelectedLocale%28%22global%22%29%3B%0A%09%7D%29%28%29.match%28/%5E%5Ba-z%5D*/%29%5B0%5D%3B%0A%09_localize%20%3D%20function%28sid%29%20%7B%0A%09%09return%20strings%5Blocale%5D%20%26%26%20strings%5Blocale%5D%5Bsid%5D%20%7C%7C%20strings.en%5Bsid%5D%20%7C%7C%20sid%3B%0A%09%7D%3B%0A%09return%20_localize.apply%28this%2C%20arguments%29%3B%0A%7D%0A%0Avar%20JSON%20%3D%20%22JSON%22%20in%20window%0A%09%3F%20window.JSON%0A%09%3A%20%22nsIJSON%22%20in%20Components.interfaces%0A%09%09%3F%20%7B%0A%09%09%09parse%3A%20function%28s%29%20%7B%0A%09%09%09%09return%20Components.classes%5B%22@mozilla.org/dom/json%3B1%22%5D%0A%09%09%09%09%09.createInstance%28Components.interfaces.nsIJSON%29%0A%09%09%09%09%09.decode%28s%29%3B%0A%09%09%09%7D%0A%09%09%7D%0A%09%09%3A%20%7B%0A%09%09%09parse%3A%20function%28s%29%20%7B%0A%09%09%09%09return%20Components.utils.evalInSandbox%28%22%28%22%20+%20s%20+%20%22%29%22%2C%20new%20Components.utils.Sandbox%28%22about%3Ablank%22%29%29%3B%0A%09%09%09%7D%0A%09%09%7D%3B%0A%0Athis.onclick%20%3D%20function%28e%29%20%7B%0A%09if%28e.target%20%21%3D%20this%29%0A%09%09return%3B%0A%09if%28e.button%20%3D%3D%201%20%7C%7C%20e.button%20%3D%3D%200%20%26%26%20%28e.ctrlKey%20%7C%7C%20e.shiftKey%20%7C%7C%20e.altKey%20%7C%7C%20e.metaKey%29%29%0A%09%09this.undoCloseTabsList.clearAllLists%28%29%3B%0A%09else%20if%28%0A%09%09e.button%20%3D%3D%200%0A%09%09%7C%7C%20e.button%20%3D%3D%202%20%26%26%20%21e.ctrlKey%20%26%26%20%21e.shiftKey%20%26%26%20%21e.altKey%20%26%26%20%21e.metaKey%0A%09%09%09%26%26%20this.undoCloseTabsList.options.rightClickToUndoCloseTab%0A%09%29%20%7B%0A%09%09if%28%0A%09%09%09e.button%20%3D%3D%200%20%26%26%20%21this.undoCloseTabsList.options.useMenu%0A%09%09%09%7C%7C%20e.button%20%3D%3D%202%20%26%26%20this.undoCloseTabsList.options.rightClickToUndoCloseTab%0A%09%09%29%20%7B%0A%09%09%09if%28this.undoCloseTabsList.closedTabCount%29%0A%09%09%09%09this.undoCloseTabsList.undoCloseTab%28%29%3B%0A%09%09%09else%0A%09%09%09%09this.undoCloseTabsList.drawUndoList%28%29%20%26%26%20this.undoCloseTabsList.showMenu%28e%29%3B%0A%09%09%7D%0A%09%09//%20Allow%20use%20%22command%22%20section%20only%20from%20hotkey%3A%0A%09%09e.preventDefault%28%29%3B%0A%09%09e.stopPropagation%28%29%3B%0A%09%7D%0A%7D%3B%0Aif%28%21this.hasOwnProperty%28%22defaultContextId%22%29%29%0A%09this.defaultContextId%20%3D%20this.getAttribute%28%22context%22%29%20%7C%7C%20%22custombuttons-contextpopup%22%3B%0Athis.onmousedown%20%3D%20function%28e%29%20%7B%0A%09if%28e.target%20%21%3D%20this%29%0A%09%09return%3B%0A%09if%28this.undoCloseTabsList.options.useMenu%29%20%7B%0A%09%09if%28e.button%20%3D%3D%200%29%0A%09%09%09this.undoCloseTabsList.drawUndoList%28%29%3B%0A%09%7D%0A%09else%20if%28e.button%20%3D%3D%202%29%20%7B%0A%09%09var%20showCbMenu%20%3D%20e.ctrlKey%20%7C%7C%20e.shiftKey%20%7C%7C%20e.altKey%20%7C%7C%20e.metaKey%20%7C%7C%20%21this.undoCloseTabsList.drawUndoList%28%29%3B%0A%09%09this.setAttribute%28%0A%09%09%09%22context%22%2C%0A%09%09%09showCbMenu%0A%09%09%09%09%3F%20this.defaultContextId%0A%09%09%09%09%3A%20this.undoCloseTabsList.mpId%0A%09%09%29%3B%0A%09%7D%0A%7D%3B%0Athis.onmouseover%20%3D%20function%28e%29%20%7B%0A%09if%28e.target%20%21%3D%20this%29%0A%09%09return%3B%0A%09if%28%21this.disabled%29%0A%09%09this.undoCloseTabsList.updUI%28%29%3B%0A%09this.undoCloseTabsList.options.useMenu%20%26%26%20Array.prototype.some.call%28%0A%09%09this.parentNode.getElementsByTagName%28%22*%22%29%2C%0A%09%09function%28node%29%20%7B%0A%09%09%09if%28%0A%09%09%09%09node%20%21%3D%20this%0A%09%09%09%09%26%26%20node.namespaceURI%20%3D%3D%20xulns%0A%09%09%09%09%26%26%20node.boxObject%0A%09%09%09%09//%20See%20https%3A//github.com/Infocatcher/Custom_Buttons/issues/28%0A%09%09%09%09//%26%26%20node.boxObject%20instanceof%20Components.interfaces.nsIMenuBoxObject%0A%09%09%09%09%26%26%20%22open%22%20in%20node%0A%09%09%09%09%26%26%20node.open%0A%09%09%09%09%26%26%20node.getElementsByTagName%28%22menupopup%22%29.length%0A%09%09%09%09%26%26%20this.undoCloseTabsList.drawUndoList%28%29%0A%09%09%09%29%20%7B%0A%09%09%09%09node.open%20%3D%20false%3B%0A%09%09%09%09this.open%20%3D%20true%3B%0A%09%09%09%09return%20true%3B%0A%09%09%09%7D%0A%09%09%09return%20false%3B%0A%09%09%7D%2C%0A%09%09this%0A%09%29%3B%0A%09if%28%0A%09%09this.undoCloseTabsList.options.openMenuOnMouseover%0A%09%09%26%26%20this.undoCloseTabsList.drawUndoList%28%29%0A%09%29%0A%09%09this.undoCloseTabsList.openMenu%28%29%3B%0A%7D%3B%0A%0Athis.undoCloseTabsList%20%3D%20%7B%0A%09button%3A%20this%2C%0A%09options%3A%20options%2C%0A%09mpId%3A%20this.id%20+%20%22-context%22%2C%0A%09cmId%3A%20this.id%20+%20%22-contextSub%22%2C%0A%09tcmId%3A%20this.id%20+%20%22-tabContextMenu%22%2C%0A%09tipId%3A%20this.id%20+%20%22-tooltip%22%2C%0A%09errPrefix%3A%20%22%5BCustom%20Buttons%20%3A%3A%20Undo%20Close%20Tabs%20List%5D%3A%20%22%2C%0A%09get%20mp%28%29%20%7B%0A%09%09var%20btn%20%3D%20this.button%3B%0A%09%09var%20mp%20%3D%20btn.getElementsByTagName%28%22menupopup%22%29%3B%0A%09%09mp%20%3D%20mp.length%20%26%26%20mp%5B0%5D%3B%0A%09%09mp%20%26%26%20mp.parentNode.removeChild%28mp%29%3B%0A%09%09mp%20%3D%20this.createElement%28%22menupopup%22%2C%20%7B%0A%09%09%09id%3A%20this.mpId%2C%0A%09%09%09onclick%3A%20%22this.parentNode.undoCloseTabsList.checkForMiddleClick%28event%29%3B%22%2C%0A%09%09%09onpopupshowing%3A%20%22if%28event.target%20%3D%3D%20this%29%20document.popupNode%20%3D%20this.parentNode%3B%22%2C%0A%09%09%09onpopuphidden%3A%20%22if%28event.target%20%3D%3D%20this%29%20document.popupNode%20%3D%20null%3B%22%0A%09%09%7D%29%3B%0A%09%09if%28this.cm%29%0A%09%09%09mp.setAttribute%28%22context%22%2C%20this.cmId%29%3B%0A%09%09var%20tb%20%3D%20btn.parentNode%3B%0A%09%09if%28%0A%09%09%09this.options.useMenu%0A%09%09%09%26%26%20tb.getAttribute%28%22orient%22%29%20%3D%3D%20%22vertical%22%0A%09%09%29%20%7B%0A%09%09%09//%20https%3A//addons.mozilla.org/firefox/addon/vertical-toolbar/%0A%09%09%09var%20isRight%20%3D%20tb.parentNode.getAttribute%28%22placement%22%29%20%3D%3D%20%22right%22%3B%0A%09%09%09mp.setAttribute%28%22position%22%2C%20isRight%20%3F%20%22start_before%22%20%3A%20%22end_before%22%29%3B%0A%09%09%7D%0A%09%09delete%20this.mp%3B%0A%09%09return%20this.mp%20%3D%20btn.appendChild%28mp%29%3B%0A%09%7D%2C%0A%09get%20useCentextMenu%28%29%20%7B%0A%09%09delete%20this.useCentextMenu%3B%0A%09%09return%20this.useCentextMenu%20%3D%20this.options.allowDeleteEntries%0A%09%09%09%26%26%20%28%22forgetClosedTab%22%20in%20this.ss%20%7C%7C%20%22forgetClosedWindow%22%20in%20this.ss%29%3B%0A%09%7D%2C%0A%09get%20cm%28%29%20%7B%0A%09%09delete%20this.cm%3B%0A%09%09if%28%21this.useCentextMenu%29%0A%09%09%09return%20this.cm%20%3D%20null%3B%0A%09%09var%20cm%20%3D%20document.getElementById%28this.cmId%29%3B%0A%09%09cm%20%26%26%20cm.parentNode.removeChild%28cm%29%3B%0A%09%09cm%20%3D%20this.createElement%28%22menupopup%22%2C%20%7B%0A%09%09%09id%3A%20this.cmId%2C%0A%09%09%09onpopupshowing%3A%20%22return%20this.undoCloseTabsList.canDeleteUndoEntry%28this.triggerNode%20%7C%7C%20document.popupNode%29%3B%22%0A%09%09%7D%29%3B%0A%09%09var%20mi%20%3D%20this.createElement%28%22menuitem%22%2C%20%7B%0A%09%09%09oncommand%3A%20%22this.parentNode.undoCloseTabsList.deleteUndoEntry%28this.parentNode.triggerNode%20%7C%7C%20document.popupNode%29%3B%22%2C%0A%09%09%09label%3A%20_localize%28%22deleteUndoEntry%22%29%2C%0A%09%09%09closemenu%3A%20%22single%22%0A%09%09%7D%29%3B%0A%09%09cm.appendChild%28mi%29%3B%0A%09%09cm.undoCloseTabsList%20%3D%20this%3B%0A%09%09return%20this.cm%20%3D%20document.getElementById%28%22mainPopupSet%22%29.appendChild%28cm%29%3B%0A%09%7D%2C%0A%09get%20cbMenu%28%29%20%7B%0A%09%09var%20cbPopup%20%3D%20document.getElementById%28this.button.defaultContextId%29%3B%0A%09%09if%28%21cbPopup%29%20%7B%0A%09%09%09Components.utils.reportError%28this.errPrefix%20+%20%22cb%20menu%20not%20found%22%29%3B%0A%09%09%09return%20this.cbMenu%20%3D%20null%3B%0A%09%09%7D%0A%09%09cbPopup%20%3D%20cbPopup.cloneNode%28true%29%3B%0A%09%09var%20id%20%3D%20%22-%22%20+%20this.button.id.match%28/%5Cd*%24/%29%5B0%5D%20+%20%22-cloned%22%3B%0A%09%09cbPopup.id%20+%3D%20id%3B%0A%09%09Array.prototype.slice.call%28cbPopup.getElementsByAttribute%28%22id%22%2C%20%22*%22%29%29.forEach%28function%28node%29%20%7B%0A%09%09%09node.id%20+%3D%20id%3B%0A%09%09%7D%29%3B%0A%09%09var%20menu%20%3D%20this.createElement%28%22menu%22%2C%20%7B%0A%09%09%09label%3A%20_localize%28%22buttonMenu%22%29%2C%0A%09%09%09accesskey%3A%20_localize%28%22buttonMenuAccesskey%22%29%0A%09%09%7D%29%3B%0A%09%09menu.appendChild%28cbPopup%29%3B%0A%09%09cbPopup.setAttribute%28%0A%09%09%09%22onpopupshowing%22%2C%0A%09%09%09%27%5C%0A%09%09%09var%20btn%20%3D%20document.popupNode%20%3D%20this.parentNode.parentNode.parentNode%5Cn%5C%0A%09%09%09%09.undoCloseTabsList.button%3B%5Cn%5C%0A%09%09%09custombutton.setContextMenuVisibility%28btn%29%3B%27%0A%09%09%29%3B%0A%09%09delete%20this.cbMenu%3B%0A%09%09return%20this.cbMenu%20%3D%20menu%3B%0A%09%7D%2C%0A%09get%20ss%28%29%20%7B%0A%09%09delete%20this.ss%3B%0A%09%09return%20this.ss%20%3D%20%28%0A%09%09%09Components.classes%5B%22@mozilla.org/browser/sessionstore%3B1%22%5D%0A%09%09%09%7C%7C%20Components.classes%5B%22@mozilla.org/suite/sessionstore%3B1%22%5D%0A%09%09%29.getService%28Components.interfaces.nsISessionStore%29%3B%0A%09%7D%2C%0A%09get%20appInfo%28%29%20%7B%0A%09%09delete%20this.appInfo%3B%0A%09%09return%20this.appInfo%20%3D%20Components.classes%5B%22@mozilla.org/xre/app-info%3B1%22%5D%0A%09%09%09.getService%28Components.interfaces.nsIXULAppInfo%29%3B%0A%09%7D%2C%0A%09get%20appVersion%28%29%20%7B%0A%09%09delete%20this.appVersion%3B%0A%09%09return%20this.appVersion%20%3D%20parseFloat%28this.appInfo.version%29%3B%0A%09%7D%2C%0A%09get%20appName%28%29%20%7B%0A%09%09delete%20this.appName%3B%0A%09%09return%20this.appName%20%3D%20this.appInfo.name%3B%0A%09%7D%2C%0A%0A%09init%3A%20function%28%29%20%7B%0A%09%09window.addEventListener%28%22TabClose%22%2C%20%20%20%20%20%20%20this%2C%20false%29%3B%0A%09%09window.addEventListener%28%22SSTabRestoring%22%2C%20this%2C%20false%29%3B%0A%09%09window.addEventListener%28%22unload%22%2C%20%20%20%20%20%20%20%20%20this%2C%20false%29%3B%0A%09%09if%28this.appName%20%3D%3D%20%22SeaMonkey%22%29%20//%20No%20SSTab*%20events%20in%20SeaMonkey%0A%09%09%09window.addEventListener%28%22TabOpen%22%2C%20this%2C%20false%29%3B%0A%09%09setTimeout%28function%28_this%29%20%7B%0A%09%09%09_this.mp.addEventListener%28%22DOMMenuItemActive%22%2C%20%20%20_this%2C%20false%29%3B%0A%09%09%09_this.mp.addEventListener%28%22DOMMenuItemInactive%22%2C%20_this%2C%20false%29%3B%0A%09%09%09_this.initTooltip%28%29%3B%0A%09%09%7D%2C%2050%2C%20this%29%3B%0A%09%09this.addPbExitObserver%28true%29%3B%0A%09%09this.updUIGlobal%28%29%3B%0A%09%09if%28this.options.showInTabContextMenu%29%20setTimeout%28function%28_this%29%20%7B%0A%09%09%09_this.initTabContext%28%29%3B%0A%09%09%7D%2C%20100%2C%20this%29%3B%0A%09%7D%2C%0A%09initTabContext%3A%20function%28%29%20%7B%0A%09%09var%20origMi%20%3D%20this.tabContextUndoClose%3B%0A%09%09if%28%21origMi%29%20%7B%0A%09%09%09LOG%28%22Can%27t%20find%20%5C%22Undo%20Close%20Tab%5C%22%20item%20in%20tab%20context%20menu%22%29%3B%0A%09%09%09return%3B%0A%09%09%7D%0A%09%09var%20menu%20%3D%20document.getElementById%28this.tcmId%29%3B%0A%09%09menu%20%26%26%20menu.parentNode.removeChild%28menu%29%3B%20//%20For%20SeaMonkey%0A%09%09menu%20%3D%20this.createElement%28%22menu%22%2C%20%7B%0A%09%09%09id%3A%20this.tcmId%2C%0A%09%09%09label%3A%20_localize%28%22tabContextMenu%22%29%2C%0A%09%09%09accesskey%3A%20_localize%28%22tabContextMenuAccesskey%22%29%2C%0A%09%09%09tooltip%3A%20this.tipId%2C%0A%09%09%09popupsinherittooltip%3A%20%22true%22%0A%09%09%7D%29%3B%0A%09%09menu.undoCloseTabsList%20%3D%20this%3B%0A%09%09menu.onclick%20%3D%20function%28e%29%20%7B%0A%09%09%09if%28e.target%20%21%3D%20this%29%0A%09%09%09%09return%3B%0A%09%09%09if%28e.button%20%3D%3D%201%20%7C%7C%20e.button%20%3D%3D%200%20%26%26%20%28e.ctrlKey%20%7C%7C%20e.shiftKey%20%7C%7C%20e.altKey%20%7C%7C%20e.metaKey%29%29%20%7B%0A%09%09%09%09if%28this.undoCloseTabsList.closedTabCount%29%20%7B%0A%09%09%09%09%09this.undoCloseTabsList.undoCloseTab%28%29%3B%0A%09%09%09%09%09closeMenus%28this%29%3B%0A%09%09%09%09%7D%0A%09%09%09%7D%0A%09%09%7D%3B%0A%09%09var%20origMp%20%3D%20this.mp%3B%0A%09%09var%20mp%20%3D%20origMp.cloneNode%28true%29%3B%0A%09%09mp.id%20%3D%20this.button.id%20+%20%22-tabContext%22%3B%0A%09%09var%20_this%20%3D%20this%3B%0A%09%09function%20drawUndoList%28%29%20%7B%0A%09%09%09var%20ok%20%3D%20false%3B%0A%09%09%09var%20opts%20%3D%20_this.options%3B%0A%09%09%09var%20origTemplate%20%3D%20opts.menuTemplate%3B%0A%09%09%09opts.menuTemplate%20%3D%20opts.menuTemplateTabContext%20%7C%7C%20origTemplate%3B%0A%09%09%09_this.mp%20%3D%20mp%3B%0A%09%09%09try%20%7B%0A%09%09%09%09ok%20%3D%20_this.drawUndoList%28%29%3B%0A%09%09%09%7D%0A%09%09%09catch%28e%29%20%7B%0A%09%09%09%09Components.utils.reportError%28e%29%3B%0A%09%09%09%7D%0A%09%09%09opts.menuTemplate%20%3D%20origTemplate%3B%0A%09%09%09_this.mp%20%3D%20origMp%3B%0A%09%09%09return%20ok%3B%0A%09%09%7D%0A%09%09function%20updMenu%28%29%20%7B%0A%09%09%09if%28drawUndoList%28%29%29%0A%09%09%09%09menu.removeAttribute%28%22disabled%22%29%3B%0A%09%09%09else%0A%09%09%09%09menu.setAttribute%28%22disabled%22%2C%20%22true%22%29%3B%0A%09%09%7D%0A%09%09mp._updatePopup%20%3D%20function%28e%29%20%7B%0A%09%09%09if%28e.target%20%21%3D%20this%29%0A%09%09%09%09return%3B%0A%09%09%09document.popupNode%20%3D%20_this.button%3B%0A%09%09%09drawUndoList%28%29%3B%0A%09%09%7D%3B%0A%09%09mp.setAttribute%28%22onpopupshowing%22%2C%20%22this._updatePopup%28event%29%3B%22%29%3B%0A%09%09mp.onclick%20%3D%20function%28e%29%20%7B%0A%09%09%09_this.checkForMiddleClick%28e%2C%20updMenu%29%3B%0A%09%09%7D%3B%0A%09%09menu.appendChild%28mp%29%3B%0A%09%09addEventListener%28%22popupshown%22%2C%20function%28e%29%20%7B%0A%09%09%09if%28e.target%20%3D%3D%20e.currentTarget%29%0A%09%09%09%09setTimeout%28updMenu%2C%200%29%3B%20//%20Pseudo%20async%0A%09%09%7D%2C%20false%2C%20origMi.parentNode%29%3B%0A%09%09addEventListener%28%22DOMMenuItemActive%22%2C%20%20%20this%2C%20false%2C%20mp%29%3B%0A%09%09addEventListener%28%22DOMMenuItemInactive%22%2C%20this%2C%20false%2C%20mp%29%3B%0A%09%09origMi.parentNode.insertBefore%28menu%2C%20origMi.nextSibling%29%3B%0A%09%09origMi.setAttribute%28%22hidden%22%2C%20%22true%22%29%3B%0A%09%7D%2C%0A%09initTooltip%3A%20function%28%29%20%7B%0A%09%09var%20tip%20%3D%20document.getElementById%28this.tipId%29%3B%0A%09%09tip%20%26%26%20tip.parentNode.removeChild%28tip%29%3B%0A%09%09tip%20%3D%20this.tip%20%3D%20this.createElement%28%22tooltip%22%2C%20%7B%0A%09%09%09id%3A%20this.tipId%2C%0A%09%09%09orient%3A%20%22vertical%22%2C%0A%09%09%09onpopupshowing%3A%20%22return%20this.undoCloseTabsList.updTooltip%28this%2C%20document.tooltipNode%29%3B%22%2C%0A%09%09%09onpopuphiding%3A%20%22this.cancelUpdateTimer%28%29%3B%22%2C%0A%09%09%09style%3A%20%22padding%3A%200%3B%22%0A%09%09%7D%29%3B%0A%09%09tip.undoCloseTabsList%20%3D%20this%3B%0A%09%09tip._updateTimer%20%3D%200%3B%0A%09%09tip.initUpdateTimer%20%3D%20function%28fn%2C%20context%29%20%7B%0A%09%09%09if%28this._updateTimer%29%0A%09%09%09%09clearInterval%28this._updateTimer%29%3B%0A%09%09%09this._updateTimer%20%3D%20setInterval%28function%28%29%20%7B%0A%09%09%09%09fn.call%28context%29%3B%0A%09%09%09%7D%2C%201000%29%3B%0A%09%09%7D%3B%0A%09%09tip.cancelUpdateTimer%20%3D%20function%28%29%20%7B%0A%09%09%09if%28this._updateTimer%29%20%7B%0A%09%09%09%09clearInterval%28this._updateTimer%29%3B%0A%09%09%09%09this._updateTimer%20%3D%200%3B%0A%09%09%09%7D%0A%09%09%7D%3B%0A%09%09var%20btn%20%3D%20this.button%3B%0A%09%09btn.removeAttribute%28%22tooltiptext%22%29%3B%0A%09%09btn.setAttribute%28%22tooltip%22%2C%20this.tipId%29%3B%0A%09%09btn.setAttribute%28%22popupsinherittooltip%22%2C%20%22true%22%29%3B%0A%09%09document.getElementById%28%22mainPopupSet%22%29.appendChild%28tip%29%3B%0A%09%7D%2C%0A%09_hasPbExitObserver%3A%20false%2C%0A%09addPbExitObserver%3A%20function%28add%29%20%7B%0A%09%09if%28add%20%3D%3D%20this._hasPbExitObserver%20%7C%7C%20%21%28%22Services%22%20in%20window%29%29%0A%09%09%09return%3B%0A%09%09this._hasPbExitObserver%20%3D%20add%3B%0A%09%09if%28add%29%0A%09%09%09Services.obs.addObserver%28this%2C%20%22last-pb-context-exited%22%2C%20false%29%3B%0A%09%09else%0A%09%09%09Services.obs.removeObserver%28this%2C%20%22last-pb-context-exited%22%29%3B%0A%09%7D%2C%0A%09destroy%3A%20function%28%29%20%7B%0A%09%09window.removeEventListener%28%22TabClose%22%2C%20%20%20%20%20%20%20this%2C%20false%29%3B%0A%09%09window.removeEventListener%28%22SSTabRestoring%22%2C%20this%2C%20false%29%3B%0A%09%09window.removeEventListener%28%22unload%22%2C%20%20%20%20%20%20%20%20%20this%2C%20false%29%3B%0A%09%09if%28this.appName%20%3D%3D%20%22SeaMonkey%22%29%0A%09%09%09window.removeEventListener%28%22TabOpen%22%2C%20this%2C%20false%29%3B%0A%09%09this.mp.removeEventListener%28%22DOMMenuItemActive%22%2C%20%20%20this%2C%20false%29%3B%0A%09%09this.mp.removeEventListener%28%22DOMMenuItemInactive%22%2C%20this%2C%20false%29%3B%0A%09%09this.addPbExitObserver%28false%29%3B%0A%09%09var%20menu%20%3D%20document.getElementById%28this.tcmId%29%3B%0A%09%09if%28menu%29%20%7B%0A%09%09%09menu.parentNode.removeChild%28menu%29%3B%0A%09%09%09this.tabContextUndoClose.removeAttribute%28%22hidden%22%29%3B%0A%09%09%7D%0A%09%09var%20tip%20%3D%20this.tip%3B%0A%09%09tip%20%26%26%20tip.parentNode%20%26%26%20tip.parentNode.removeChild%28tip%29%3B%0A%09%7D%2C%0A%09handleEvent%3A%20function%28e%29%20%7B%0A%09%09switch%28e.type%29%20%7B%0A%09%09%09case%20%22TabClose%22%3A%0A%09%09%09case%20%22SSTabRestoring%22%3A%0A%09%09%09case%20%22TabOpen%22%3A%0A%09%09%09%09setTimeout%28function%28_this%29%20%7B%0A%09%09%09%09%09_this.updUI%28%29%3B%0A%09%09%09%09%7D%2C%200%2C%20this%29%3B%0A%09%09%09break%3B%0A%09%09%09case%20%22DOMMenuItemActive%22%3A%0A%09%09%09case%20%22DOMMenuItemInactive%22%3A%0A%09%09%09%09if%28%21%28%22XULBrowserWindow%22%20in%20window%29%29%0A%09%09%09%09%09break%3B%0A%09%09%09%09XULBrowserWindow.setOverLink%28%0A%09%09%09%09%09e.type%20%3D%3D%20%22DOMMenuItemActive%22%0A%09%09%09%09%09%09%3F%20%28e.target.getAttribute%28%22cb_urlDecoded%22%29%20%7C%7C%20%22%22%29%0A%09%09%09%09%09%09%09.replace%28/%20%5Cn/g%2C%20%22%2C%20%22%29%0A%09%09%09%09%09%09%3A%20%22%22%2C%0A%09%09%09%09%09null%0A%09%09%09%09%29%3B%0A%09%09%09break%3B%0A%09%09%09case%20%22unload%22%3A%0A%09%09%09%09this.updUIGlobal%28%29%3B%0A%09%09%09%09this.destroy%28%29%3B%0A%09%09%7D%0A%09%7D%2C%0A%09observe%3A%20function%28subject%2C%20topic%2C%20data%29%20%7B%0A%09%09if%28topic%20%3D%3D%20%22last-pb-context-exited%22%29%20%7B%0A%09%09%09setTimeout%28function%28_this%29%20%7B%0A%09%09%09%09_this.updUI%28%29%3B%0A%09%09%09%7D%2C%2025%2C%20this%29%3B%0A%09%09%7D%0A%09%7D%2C%0A%0A%09createElement%3A%20function%28name%2C%20attrs%29%20%7B%0A%09%09var%20node%20%3D%20document.createElement%28name%29%3B%0A%09%09if%28attrs%29%20for%28var%20attrName%20in%20attrs%29%20if%28attrs.hasOwnProperty%28attrName%29%29%0A%09%09%09node.setAttribute%28attrName%2C%20attrs%5BattrName%5D%29%3B%0A%09%09return%20node%3B%0A%09%7D%2C%0A%09get%20tabContextUndoClose%28%29%20%7B%0A%09%09return%20document.getElementById%28%22context_undoCloseTab%22%29%0A%09%09%09%7C%7C%20document.getElementById%28%22tabContextUndoCloseTab%22%29%20//%20Firefox%202.0%0A%09%09%09%7C%7C%20document.getAnonymousElementByAttribute%28gBrowser%2C%20%22tbattr%22%2C%20%22tabbrowser-undoclosetab%22%29%3B%20//%20SeaMonkey%0A%09%7D%2C%0A%09get%20closedWindowCount%28%29%20%7B%0A%09%09if%28%21%28%22getClosedWindowCount%22%20in%20this.ss%29%29%20%7B%0A%09%09%09delete%20this.closedWindowCount%3B%0A%09%09%09return%20this.closedWindowCount%20%3D%200%3B%0A%09%09%7D%0A%09%09this.__defineGetter__%28%22closedWindowCount%22%2C%20function%28%29%20%7B%0A%09%09%09return%20this.ss.getClosedWindowCount%28%29%3B%0A%09%09%7D%29%3B%0A%09%09return%20this.closedWindowCount%3B%0A%09%7D%2C%0A%09get%20closedTabCount%28%29%20%7B%0A%09%09return%20this.ss.getClosedTabCount%28window%29%3B%0A%09%7D%2C%0A%09undoCloseTab%3A%20function%28i%29%20%7B%0A%09%09if%28%22undoCloseTab%22%20in%20window%29%20//%20Firefox%202.0+%0A%09%09%09undoCloseTab%28i%29%3B%0A%09%09else%20//%20SeaMonkey%0A%09%09%09gBrowser.undoCloseTab%28i%29%3B%0A%09%7D%2C%0A%09clearUndoTabsList%3A%20function%28%29%20%7B%0A%09%09var%20closedTabCount%20%3D%20this.closedTabCount%3B%0A%09%09if%28%21closedTabCount%29%0A%09%09%09return%3B%0A%09%09if%28%22forgetClosedTab%22%20in%20this.ss%29%20//%20Gecko%201.9.2+%0A%09%09%09while%28closedTabCount--%29%0A%09%09%09%09this.ss.forgetClosedTab%28window%2C%200%29%3B%0A%09%09else%20%7B%0A%09%09%09//%20Doesn%27t%20work%20in%20SeaMonkey%0A%09%09%09const%20pName%20%3D%20%22browser.sessionstore.max_tabs_undo%22%3B%0A%09%09%09let%20val%20%3D%20cbu.getPrefs%28pName%29%3B%0A%09%09%09cbu.setPrefs%28pName%2C%200%29%3B%0A%09%09%09cbu.setPrefs%28pName%2C%20val%29%3B%0A%09%09%7D%0A%09%09this.updUIGlobal%28%29%3B%0A%09%7D%2C%0A%09clearUndoWindowsList%3A%20function%28%29%20%7B%0A%09%09var%20closedWindowCount%20%3D%20this.closedWindowCount%3B%0A%09%09if%28%21closedWindowCount%29%0A%09%09%09return%3B%0A%09%09if%28%22forgetClosedWindow%22%20in%20this.ss%29%20//%20Gecko%201.9.2+%0A%09%09%09while%28closedWindowCount--%29%0A%09%09%09%09this.ss.forgetClosedWindow%280%29%3B%0A%09%09else%0A%09%09%09this.ss.setWindowState%28window%2C%20%27%7B%22windows%22%3A%5B%7B%7D%5D%2C%22_closedWindows%22%3A%5B%5D%7D%27%2C%20false%29%3B%0A%09%09this.updUIGlobal%28%29%3B%0A%09%7D%2C%0A%09clearAllLists%3A%20function%28%29%20%7B%0A%09%09this.clearUndoTabsList%28%29%3B%0A%09%09this.clearUndoWindowsList%28%29%3B%0A%09%7D%2C%0A%09canDeleteUndoEntry%3A%20function%28mi%29%20%7B%0A%09%09switch%28mi.getAttribute%28%22cb_type%22%29%29%20%7B%0A%09%09%09case%20%22tab%22%3A%20%20%20%20return%20%22forgetClosedTab%22%20%20%20%20in%20this.ss%3B%0A%09%09%09case%20%22window%22%3A%20return%20%22forgetClosedWindow%22%20in%20this.ss%3B%0A%09%09%7D%0A%09%09return%20false%3B%0A%09%7D%2C%0A%09deleteUndoEntry%3A%20function%28mi%29%20%7B%0A%09%09var%20i%20%3D%20+mi.getAttribute%28%22cb_index%22%29%3B%0A%09%09if%28mi.getAttribute%28%22cb_type%22%29%20%3D%3D%20%22window%22%29%20%7B%0A%09%09%09this.ss.forgetClosedWindow%28i%29%3B%0A%09%09%09this.updUIGlobal%28%29%3B%0A%09%09%7D%0A%09%09else%20%7B%0A%09%09%09this.ss.forgetClosedTab%28window%2C%20i%29%3B%0A%09%09%09this.updUI%28%29%3B%0A%09%09%7D%0A%09%09this.drawUndoList%28%29%3B%0A%09%7D%2C%0A%09showMenu%3A%20function%28e%2C%20isContext%2C%20mp%29%20%7B%0A%09%09var%20btn%20%3D%20this.button%3B%0A%09%09document.popupNode%20%3D%20btn.ownerDocument.popupNode%20%3D%20btn%3B%0A%09%09if%28%21mp%29%0A%09%09%09mp%20%3D%20this.mp%3B%0A%09%09if%28%22openPopupAtScreen%22%20in%20mp%29%0A%09%09%09mp.openPopupAtScreen%28e.screenX%2C%20e.screenY%2C%20isContext%29%3B%0A%09%09else%0A%09%09%09mp.showPopup%28btn%2C%20e.screenX%2C%20e.screenY%2C%20isContext%20%3F%20%22context%22%20%3A%20%22popup%22%2C%20null%2C%20null%29%3B%0A%09%7D%2C%0A%09openMenu%3A%20function%28%29%20%7B%0A%09%09var%20mp%20%3D%20this.mp%3B%0A%09%09if%28%22openPopup%22%20in%20mp%29%0A%09%09%09mp.openPopup%28this.button%2C%20%22after_start%22%29%3B%0A%09%09else%0A%09%09%09mp.showPopup%28this.button%2C%20-1%2C%20-1%2C%20%22popup%22%2C%20%22bottomleft%22%2C%20%22topleft%22%29%3B%0A%09%7D%2C%0A%09drawUndoList%3A%20function%28%29%20%7B%0A%09%09var%20mp%20%3D%20this.mp%3B%0A%0A%09%09var%20wc%20%3D%20this.closedWindowCount%3B%0A%09%09var%20tc%20%3D%20this.closedTabCount%3B%0A%09%09var%20ss%20%3D%20this.ss%3B%0A%09%09var%20canRestoreLastSession%20%3D%20%22restoreLastSession%22%20in%20ss%20%26%26%20ss.canRestoreLastSession%0A%09%09if%28%21wc%20%26%26%20%21tc%20%26%26%20%21canRestoreLastSession%29%20%7B%0A%09%09%09mp.textContent%20%3D%20%22%22%3B%0A%09%09%09mp.hidePopup%28%29%3B%0A%09%09%09return%20false%3B%0A%09%09%7D%0A%0A%09%09this._undoWindowItems%20%3D%20wc%20%26%26%20JSON.parse%28ss.getClosedWindowData%28%29%29%3B%0A%09%09this._undoTabItems%20%20%20%20%3D%20tc%20%26%26%20JSON.parse%28ss.getClosedTabData%28window%29%29%3B%0A%09%09var%20df%20%3D%20document.createDocumentFragment%28%29%3B%0A%0A%09%09this.options.menuTemplate.forEach%28function%28sid%2C%20indx%2C%20arr%29%20%7B%0A%09%09%09switch%28sid%29%20%7B%0A%09%09%09%09case%20%22closedWindows%22%3A%0A%09%09%09%09%09wc%20%26%26%20this.addUndoWindowsList%28df%29%3B%0A%09%09%09%09break%3B%0A%09%09%09%09case%20%22restoreClosedWindows%22%3A%0A%09%09%09%09%09wc%20%3E%20this.options.hideRestoreAllForSingleEntry%0A%09%09%09%09%09%26%26%20df.appendChild%28this.createElement%28%22menuitem%22%2C%20%7B%0A%09%09%09%09%09%09label%3A%20_localize%28%22restoreAllWindows%22%29%2C%0A%09%09%09%09%09%09accesskey%3A%20_localize%28%22restoreAllWindowsAccesskey%22%29%2C%0A%09%09%09%09%09%09oncommand%3A%20%22for%28var%20i%20%3D%200%3B%20i%20%3C%20%22%20+%20this._undoWindowItems.length%20+%20%22%3B%20++i%29%20undoCloseWindow%28%29%3B%22%0A%09%09%09%09%09%7D%29%29%3B%0A%09%09%09%09break%3B%0A%09%09%09%09case%20%22clearClosedWindows%22%3A%0A%09%09%09%09%09wc%20%26%26%20df.appendChild%28this.createElement%28%22menuitem%22%2C%20%7B%0A%09%09%09%09%09%09label%3A%20_localize%28%22clearWindowsHistory%22%29%2C%0A%09%09%09%09%09%09accesskey%3A%20_localize%28%22clearWindowsHistoryAccesskey%22%29%2C%0A%09%09%09%09%09%09oncommand%3A%20%22this.parentNode.parentNode.undoCloseTabsList.clearUndoWindowsList%28%29%3B%22%0A%09%09%09%09%09%7D%29%29%3B%0A%09%09%09%09break%3B%0A%09%09%09%09case%20%22closedTabs%22%3A%0A%09%09%09%09%09tc%20%26%26%20this.addUndoTabsList%28df%29%3B%0A%09%09%09%09break%3B%0A%09%09%09%09case%20%22restoreClosedTabs%22%3A%0A%09%09%09%09%09tc%20%3E%20this.options.hideRestoreAllForSingleEntry%0A%09%09%09%09%09%26%26%20df.appendChild%28this.createElement%28%22menuitem%22%2C%20%7B%0A%09%09%09%09%09%09label%3A%20_localize%28%22restoreAllTabs%22%29%2C%0A%09%09%09%09%09%09accesskey%3A%20_localize%28%22restoreAllTabsAccesskey%22%29%2C%0A%09%09%09%09%09%09oncommand%3A%20%22for%28var%20i%20%3D%200%3B%20i%20%3C%20%22%20+%20this._undoTabItems.length%20+%20%22%3B%20++i%29%20this.parentNode.parentNode.undoCloseTabsList.undoCloseTab%28%29%3B%22%0A%09%09%09%09%09%7D%29%29%3B%0A%09%09%09%09break%3B%0A%09%09%09%09case%20%22clearClosedTabs%22%3A%0A%09%09%09%09%09tc%20%26%26%20df.appendChild%28this.createElement%28%22menuitem%22%2C%20%7B%0A%09%09%09%09%09%09label%3A%20_localize%28%22clearTabsHistory%22%29%2C%0A%09%09%09%09%09%09accesskey%3A%20_localize%28%22clearTabsHistoryAccesskey%22%29%2C%0A%09%09%09%09%09%09oncommand%3A%20%22this.parentNode.parentNode.undoCloseTabsList.clearUndoTabsList%28%29%3B%22%0A%09%09%09%09%09%7D%29%29%3B%0A%09%09%09%09break%3B%0A%09%09%09%09case%20%22clearAll%22%3A%0A%09%09%09%09%09%28%0A%09%09%09%09%09%09wc%20%26%26%20tc%0A%09%09%09%09%09%09%7C%7C%20wc%20%26%26%20arr.indexOf%28%22clearClosedWindows%22%29%20%3D%3D%20-1%0A%09%09%09%09%09%09%7C%7C%20tc%20%26%26%20arr.indexOf%28%22clearClosedTabs%22%29%20%3D%3D%20-1%0A%09%09%09%09%09%29%0A%09%09%09%09%09%26%26%20df.appendChild%28this.createElement%28%22menuitem%22%2C%20%7B%0A%09%09%09%09%09%09label%3A%20_localize%28%22clearAllHistory%22%29%2C%0A%09%09%09%09%09%09accesskey%3A%20_localize%28%22clearAllHistoryAccesskey%22%29%2C%0A%09%09%09%09%09%09oncommand%3A%20%22this.parentNode.parentNode.undoCloseTabsList.clearAllLists%28%29%3B%22%0A%09%09%09%09%09%7D%29%29%3B%0A%09%09%09%09break%3B%0A%09%09%09%09case%20%22restoreLastSession%22%3A%20//%20Gecko%202.0+%0A%09%09%09%09%09canRestoreLastSession%20%26%26%20df.appendChild%28this.createElement%28%22menuitem%22%2C%20%7B%0A%09%09%09%09%09%09label%3A%20_localize%28%22restoreLastSession%22%29%2C%0A%09%09%09%09%09%09accesskey%3A%20_localize%28%22restoreLastSessionAccesskey%22%29%2C%0A%09%09%09%09%09%09oncommand%3A%20%22this.parentNode.parentNode.undoCloseTabsList.ss.restoreLastSession%28%29%3B%22%0A%09%09%09%09%09%7D%29%29%3B%0A%09%09%09%09break%3B%0A%09%09%09%09case%20%22buttonMenu%22%3A%0A%09%09%09%09%09let%20cbMenu%20%3D%20this.cbMenu%3B%0A%09%09%09%09%09if%28cbMenu%29%0A%09%09%09%09%09%09df.appendChild%28cbMenu%29%3B%0A%09%09%09%09break%3B%0A%09%09%09%09case%20%22separator%22%3A%0A%09%09%09%09%09if%28df.hasChildNodes%28%29%20%26%26%20df.lastChild.localName%20%21%3D%20%22menuseparator%22%29%0A%09%09%09%09%09%09df.appendChild%28document.createElement%28%22menuseparator%22%29%29%3B%0A%09%09%09%09break%3B%0A%09%09%09%09default%3A%0A%09%09%09%09%09Components.utils.reportError%28this.errPrefix%20+%20%27Invalid%20template%20entry%3A%20%22%27%20+%20sid%20+%20%27%22%27%29%3B%0A%09%09%09%7D%0A%09%09%7D%2C%20this%29%3B%0A%0A%09%09while%28df.hasChildNodes%28%29%20%26%26%20df.lastChild.localName%20%3D%3D%20%22menuseparator%22%29%0A%09%09%09df.removeChild%28df.lastChild%29%3B%0A%0A%09%09this._undoWindowItems%20%3D%20this._undoTabItems%20%3D%20null%3B%0A%0A%09%09mp.textContent%20%3D%20%22%22%3B%0A%09%09if%28%21df.hasChildNodes%28%29%29%20%7B%0A%09%09%09mp.hidePopup%28%29%3B%0A%09%09%09return%20false%3B%0A%09%09%7D%0A%09%09mp.appendChild%28df%29%3B%0A%09%09return%20true%3B%0A%09%7D%2C%0A%09addUndoWindowsList%3A%20function%28undoPopup%29%20%7B%0A%09%09//%20Based%20on%20code%20from%20chrome%3A//browser/content/browser.js%0A%09%09//%20Mozilla/5.0%20%28Windows%3B%20U%3B%20Windows%20NT%205.1%3B%20en-US%3B%20rv%3A1.9.3a1pre%29%20Gecko/20090824%20Minefield/3.7a1pre%0A%0A%09%09var%20keys%20%3D%20this.options.accesskeys.closedWindows%3B%0A%09%09this._undoWindowItems.forEach%28function%28undoItem%2C%20i%29%20%7B%0A%09%09%09var%20tabs%20%3D%20undoItem.tabs%3B%0A%09%09%09var%20%5Bkey%2C%20keyPrefix%5D%20%3D%20this.getKey%28keys%2C%20i%29%3B%0A%09%09%09var%20title%20%3D%20undoItem.title%3B%0A%09%09%09var%20selectedTab%20%3D%20tabs%5BundoItem.selected%20-%201%5D%3B%0A%09%09%09var%20urls%20%3D%20%5B%5D%3B%0A%09%09%09tabs.forEach%28function%28tab%29%20%7B%0A%09%09%09%09if%28%21tab.entries%20%7C%7C%20%21tab.entries.length%29%20//%20Can%20be%20%5B%5D%20for%20about%3Ablank%0A%09%09%09%09%09return%3B%0A%09%09%09%09var%20url%20%3D%20this.convertURI%28tab.entries%5Btab.index%20-%201%5D.url%2C%20120%29%3B%0A%09%09%09%09var%20selectedPrefix%20%3D%20tab%20%3D%3D%20selectedTab%20%26%26%20tabs.length%20%3E%201%0A%09%09%09%09%09%3F%20this.options.windowSelectedTabPrefix%0A%09%09%09%09%09%3A%20%22%22%3B%0A%09%09%09%09urls.push%28selectedPrefix%20+%20url%29%3B%0A%09%09%09%7D%2C%20this%29%3B%0A%09%09%09var%20url%20%3D%20urls.join%28%22%20%5Cn%22%29%3B%0A%09%09%09var%20mi%20%3D%20this.createElement%28%22menuitem%22%2C%20%7B%0A%09%09%09%09label%3A%20keyPrefix%20+%20this.options.windowItemTemplate%0A%09%09%09%09%09.replace%28%22%25title%22%2C%20title%29%0A%09%09%09%09%09.replace%28%22%25count%22%2C%20tabs.length%29%2C%0A%09%09%09%09accesskey%3A%20key%2C%0A%09%09%09%09%22class%22%3A%20%22menuitem-iconic%20bookmark-item%20menuitem-with-favicon%22%2C%0A%09%09%09%09oncommand%3A%20%22undoCloseWindow%28%22%20+%20i%20+%20%22%29%3B%22%2C%0A%09%09%09%09cb_url%3A%20url%2C%0A%09%09%09%09cb_urlDecoded%3A%20this.convertURI%28url%29%2C%0A%09%09%09%09cb_closedAt%3A%20undoItem.closedAt%20%7C%7C%200%2C%0A%09%09%09%09cb_index%3A%20i%2C%0A%09%09%09%09cb_type%3A%20%22window%22%0A%09%09%09%7D%29%3B%0A%09%09%09if%28this.cm%29%0A%09%09%09%09mi.setAttribute%28%22context%22%2C%20this.cmId%29%3B%0A%09%09%09var%20icon%20%3D%20selectedTab.image%20%7C%7C%20selectedTab.attributes%20%26%26%20selectedTab.attributes.image%3B%0A%09%09%09if%28icon%29%0A%09%09%09%09mi.setAttribute%28%22image%22%2C%20this.cachedIcon%28icon%29%29%3B%0A%09%09%09if%28i%20%3D%3D%200%29%0A%09%09%09%09mi.setAttribute%28%22key%22%2C%20%22key_undoCloseWindow%22%29%3B%0A%09%09%09undoPopup.appendChild%28mi%29%3B%0A%09%09%7D%2C%20this%29%3B%0A%09%7D%2C%0A%09addUndoTabsList%3A%20function%28undoPopup%29%20%7B%0A%09%09//%20Based%20on%20code%20from%20chrome%3A//browser/content/browser.js%0A%09%09//%20Mozilla/5.0%20%28Windows%3B%20U%3B%20Windows%20NT%205.1%3B%20en-US%3B%20rv%3A1.9.3a1pre%29%20Gecko/20090824%20Minefield/3.7a1pre%0A%0A%09%09var%20keys%20%3D%20this.options.accesskeys.closedTabs%3B%0A%09%09this._undoTabItems.forEach%28function%28undoItem%2C%20i%29%20%7B%0A%09%09%09var%20state%20%3D%20undoItem.state%3B%0A%09%09%09var%20%5Bkey%2C%20keyPrefix%5D%20%3D%20this.getKey%28keys%2C%20i%29%3B%0A%09%09%09var%20title%20%3D%20undoItem.title%3B%0A%09%09%09var%20url%20%3D%20state%20%26%26%20state.entries%20%26%26%20state.entries%5Bstate.index%20-%201%5D.url%20%7C%7C%20%22%22%3B%0A%09%09%09var%20mi%20%3D%20this.createElement%28%22menuitem%22%2C%20%7B%0A%09%09%09%09label%3A%20keyPrefix%20+%20title%2C%0A%09%09%09%09accesskey%3A%20key%2C%0A%09%09%09%09class%3A%20%22menuitem-iconic%20bookmark-item%20menuitem-with-favicon%22%2C%0A%09%09%09%09oncommand%3A%20%22this.parentNode.parentNode.undoCloseTabsList.undoCloseTab%28%22%20+%20i%20+%20%22%29%3B%22%2C%0A%09%09%09%09cb_url%3A%20url%2C%0A%09%09%09%09cb_urlDecoded%3A%20this.convertURI%28url%29%2C%0A%09%09%09%09cb_closedAt%3A%20undoItem.closedAt%20%7C%7C%200%2C%0A%09%09%09%09cb_index%3A%20i%2C%0A%09%09%09%09cb_type%3A%20%22tab%22%0A%09%09%09%7D%29%3B%0A%09%09%09if%28%0A%09%09%09%09state%0A%09%09%09%09%26%26%20%22attributes%22%20in%20state%0A%09%09%09%09%26%26%20%22privateTab-isPrivate%22%20in%20state.attributes%0A%09%09%09%29%20//%20https%3A//addons.mozilla.org/addon/private-tab/%0A%09%09%09%09mi.setAttribute%28%22privateTab-isPrivate%22%2C%20%22true%22%29%3B%0A%09%09%09if%28this.cm%29%0A%09%09%09%09mi.setAttribute%28%22context%22%2C%20this.cmId%29%3B%0A%09%09%09var%20image%20%3D%20undoItem.image%20//%20Firefox%0A%09%09%09%09%7C%7C%20state%20%26%26%20state.attributes%20%26%26%20state.attributes.image%20//%20SeaMonkey%0A%09%09%09%09%7C%7C%20state%20%26%26%20state.xultab%0A%09%09%09%09%09%26%26%20/%28%3F%3A%5E%7C%20%29image%3D%28%5CS+%29/.test%28state.xultab%29%0A%09%09%09%09%09%26%26%20decodeURI%28RegExp.%241%29%3B%20//%20Only%20Firefox%202.0%20%3F%0A%09%09%09if%28image%29%0A%09%09%09%09mi.setAttribute%28%22image%22%2C%20this.cachedIcon%28image%29%29%3B%0A%09%09%09if%28i%20%3D%3D%200%29%0A%09%09%09%09mi.setAttribute%28%22key%22%2C%20%22key_undoCloseTab%22%29%3B%0A%09%09%09undoPopup.appendChild%28mi%29%3B%0A%09%09%7D%2C%20this%29%3B%0A%09%7D%2C%0A%09getKey%3A%20function%28keys%2C%20i%29%20%7B%0A%09%09var%20key%20%3D%20keys%20%26%26%20keys.charAt%28i%20%25%20keys.length%29%3B%0A%09%09var%20keyPrefix%20%3D%20keys%20%26%26%20%28key%20+%20this.options.accesskeyPostfix%29%3B%0A%09%09return%20%5Bkey%2C%20keyPrefix%5D%3B%0A%09%7D%2C%0A%09checkForMiddleClick%3A%20function%28e%2C%20upd%29%20%7B%0A%09%09var%20mi%20%3D%20e.target%3B%0A%09%09if%28%0A%09%09%09%22doCommand%22%20in%20mi%0A%09%09%09%26%26%20e.button%20%3D%3D%201%0A%09%09%09%26%26%20mi.parentNode%20%3D%3D%20e.currentTarget%0A%09%09%29%20%7B%0A%09%09%09mi.doCommand%28%29%3B%0A%09%09%09if%28upd%29%0A%09%09%09%09upd%28%29%3B%0A%09%09%09else%0A%09%09%09%09this.drawUndoList%28%29%3B%0A%09%09%7D%0A%09%7D%2C%0A%09crop%3A%20function%28s%2C%20crop%29%20%7B%0A%09%09if%28crop%20%3D%3D%20undefined%29%0A%09%09%09crop%20%3D%20500%3B%0A%09%09if%28s.length%20%3C%3D%20crop%29%0A%09%09%09return%20s%3B%0A%09%09var%20start%20%3D%20Math.round%28crop*0.6%29%3B%0A%09%09return%20s.substr%280%2C%20start%29%20+%20%22%u2026%22%20+%20s.substr%28start%20-%20crop%29%3B%0A%09%7D%2C%0A%09convertURI%3A%20function%28uri%2C%20crop%29%20%7B%0A%09%09if%28%21uri%20%7C%7C%20uri.indexOf%28%22%5Cn%22%29%20%21%3D%20-1%29%0A%09%09%09return%20uri%3B%0A%09%09try%20%7B%0A%09%09%09uri%20%3D%20%22losslessDecodeURI%22%20in%20window%0A%09%09%09%09%3F%20losslessDecodeURI%28makeURI%28uri%29%29%0A%09%09%09%09%3A%20decodeURI%28uri%29%3B%0A%09%09%7D%0A%09%09catch%28e%29%20%7B%0A%09%09%09Components.utils.reportError%28e%29%3B%0A%09%09%7D%0A%09%09return%20this.crop%28uri%2C%20crop%29%3B%0A%09%7D%2C%0A%09cachedIcon%3A%20function%28src%29%20%7B%0A%09%09src%20%3D%20src.replace%28/%5B%26%23%5D-moz-resolution%3D%5Cd+%2C%5Cd+%24/%2C%20%22%22%29%3B%20//%20Firefox%2022+%0A%09%09if%28%0A%09%09%09%21/%5Ehttps%3F%3A/.test%28src%29%0A%09%09%09//%20IDN%2C%20see%20https%3A//bugzilla.mozilla.org/show_bug.cgi%3Fid%3D311045%0A%09%09%09%7C%7C%20/%5Ehttps%3F%3A%5C/%5C/%5B%5E.%3A%5C/%5D+%5C.%5B%5Ea-z0-9-%5D+%28%3F%3A%5C/%7C%24%29/.test%28src%29%0A%09%09%09%7C%7C%20this.appName%20%3D%3D%20%22SeaMonkey%22%20%26%26%20this.appVersion%20%3C%3D%202%0A%09%09%09%7C%7C%20this.appName%20%3D%3D%20%22Firefox%22%20%20%20%26%26%20this.appVersion%20%3C%3D%203.5%0A%09%09%29%0A%09%09%09return%20src%3B%0A%09%09return%20%22moz-anno%3Afavicon%3A%22%20+%20src%3B%20//%20https%3A//bugzilla.mozilla.org/show_bug.cgi%3Fid%3D467828%0A%09%7D%2C%0A%09updUI%3A%20function%28%29%20%7B%0A%09%09var%20tabsCount%20%3D%20this.closedTabCount%3B%0A%09%09var%20dis%20%3D%20%21tabsCount%20%26%26%20%21this.closedWindowCount%3B%0A%09%09if%28%0A%09%09%09dis%0A%09%09%09%26%26%20this.options.useMenu%0A%09%09%09%26%26%20this.options.menuTemplate.indexOf%28%22restoreLastSession%22%29%20%21%3D%20-1%0A%09%09%09%26%26%20%22restoreLastSession%22%20in%20this.ss%20%26%26%20this.ss.canRestoreLastSession%0A%09%09%29%0A%09%09%09dis%20%3D%20false%3B%0A%09%09this.button.disabled%20%3D%20dis%3B%0A%09%7D%2C%0A%09updTooltip%3A%20function%28tip%2C%20tn%29%20%7B%0A%09%09var%20template%2C%20header%2C%20title%2C%20url%2C%20closedAt%3B%0A%09%09if%28tn%20%3D%3D%20this.button%29%20%7B%0A%09%09%09template%20%3D%20this.options.buttonTipTemplate%3B%0A%09%09%09header%20%3D%20_localize%28%22restoreTab%22%29%3B%0A%09%09%09let%20undoTabItems%20%3D%20JSON.parse%28this.ss.getClosedTabData%28window%29%29%3B%0A%09%09%09if%28undoTabItems.length%29%20%7B%0A%09%09%09%09let%20lastItem%20%3D%20undoTabItems%5B0%5D%3B%0A%09%09%09%09title%20%3D%20lastItem.title%3B%0A%09%09%09%09url%20%3D%20lastItem.state%20%26%26%20lastItem.state.entries%0A%09%09%09%09%09%26%26%20lastItem.state.entries%5BlastItem.state.index%20-%201%5D.url%3B%0A%09%09%09%09closedAt%20%3D%20lastItem.closedAt%20%7C%7C%200%3B%0A%09%09%09%7D%0A%09%09%7D%0A%09%09else%20if%28tn.hasAttribute%28%22cb_index%22%29%29%20%7B%0A%09%09%09template%20%3D%20this.options.itemTipTemplate%3B%0A%09%09%09title%20%3D%20tn.getAttribute%28%22label%22%29%3B%0A%09%09%09url%20%3D%20tn.getAttribute%28%22cb_url%22%29%3B%0A%09%09%09closedAt%20%3D%20+tn.getAttribute%28%22cb_closedAt%22%29%3B%0A%09%09%7D%0A%09%09else%20%7B%0A%09%09%09return%20false%3B%0A%09%09%7D%0A%0A%09%09var%20tipData%20%3D%20this.getTooltipData%28template%2C%20header%2C%20title%2C%20url%2C%20closedAt%29%3B%0A%09%09tip.textContent%20%3D%20%22%22%3B%0A%09%09tip.appendChild%28tipData%29%3B%0A%09%09if%28closedAt%20%26%26%20template.indexOf%28%22closedAt%22%29%20%21%3D%20-1%29%20%7B%0A%09%09%09tip.initUpdateTimer%28function%28%29%20%7B%0A%09%09%09%09var%20tipData%20%3D%20this.getTooltipData%28template%2C%20header%2C%20title%2C%20url%2C%20closedAt%29%3B%0A%09%09%09%09if%28tipData.textContent%20%21%3D%20tip.textContent%29%20%7B%0A%09%09%09%09%09tip.textContent%20%3D%20%22%22%3B%0A%09%09%09%09%09tip.appendChild%28tipData%29%3B%0A%09%09%09%09%7D%0A%09%09%09%7D%2C%20this%29%3B%0A%09%09%7D%0A%09%09return%20tip.hasChildNodes%28%29%3B%0A%09%7D%2C%0A%09getTooltipData%3A%20function%28template%2C%20header%2C%20title%2C%20url%2C%20closedAt%29%20%7B%0A%09%09var%20df%20%3D%20document.createDocumentFragment%28%29%3B%0A%09%09var%20hasHeader%20%3D%20header%20%26%26%20template.indexOf%28%22header%22%29%20%21%3D%20-1%3B%0A%09%09function%20item%28key%2C%20val%29%20%7B%0A%09%09%09var%20lbl%20%3D%20document.createElement%28%22label%22%29%3B%0A%09%09%09lbl.className%20%3D%20%22cb-%22%20+%20key%3B%0A%09%09%09//lbl.setAttribute%28%22value%22%2C%20val%29%3B%0A%09%09%09lbl.textContent%20%3D%20val%3B%0A%09%09%09lbl.setAttribute%28%22maxwidth%22%2C%20%22450%22%29%3B%20//%20Trick%20to%20restore%20right%20border%20for%20long%20lines%0A%09%09%09if%28key%20%3D%3D%20%22closedAt%22%20%7C%7C%20hasHeader%20%26%26%20key%20%21%3D%20%22header%22%29%0A%09%09%09%09lbl.style.color%20%3D%20%22grayText%22%3B%0A%09%09%09return%20df.appendChild%28lbl%29%3B%0A%09%09%7D%0A%09%09template.forEach%28function%28key%29%20%7B%0A%09%09%09switch%28key%29%20%7B%0A%09%09%09%09case%20%22header%22%3A%0A%09%09%09%09%09if%28header%29%0A%09%09%09%09%09%09item%28key%2C%20header%29%3B%0A%09%09%09%09break%3B%0A%09%09%09%09case%20%22title%22%3A%0A%09%09%09%09%09if%28title%20%26%26%20title%20%21%3D%20url%29%0A%09%09%09%09%09%09item%28key%2C%20title%29%3B%0A%09%09%09%09break%3B%0A%09%09%09%09case%20%22url%22%3A%0A%09%09%09%09%09if%28url%29%0A%09%09%09%09%09%09item%28key%2C%20this.convertURI%28url%29%29%3B%0A%09%09%09%09break%3B%0A%09%09%09%09case%20%22closedAt%22%3A%0A%09%09%09%09%09if%28%21closedAt%29%0A%09%09%09%09%09%09break%3B%0A%09%09%09%09%09let%20dt%20%3D%20Math.round%28Math.max%280%2C%20Date.now%28%29%20-%20closedAt%29/1000%29%3B%0A%09%09%09%09%09let%20days%20%3D%20Math.floor%28dt/24/3600%29%3B%0A%09%09%09%09%09dt%20-%3D%20days*24*3600%3B%0A%09%09%09%09%09let%20d%20%3D%20new%20Date%28%28dt%20+%20new%20Date%28dt%29.getTimezoneOffset%28%29*60%29*1000%29%3B%0A%09%09%09%09%09let%20m%20%3D%20d.getMinutes%28%29%3B%0A%09%09%09%09%09let%20ts%20%3D%20d.getHours%28%29%20+%20%22%3A%22%20+%20%28m%20%3E%209%20%3F%20m%20%3A%20%220%22%20+%20m%29%3B%0A%09%09%09%09%09if%28days%29%0A%09%09%09%09%09%09ts%20%3D%20days%20+%20_localize%28%22day%22%29%20+%20%22%20%22%20+%20ts%3B%0A%09%09%09%09%09let%20tsTip%20%3D%20_localize%28%22itemTip%22%29%0A%09%09%09%09%09%09.replace%28%22%25ago%22%2C%20ts%29%0A%09%09%09%09%09%09.replace%28%22%25date%22%2C%20new%20Date%28closedAt%29.toLocaleString%28%29%29%3B%0A%09%09%09%09%09item%28key%2C%20tsTip%29%3B%0A%09%09%09%7D%0A%09%09%7D%2C%20this%29%3B%0A%09%09return%20df%3B%0A%09%7D%2C%0A%09get%20wm%28%29%20%7B%0A%09%09delete%20this.wm%3B%0A%09%09return%20this.wm%20%3D%20Components.classes%5B%22@mozilla.org/appshell/window-mediator%3B1%22%5D%0A%09%09%09.getService%28Components.interfaces.nsIWindowMediator%29%3B%0A%09%7D%2C%0A%09updUIGlobal%3A%20function%28%29%20%7B%0A%09%09var%20isSeaMonkey%20%3D%20this.appName%20%3D%3D%20%22SeaMonkey%22%3B%0A%09%09var%20ws%20%3D%20this.wm.getEnumerator%28isSeaMonkey%20%3F%20null%20%3A%20%22navigator%3Abrowser%22%29%3B%0A%09%09const%20id%20%3D%20this.button.id%3B%0A%09%09while%28ws.hasMoreElements%28%29%29%20%7B%0A%09%09%09let%20win%20%3D%20ws.getNext%28%29%3B%0A%09%09%09if%28%21isSeaMonkey%20%7C%7C%20this.isBrowserWindow%28win%29%29%20%7B%0A%09%09%09%09let%20btn%20%3D%20win.document.getElementById%28id%29%3B%0A%09%09%09%09if%28btn%20%26%26%20%22undoCloseTabsList%22%20in%20btn%29%20%7B%0A%09%09%09%09%09let%20ucl%20%3D%20btn.undoCloseTabsList%3B%0A%09%09%09%09%09ucl.ensureSessionsInitialized%28ucl.updUI%2C%20ucl%29%3B%0A%09%09%09%09%7D%0A%09%09%09%7D%0A%09%09%7D%0A%09%7D%2C%0A%09isBrowserWindow%3A%20function%28win%29%20%7B%0A%09%09var%20loc%20%3D%20window.location.href%3B%0A%09%09return%20loc%20%3D%3D%20%22chrome%3A//browser/content/browser.xul%22%0A%09%09%09%7C%7C%20loc%20%3D%3D%20%22chrome%3A//navigator/content/navigator.xul%22%3B%0A%09%7D%2C%0A%09ensureSessionsInitialized%3A%20function%28callback%2C%20context%29%20%7B%0A%09%09var%20_this%20%3D%20this%3B%0A%09%09var%20stopTime%20%3D%20Date.now%28%29%20+%203e3%3B%0A%09%09%28function%20ensureInitialized%28%29%20%7B%0A%09%09%09try%20%7B%0A%09%09%09%09_this.ss.getClosedTabCount%28window%29%3B%0A%09%09%09%09callback.call%28context%29%3B%0A%09%09%09%09return%3B%0A%09%09%09%7D%0A%09%09%09catch%28e%29%20%7B%0A%09%09%09%09if%28Date.now%28%29%20%3E%20stopTime%29%20%7B%0A%09%09%09%09%09Components.utils.reportError%28%0A%09%09%09%09%09%09_this.errPrefix%0A%09%09%09%09%09%09+%20%22Can%27t%20initialize%3A%20nsISessionStore.getClosedTabCount%28%29%20failed%22%0A%09%09%09%09%09%29%3B%0A%09%09%09%09%09Components.utils.reportError%28e%29%3B%0A%09%09%09%09%09return%3B%0A%09%09%09%09%7D%0A%09%09%09%7D%0A%09%09%09setTimeout%28ensureInitialized%2C%2050%29%3B%0A%09%09%7D%29%28%29%3B%0A%09%7D%0A%7D%3B%0A%0Aif%28%21this.undoCloseTabsList.options.useMenu%20%26%26%20this.undoCloseTabsList.useCentextMenu%29%20%7B%0A%09this.oncontextmenu%20%3D%20function%28e%29%20%7B%0A%09%09if%28%0A%09%09%09e.target%20%21%3D%20this%0A%09%09%09%7C%7C%20e.ctrlKey%20%7C%7C%20e.shiftKey%20%7C%7C%20e.altKey%20%7C%7C%20e.metaKey%0A%09%09%09%7C%7C%20%21this.undoCloseTabsList.mp.hasChildNodes%28%29%0A%09%09%29%0A%09%09%09return%3B%0A%09%09e.preventDefault%28%29%3B%0A%09%09this.undoCloseTabsList.showMenu%28e%29%3B%20//%20Show%20menu%20without%20%22context%22%20flag%0A%09%7D%3B%0A%7D%0Aif%28this.undoCloseTabsList.options.rightClickToUndoCloseTab%29%20%7B%0A%09this.oncontextmenu%20%3D%20function%28e%29%20%7B%0A%09%09if%28e.target%20%3D%3D%20this%20%26%26%20%21e.ctrlKey%20%26%26%20%21e.shiftKey%20%26%26%20%21e.altKey%20%26%26%20%21e.metaKey%29%0A%09%09%09e.preventDefault%28%29%3B%0A%09%7D%3B%0A%7D%0A%0Athis.disabled%20%3D%20true%3B%0AsetTimeout%28function%28_this%29%20%7B%0A%09_this.undoCloseTabsList.init%28%29%3B%0A%7D%2C%200%2C%20this%29%3B%0A%0A%0Aif%28this.undoCloseTabsList.options.useMenu%29%20%7B%0A%09this.type%20%3D%20%22menu%22%3B%0A%09this.orient%20%3D%20%22horizontal%22%3B%0A%7D%0A%0A%5D%5D%3E%3C/initcode%3E%0A%20%20%3Ccode%3E%3C%21%5BCDATA%5B/*CODE*/%5D%5D%3E%3C/code%3E%0A%20%20%3Caccelkey%3E%3C%21%5BCDATA%5B%5D%5D%3E%3C/accelkey%3E%0A%20%20%3Chelp%3E%3C%21%5BCDATA%5B%5D%5D%3E%3C/help%3E%0A%20%20%3Cattributes/%3E%0A%3C/custombutton%3E |
SendInfo > 26-02-2018 20:29:20 |
drage2 пишет
Можно так кнопка с прилепленной иконкой Выделить код Код:custombutton://%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%0A%3Ccustombutton%20xmlns%3Acb%3D%22http%3A//xsms.nm.ru/custombuttons/%22%3E%0A%20%20%3Cname%3EUndo%20Close%20Tabs%3C/name%3E%0A%20%20%3Cimage%3E%3C%21%5BCDATA%5Bcustombuttons-stdicon-1%5D%5D%3E%3C/image%3E%0A%20%20%3Cmode%3E0%3C/mode%3E%0A%20%20%3Cinitcode%3E%3C%21%5BCDATA%5B//%20http%3A//infocatcher.ucoz.net/js/cb/undoCloseTabs.js%0A//%20https%3A//forum.mozilla-russia.org/viewtopic.php%3Fid%3D56267%0A//%20https%3A//github.com/Infocatcher/Custom_Buttons/tree/master/Undo_Close_Tabs%0A%0A//%20Undo%20Close%20Tabs%20button%20for%20Custom%20Buttons%0A//%20%28code%20for%20%22initialization%22%20section%29%0A%0A//%20%28c%29%20Infocatcher%202009-2014%0A//%20version%200.3.3%20-%202014-10-12%0A%0Avar%20options%20%3D%20%7B%0A%09menuTemplate%3A%20%5B%0A%09%09%22closedWindows%22%2C%0A%09%09%22separator%22%2C%0A%09%09%22restoreClosedWindows%22%2C%0A%09%09%22clearClosedWindows%22%2C%0A%09%09%22separator%22%2C%0A%09%09%22closedTabs%22%2C%0A%09%09%22separator%22%2C%0A%09%09%22restoreClosedTabs%22%2C%0A%09%09%22clearClosedTabs%22%2C%0A%09%09%22separator%22%2C%0A%09%09%22clearAll%22%2C%0A%09%09%22separator%22%2C%0A%09%09%22restoreLastSession%22%2C%0A%09%09%22separator%22%2C%0A%09%09%22buttonMenu%22%0A%09%5D%2C%0A%09showInTabContextMenu%3A%20false%2C%0A%09/*%0A%09menuTemplateTabContext%3A%20%5B%20//%20like%20menuTemplate%0A%09%09%22closedTabs%22%2C%0A%09%09%22separator%22%2C%0A%09%09%22restoreClosedTabs%22%2C%0A%09%09%22clearClosedTabs%22%0A%09%5D%2C%0A%09*/%0A%09windowItemTemplate%3A%20%22%28%25count%29%20%25title%22%2C%0A%09windowSelectedTabPrefix%3A%20%22*%22%2C%0A%09buttonTipTemplate%3A%20%5B%22header%22%2C%20%22title%22%2C%20%22url%22%2C%20%22closedAt%22%5D%2C%0A%09itemTipTemplate%3A%20%5B%22title%22%2C%20%22url%22%2C%20%22closedAt%22%5D%2C%0A%09hideRestoreAllForSingleEntry%3A%20false%2C%0A%09allowDeleteEntries%3A%20true%2C%0A%09accesskeys%3A%20%7B%20//%20Empty%20string%20%28%22%22%29%20to%20disable%20or%20string%20with%20possible%20values%20%28%220123...%22%2C%20%22abcd...%22%29%0A%09%09closedTabs%3A%20%22%22%2C%0A%09%09closedWindows%3A%20%22%22%0A%09%7D%2C%0A%09accesskeyPostfix%3A%20%22%20%22%2C%20//%20%3Caccesskey%3E%3Cpostfix%3E%3Clabel%3E%0A%09openMenuOnMouseover%3A%20false%2C%0A%09useMenu%3A%20false%2C%0A%09rightClickToUndoCloseTab%3A%20false%20//%20Useful%20with%20%22useMenu%3A%20true%22%0A%7D%3B%0A%0Afunction%20_localize%28sid%29%20%7B%0A%09var%20strings%20%3D%20%7B%0A%09%09en%3A%20%7B%0A%09%09%09restoreTab%3A%20%22Restore%20the%20most%20recently%20closed%20tab%22%2C%0A%0A%09%09%09restoreAllTabs%3A%20%22Restore%20all%20tabs%22%2C%0A%09%09%09restoreAllTabsAccesskey%3A%20%22t%22%2C%0A%09%09%09clearTabsHistory%3A%20%22Clear%20history%20of%20closed%20tabs%22%2C%0A%09%09%09clearTabsHistoryAccesskey%3A%20%22b%22%2C%0A%0A%09%09%09restoreAllWindows%3A%20%22Restore%20all%20windows%22%2C%0A%09%09%09restoreAllWindowsAccesskey%3A%20%22w%22%2C%0A%09%09%09clearWindowsHistory%3A%20%22Clear%20history%20of%20closed%20windows%22%2C%0A%09%09%09clearWindowsHistoryAccesskey%3A%20%22d%22%2C%0A%0A%09%09%09clearAllHistory%3A%20%22Clear%20all%20history%22%2C%0A%09%09%09clearAllHistoryAccesskey%3A%20%22C%22%2C%0A%0A%09%09%09restoreLastSession%3A%20%22Restore%20last%20session%22%2C%0A%09%09%09restoreLastSessionAccesskey%3A%20%22s%22%2C%0A%0A%09%09%09deleteUndoEntry%3A%20%22Delete%22%2C%0A%0A%09%09%09buttonMenu%3A%20%22Button%20menu%22%2C%0A%09%09%09buttonMenuAccesskey%3A%20%22m%22%2C%0A%0A%09%09%09tabContextMenu%3A%20%22Recently%20Closed%20Tabs%22%2C%0A%09%09%09tabContextMenuAccesskey%3A%20%22y%22%2C%0A%0A%09%09%09itemTip%3A%20%22%25ago%20ago%2C%20%25date%22%2C%0A%09%09%09day%3A%20%22d%22%0A%09%09%7D%2C%0A%09%09ru%3A%20%7B%0A%09%09%09restoreTab%3A%20%22%u0412%u043E%u0441%u0441%u0442%u0430%u043D%u043E%u0432%u0438%u0442%u044C%20%u043F%u043E%u0441%u043B%u0435%u0434%u043D%u044E%u044E%20%u0437%u0430%u043A%u0440%u044B%u0442%u0443%u044E%20%u0432%u043A%u043B%u0430%u0434%u043A%u0443%22%2C%0A%0A%09%09%09restoreAllTabs%3A%20%22%u0412%u043E%u0441%u0441%u0442%u0430%u043D%u043E%u0432%u0438%u0442%u044C%20%u0432%u0441%u0435%20%u0432%u043A%u043B%u0430%u0434%u043A%u0438%22%2C%0A%09%09%09restoreAllTabsAccesskey%3A%20%22%u043B%22%2C%0A%09%09%09clearTabsHistory%3A%20%22%u041E%u0447%u0438%u0441%u0442%u0438%u0442%u044C%20%u0438%u0441%u0442%u043E%u0440%u0438%u044E%20%u0437%u0430%u043A%u0440%u044B%u0442%u044B%u0445%20%u0432%u043A%u043B%u0430%u0434%u043E%u043A%22%2C%0A%09%09%09clearTabsHistoryAccesskey%3A%20%22%u0434%22%2C%0A%0A%09%09%09restoreAllWindows%3A%20%22%u0412%u043E%u0441%u0441%u0442%u0430%u043D%u043E%u0432%u0438%u0442%u044C%20%u0432%u0441%u0435%20%u043E%u043A%u043D%u0430%22%2C%0A%09%09%09restoreAllWindowsAccesskey%3A%20%22%u043E%22%2C%0A%09%09%09clearWindowsHistory%3A%20%22%u041E%u0447%u0438%u0441%u0442%u0438%u0442%u044C%20%u0438%u0441%u0442%u043E%u0440%u0438%u044E%20%u0437%u0430%u043A%u0440%u044B%u0442%u044B%u0445%20%u043E%u043A%u043E%u043D%22%2C%0A%09%09%09clearWindowsHistoryAccesskey%3A%20%22%u043D%22%2C%0A%0A%09%09%09clearAllHistory%3A%20%22%u041E%u0447%u0438%u0441%u0442%u0438%u0442%u044C%20%u0432%u0441%u044E%20%u0438%u0441%u0442%u043E%u0440%u0438%u044E%22%2C%0A%09%09%09clearAllHistoryAccesskey%3A%20%22%u0447%22%2C%0A%0A%09%09%09restoreLastSession%3A%20%22%u0412%u043E%u0441%u0441%u0442%u0430%u043D%u043E%u0432%u0438%u0442%u044C%20%u043F%u043E%u0441%u043B%u0435%u0434%u043D%u044E%u044E%20%u0441%u0435%u0441%u0441%u0438%u044E%22%2C%0A%09%09%09restoreLastSessionAccesskey%3A%20%22%u0441%22%2C%0A%0A%09%09%09deleteUndoEntry%3A%20%22%u0423%u0434%u0430%u043B%u0438%u0442%u044C%22%2C%0A%0A%09%09%09buttonMenu%3A%20%22%u041C%u0435%u043D%u044E%20%u043A%u043D%u043E%u043F%u043A%u0438%22%2C%0A%09%09%09buttonMenuAccesskey%3A%20%22%u041C%22%2C%0A%0A%09%09%09tabContextMenu%3A%20%22%u041D%u0435%u0434%u0430%u0432%u043D%u043E%20%u0437%u0430%u043A%u0440%u044B%u0442%u044B%u0435%20%u0432%u043A%u043B%u0430%u0434%u043A%u0438%22%2C%0A%09%09%09tabContextMenuAccesskey%3A%20%22%u043E%22%2C%0A%0A%09%09%09itemTip%3A%20%22%25ago%20%u043D%u0430%u0437%u0430%u0434%2C%20%25date%22%2C%0A%09%09%09day%3A%20%22%u0434%22%0A%09%09%7D%0A%09%7D%3B%0A%09var%20locale%20%3D%20%28function%28%29%20%7B%0A%09%09if%28%22Services%22%20in%20window%20%26%26%20Services.locale%20%26%26%20Services.locale.getRequestedLocales%29%20%7B%0A%09%09%09var%20locales%20%3D%20Services.locale.getRequestedLocales%28%29%3B%0A%09%09%09return%20locales%20%26%26%20locales%5B0%5D%3B%0A%09%09%7D%0A%09%09var%20prefs%20%3D%20%22Services%22%20in%20window%20%26%26%20Services.prefs%0A%09%09%09%7C%7C%20Components.classes%5B%22@mozilla.org/preferences-service%3B1%22%5D%0A%09%09%09%09.getService%28Components.interfaces.nsIPrefBranch%29%3B%0A%09%09function%20pref%28name%2C%20type%29%20%7B%0A%09%09%09return%20prefs.getPrefType%28name%29%20%21%3D%20prefs.PREF_INVALID%20%3F%20prefs%5B%22get%22%20+%20type%20+%20%22Pref%22%5D%28name%29%20%3A%20undefined%3B%0A%09%09%7D%0A%09%09if%28%21pref%28%22intl.locale.matchOS%22%2C%20%22Bool%22%29%29%20%7B%20//%20Also%20see%20https%3A//bugzilla.mozilla.org/show_bug.cgi%3Fid%3D1414390%0A%09%09%09var%20locale%20%3D%20pref%28%22general.useragent.locale%22%2C%20%22Char%22%29%3B%0A%09%09%09if%28locale%20%26%26%20locale.substr%280%2C%209%29%20%21%3D%20%22chrome%3A//%22%29%0A%09%09%09%09return%20locale%3B%0A%09%09%7D%0A%09%09return%20Components.classes%5B%22@mozilla.org/chrome/chrome-registry%3B1%22%5D%0A%09%09%09.getService%28Components.interfaces.nsIXULChromeRegistry%29%0A%09%09%09.getSelectedLocale%28%22global%22%29%3B%0A%09%7D%29%28%29.match%28/%5E%5Ba-z%5D*/%29%5B0%5D%3B%0A%09_localize%20%3D%20function%28sid%29%20%7B%0A%09%09return%20strings%5Blocale%5D%20%26%26%20strings%5Blocale%5D%5Bsid%5D%20%7C%7C%20strings.en%5Bsid%5D%20%7C%7C%20sid%3B%0A%09%7D%3B%0A%09return%20_localize.apply%28this%2C%20arguments%29%3B%0A%7D%0A%0Avar%20JSON%20%3D%20%22JSON%22%20in%20window%0A%09%3F%20window.JSON%0A%09%3A%20%22nsIJSON%22%20in%20Components.interfaces%0A%09%09%3F%20%7B%0A%09%09%09parse%3A%20function%28s%29%20%7B%0A%09%09%09%09return%20Components.classes%5B%22@mozilla.org/dom/json%3B1%22%5D%0A%09%09%09%09%09.createInstance%28Components.interfaces.nsIJSON%29%0A%09%09%09%09%09.decode%28s%29%3B%0A%09%09%09%7D%0A%09%09%7D%0A%09%09%3A%20%7B%0A%09%09%09parse%3A%20function%28s%29%20%7B%0A%09%09%09%09return%20Components.utils.evalInSandbox%28%22%28%22%20+%20s%20+%20%22%29%22%2C%20new%20Components.utils.Sandbox%28%22about%3Ablank%22%29%29%3B%0A%09%09%09%7D%0A%09%09%7D%3B%0A%0Athis.onclick%20%3D%20function%28e%29%20%7B%0A%09if%28e.target%20%21%3D%20this%29%0A%09%09return%3B%0A%09if%28e.button%20%3D%3D%201%20%7C%7C%20e.button%20%3D%3D%200%20%26%26%20%28e.ctrlKey%20%7C%7C%20e.shiftKey%20%7C%7C%20e.altKey%20%7C%7C%20e.metaKey%29%29%0A%09%09this.undoCloseTabsList.clearAllLists%28%29%3B%0A%09else%20if%28%0A%09%09e.button%20%3D%3D%200%0A%09%09%7C%7C%20e.button%20%3D%3D%202%20%26%26%20%21e.ctrlKey%20%26%26%20%21e.shiftKey%20%26%26%20%21e.altKey%20%26%26%20%21e.metaKey%0A%09%09%09%26%26%20this.undoCloseTabsList.options.rightClickToUndoCloseTab%0A%09%29%20%7B%0A%09%09if%28%0A%09%09%09e.button%20%3D%3D%200%20%26%26%20%21this.undoCloseTabsList.options.useMenu%0A%09%09%09%7C%7C%20e.button%20%3D%3D%202%20%26%26%20this.undoCloseTabsList.options.rightClickToUndoCloseTab%0A%09%09%29%20%7B%0A%09%09%09if%28this.undoCloseTabsList.closedTabCount%29%0A%09%09%09%09this.undoCloseTabsList.undoCloseTab%28%29%3B%0A%09%09%09else%0A%09%09%09%09this.undoCloseTabsList.drawUndoList%28%29%20%26%26%20this.undoCloseTabsList.showMenu%28e%29%3B%0A%09%09%7D%0A%09%09//%20Allow%20use%20%22command%22%20section%20only%20from%20hotkey%3A%0A%09%09e.preventDefault%28%29%3B%0A%09%09e.stopPropagation%28%29%3B%0A%09%7D%0A%7D%3B%0Aif%28%21this.hasOwnProperty%28%22defaultContextId%22%29%29%0A%09this.defaultContextId%20%3D%20this.getAttribute%28%22context%22%29%20%7C%7C%20%22custombuttons-contextpopup%22%3B%0Athis.onmousedown%20%3D%20function%28e%29%20%7B%0A%09if%28e.target%20%21%3D%20this%29%0A%09%09return%3B%0A%09if%28this.undoCloseTabsList.options.useMenu%29%20%7B%0A%09%09if%28e.button%20%3D%3D%200%29%0A%09%09%09this.undoCloseTabsList.drawUndoList%28%29%3B%0A%09%7D%0A%09else%20if%28e.button%20%3D%3D%202%29%20%7B%0A%09%09var%20showCbMenu%20%3D%20e.ctrlKey%20%7C%7C%20e.shiftKey%20%7C%7C%20e.altKey%20%7C%7C%20e.metaKey%20%7C%7C%20%21this.undoCloseTabsList.drawUndoList%28%29%3B%0A%09%09this.setAttribute%28%0A%09%09%09%22context%22%2C%0A%09%09%09showCbMenu%0A%09%09%09%09%3F%20this.defaultContextId%0A%09%09%09%09%3A%20this.undoCloseTabsList.mpId%0A%09%09%29%3B%0A%09%7D%0A%7D%3B%0Athis.onmouseover%20%3D%20function%28e%29%20%7B%0A%09if%28e.target%20%21%3D%20this%29%0A%09%09return%3B%0A%09if%28%21this.disabled%29%0A%09%09this.undoCloseTabsList.updUI%28%29%3B%0A%09this.undoCloseTabsList.options.useMenu%20%26%26%20Array.prototype.some.call%28%0A%09%09this.parentNode.getElementsByTagName%28%22*%22%29%2C%0A%09%09function%28node%29%20%7B%0A%09%09%09if%28%0A%09%09%09%09node%20%21%3D%20this%0A%09%09%09%09%26%26%20node.namespaceURI%20%3D%3D%20xulns%0A%09%09%09%09%26%26%20node.boxObject%0A%09%09%09%09//%20See%20https%3A//github.com/Infocatcher/Custom_Buttons/issues/28%0A%09%09%09%09//%26%26%20node.boxObject%20instanceof%20Components.interfaces.nsIMenuBoxObject%0A%09%09%09%09%26%26%20%22open%22%20in%20node%0A%09%09%09%09%26%26%20node.open%0A%09%09%09%09%26%26%20node.getElementsByTagName%28%22menupopup%22%29.length%0A%09%09%09%09%26%26%20this.undoCloseTabsList.drawUndoList%28%29%0A%09%09%09%29%20%7B%0A%09%09%09%09node.open%20%3D%20false%3B%0A%09%09%09%09this.open%20%3D%20true%3B%0A%09%09%09%09return%20true%3B%0A%09%09%09%7D%0A%09%09%09return%20false%3B%0A%09%09%7D%2C%0A%09%09this%0A%09%29%3B%0A%09if%28%0A%09%09this.undoCloseTabsList.options.openMenuOnMouseover%0A%09%09%26%26%20this.undoCloseTabsList.drawUndoList%28%29%0A%09%29%0A%09%09this.undoCloseTabsList.openMenu%28%29%3B%0A%7D%3B%0A%0Athis.undoCloseTabsList%20%3D%20%7B%0A%09button%3A%20this%2C%0A%09options%3A%20options%2C%0A%09mpId%3A%20this.id%20+%20%22-context%22%2C%0A%09cmId%3A%20this.id%20+%20%22-contextSub%22%2C%0A%09tcmId%3A%20this.id%20+%20%22-tabContextMenu%22%2C%0A%09tipId%3A%20this.id%20+%20%22-tooltip%22%2C%0A%09errPrefix%3A%20%22%5BCustom%20Buttons%20%3A%3A%20Undo%20Close%20Tabs%20List%5D%3A%20%22%2C%0A%09get%20mp%28%29%20%7B%0A%09%09var%20btn%20%3D%20this.button%3B%0A%09%09var%20mp%20%3D%20btn.getElementsByTagName%28%22menupopup%22%29%3B%0A%09%09mp%20%3D%20mp.length%20%26%26%20mp%5B0%5D%3B%0A%09%09mp%20%26%26%20mp.parentNode.removeChild%28mp%29%3B%0A%09%09mp%20%3D%20this.createElement%28%22menupopup%22%2C%20%7B%0A%09%09%09id%3A%20this.mpId%2C%0A%09%09%09onclick%3A%20%22this.parentNode.undoCloseTabsList.checkForMiddleClick%28event%29%3B%22%2C%0A%09%09%09onpopupshowing%3A%20%22if%28event.target%20%3D%3D%20this%29%20document.popupNode%20%3D%20this.parentNode%3B%22%2C%0A%09%09%09onpopuphidden%3A%20%22if%28event.target%20%3D%3D%20this%29%20document.popupNode%20%3D%20null%3B%22%0A%09%09%7D%29%3B%0A%09%09if%28this.cm%29%0A%09%09%09mp.setAttribute%28%22context%22%2C%20this.cmId%29%3B%0A%09%09var%20tb%20%3D%20btn.parentNode%3B%0A%09%09if%28%0A%09%09%09this.options.useMenu%0A%09%09%09%26%26%20tb.getAttribute%28%22orient%22%29%20%3D%3D%20%22vertical%22%0A%09%09%29%20%7B%0A%09%09%09//%20https%3A//addons.mozilla.org/firefox/addon/vertical-toolbar/%0A%09%09%09var%20isRight%20%3D%20tb.parentNode.getAttribute%28%22placement%22%29%20%3D%3D%20%22right%22%3B%0A%09%09%09mp.setAttribute%28%22position%22%2C%20isRight%20%3F%20%22start_before%22%20%3A%20%22end_before%22%29%3B%0A%09%09%7D%0A%09%09delete%20this.mp%3B%0A%09%09return%20this.mp%20%3D%20btn.appendChild%28mp%29%3B%0A%09%7D%2C%0A%09get%20useCentextMenu%28%29%20%7B%0A%09%09delete%20this.useCentextMenu%3B%0A%09%09return%20this.useCentextMenu%20%3D%20this.options.allowDeleteEntries%0A%09%09%09%26%26%20%28%22forgetClosedTab%22%20in%20this.ss%20%7C%7C%20%22forgetClosedWindow%22%20in%20this.ss%29%3B%0A%09%7D%2C%0A%09get%20cm%28%29%20%7B%0A%09%09delete%20this.cm%3B%0A%09%09if%28%21this.useCentextMenu%29%0A%09%09%09return%20this.cm%20%3D%20null%3B%0A%09%09var%20cm%20%3D%20document.getElementById%28this.cmId%29%3B%0A%09%09cm%20%26%26%20cm.parentNode.removeChild%28cm%29%3B%0A%09%09cm%20%3D%20this.createElement%28%22menupopup%22%2C%20%7B%0A%09%09%09id%3A%20this.cmId%2C%0A%09%09%09onpopupshowing%3A%20%22return%20this.undoCloseTabsList.canDeleteUndoEntry%28this.triggerNode%20%7C%7C%20document.popupNode%29%3B%22%0A%09%09%7D%29%3B%0A%09%09var%20mi%20%3D%20this.createElement%28%22menuitem%22%2C%20%7B%0A%09%09%09oncommand%3A%20%22this.parentNode.undoCloseTabsList.deleteUndoEntry%28this.parentNode.triggerNode%20%7C%7C%20document.popupNode%29%3B%22%2C%0A%09%09%09label%3A%20_localize%28%22deleteUndoEntry%22%29%2C%0A%09%09%09closemenu%3A%20%22single%22%0A%09%09%7D%29%3B%0A%09%09cm.appendChild%28mi%29%3B%0A%09%09cm.undoCloseTabsList%20%3D%20this%3B%0A%09%09return%20this.cm%20%3D%20document.getElementById%28%22mainPopupSet%22%29.appendChild%28cm%29%3B%0A%09%7D%2C%0A%09get%20cbMenu%28%29%20%7B%0A%09%09var%20cbPopup%20%3D%20document.getElementById%28this.button.defaultContextId%29%3B%0A%09%09if%28%21cbPopup%29%20%7B%0A%09%09%09Components.utils.reportError%28this.errPrefix%20+%20%22cb%20menu%20not%20found%22%29%3B%0A%09%09%09return%20this.cbMenu%20%3D%20null%3B%0A%09%09%7D%0A%09%09cbPopup%20%3D%20cbPopup.cloneNode%28true%29%3B%0A%09%09var%20id%20%3D%20%22-%22%20+%20this.button.id.match%28/%5Cd*%24/%29%5B0%5D%20+%20%22-cloned%22%3B%0A%09%09cbPopup.id%20+%3D%20id%3B%0A%09%09Array.prototype.slice.call%28cbPopup.getElementsByAttribute%28%22id%22%2C%20%22*%22%29%29.forEach%28function%28node%29%20%7B%0A%09%09%09node.id%20+%3D%20id%3B%0A%09%09%7D%29%3B%0A%09%09var%20menu%20%3D%20this.createElement%28%22menu%22%2C%20%7B%0A%09%09%09label%3A%20_localize%28%22buttonMenu%22%29%2C%0A%09%09%09accesskey%3A%20_localize%28%22buttonMenuAccesskey%22%29%0A%09%09%7D%29%3B%0A%09%09menu.appendChild%28cbPopup%29%3B%0A%09%09cbPopup.setAttribute%28%0A%09%09%09%22onpopupshowing%22%2C%0A%09%09%09%27%5C%0A%09%09%09var%20btn%20%3D%20document.popupNode%20%3D%20this.parentNode.parentNode.parentNode%5Cn%5C%0A%09%09%09%09.undoCloseTabsList.button%3B%5Cn%5C%0A%09%09%09custombutton.setContextMenuVisibility%28btn%29%3B%27%0A%09%09%29%3B%0A%09%09delete%20this.cbMenu%3B%0A%09%09return%20this.cbMenu%20%3D%20menu%3B%0A%09%7D%2C%0A%09get%20ss%28%29%20%7B%0A%09%09delete%20this.ss%3B%0A%09%09return%20this.ss%20%3D%20%28%0A%09%09%09Components.classes%5B%22@mozilla.org/browser/sessionstore%3B1%22%5D%0A%09%09%09%7C%7C%20Components.classes%5B%22@mozilla.org/suite/sessionstore%3B1%22%5D%0A%09%09%29.getService%28Components.interfaces.nsISessionStore%29%3B%0A%09%7D%2C%0A%09get%20appInfo%28%29%20%7B%0A%09%09delete%20this.appInfo%3B%0A%09%09return%20this.appInfo%20%3D%20Components.classes%5B%22@mozilla.org/xre/app-info%3B1%22%5D%0A%09%09%09.getService%28Components.interfaces.nsIXULAppInfo%29%3B%0A%09%7D%2C%0A%09get%20appVersion%28%29%20%7B%0A%09%09delete%20this.appVersion%3B%0A%09%09return%20this.appVersion%20%3D%20parseFloat%28this.appInfo.version%29%3B%0A%09%7D%2C%0A%09get%20appName%28%29%20%7B%0A%09%09delete%20this.appName%3B%0A%09%09return%20this.appName%20%3D%20this.appInfo.name%3B%0A%09%7D%2C%0A%0A%09init%3A%20function%28%29%20%7B%0A%09%09window.addEventListener%28%22TabClose%22%2C%20%20%20%20%20%20%20this%2C%20false%29%3B%0A%09%09window.addEventListener%28%22SSTabRestoring%22%2C%20this%2C%20false%29%3B%0A%09%09window.addEventListener%28%22unload%22%2C%20%20%20%20%20%20%20%20%20this%2C%20false%29%3B%0A%09%09if%28this.appName%20%3D%3D%20%22SeaMonkey%22%29%20//%20No%20SSTab*%20events%20in%20SeaMonkey%0A%09%09%09window.addEventListener%28%22TabOpen%22%2C%20this%2C%20false%29%3B%0A%09%09setTimeout%28function%28_this%29%20%7B%0A%09%09%09_this.mp.addEventListener%28%22DOMMenuItemActive%22%2C%20%20%20_this%2C%20false%29%3B%0A%09%09%09_this.mp.addEventListener%28%22DOMMenuItemInactive%22%2C%20_this%2C%20false%29%3B%0A%09%09%09_this.initTooltip%28%29%3B%0A%09%09%7D%2C%2050%2C%20this%29%3B%0A%09%09this.addPbExitObserver%28true%29%3B%0A%09%09this.updUIGlobal%28%29%3B%0A%09%09if%28this.options.showInTabContextMenu%29%20setTimeout%28function%28_this%29%20%7B%0A%09%09%09_this.initTabContext%28%29%3B%0A%09%09%7D%2C%20100%2C%20this%29%3B%0A%09%7D%2C%0A%09initTabContext%3A%20function%28%29%20%7B%0A%09%09var%20origMi%20%3D%20this.tabContextUndoClose%3B%0A%09%09if%28%21origMi%29%20%7B%0A%09%09%09LOG%28%22Can%27t%20find%20%5C%22Undo%20Close%20Tab%5C%22%20item%20in%20tab%20context%20menu%22%29%3B%0A%09%09%09return%3B%0A%09%09%7D%0A%09%09var%20menu%20%3D%20document.getElementById%28this.tcmId%29%3B%0A%09%09menu%20%26%26%20menu.parentNode.removeChild%28menu%29%3B%20//%20For%20SeaMonkey%0A%09%09menu%20%3D%20this.createElement%28%22menu%22%2C%20%7B%0A%09%09%09id%3A%20this.tcmId%2C%0A%09%09%09label%3A%20_localize%28%22tabContextMenu%22%29%2C%0A%09%09%09accesskey%3A%20_localize%28%22tabContextMenuAccesskey%22%29%2C%0A%09%09%09tooltip%3A%20this.tipId%2C%0A%09%09%09popupsinherittooltip%3A%20%22true%22%0A%09%09%7D%29%3B%0A%09%09menu.undoCloseTabsList%20%3D%20this%3B%0A%09%09menu.onclick%20%3D%20function%28e%29%20%7B%0A%09%09%09if%28e.target%20%21%3D%20this%29%0A%09%09%09%09return%3B%0A%09%09%09if%28e.button%20%3D%3D%201%20%7C%7C%20e.button%20%3D%3D%200%20%26%26%20%28e.ctrlKey%20%7C%7C%20e.shiftKey%20%7C%7C%20e.altKey%20%7C%7C%20e.metaKey%29%29%20%7B%0A%09%09%09%09if%28this.undoCloseTabsList.closedTabCount%29%20%7B%0A%09%09%09%09%09this.undoCloseTabsList.undoCloseTab%28%29%3B%0A%09%09%09%09%09closeMenus%28this%29%3B%0A%09%09%09%09%7D%0A%09%09%09%7D%0A%09%09%7D%3B%0A%09%09var%20origMp%20%3D%20this.mp%3B%0A%09%09var%20mp%20%3D%20origMp.cloneNode%28true%29%3B%0A%09%09mp.id%20%3D%20this.button.id%20+%20%22-tabContext%22%3B%0A%09%09var%20_this%20%3D%20this%3B%0A%09%09function%20drawUndoList%28%29%20%7B%0A%09%09%09var%20ok%20%3D%20false%3B%0A%09%09%09var%20opts%20%3D%20_this.options%3B%0A%09%09%09var%20origTemplate%20%3D%20opts.menuTemplate%3B%0A%09%09%09opts.menuTemplate%20%3D%20opts.menuTemplateTabContext%20%7C%7C%20origTemplate%3B%0A%09%09%09_this.mp%20%3D%20mp%3B%0A%09%09%09try%20%7B%0A%09%09%09%09ok%20%3D%20_this.drawUndoList%28%29%3B%0A%09%09%09%7D%0A%09%09%09catch%28e%29%20%7B%0A%09%09%09%09Components.utils.reportError%28e%29%3B%0A%09%09%09%7D%0A%09%09%09opts.menuTemplate%20%3D%20origTemplate%3B%0A%09%09%09_this.mp%20%3D%20origMp%3B%0A%09%09%09return%20ok%3B%0A%09%09%7D%0A%09%09function%20updMenu%28%29%20%7B%0A%09%09%09if%28drawUndoList%28%29%29%0A%09%09%09%09menu.removeAttribute%28%22disabled%22%29%3B%0A%09%09%09else%0A%09%09%09%09menu.setAttribute%28%22disabled%22%2C%20%22true%22%29%3B%0A%09%09%7D%0A%09%09mp._updatePopup%20%3D%20function%28e%29%20%7B%0A%09%09%09if%28e.target%20%21%3D%20this%29%0A%09%09%09%09return%3B%0A%09%09%09document.popupNode%20%3D%20_this.button%3B%0A%09%09%09drawUndoList%28%29%3B%0A%09%09%7D%3B%0A%09%09mp.setAttribute%28%22onpopupshowing%22%2C%20%22this._updatePopup%28event%29%3B%22%29%3B%0A%09%09mp.onclick%20%3D%20function%28e%29%20%7B%0A%09%09%09_this.checkForMiddleClick%28e%2C%20updMenu%29%3B%0A%09%09%7D%3B%0A%09%09menu.appendChild%28mp%29%3B%0A%09%09addEventListener%28%22popupshown%22%2C%20function%28e%29%20%7B%0A%09%09%09if%28e.target%20%3D%3D%20e.currentTarget%29%0A%09%09%09%09setTimeout%28updMenu%2C%200%29%3B%20//%20Pseudo%20async%0A%09%09%7D%2C%20false%2C%20origMi.parentNode%29%3B%0A%09%09addEventListener%28%22DOMMenuItemActive%22%2C%20%20%20this%2C%20false%2C%20mp%29%3B%0A%09%09addEventListener%28%22DOMMenuItemInactive%22%2C%20this%2C%20false%2C%20mp%29%3B%0A%09%09origMi.parentNode.insertBefore%28menu%2C%20origMi.nextSibling%29%3B%0A%09%09origMi.setAttribute%28%22hidden%22%2C%20%22true%22%29%3B%0A%09%7D%2C%0A%09initTooltip%3A%20function%28%29%20%7B%0A%09%09var%20tip%20%3D%20document.getElementById%28this.tipId%29%3B%0A%09%09tip%20%26%26%20tip.parentNode.removeChild%28tip%29%3B%0A%09%09tip%20%3D%20this.tip%20%3D%20this.createElement%28%22tooltip%22%2C%20%7B%0A%09%09%09id%3A%20this.tipId%2C%0A%09%09%09orient%3A%20%22vertical%22%2C%0A%09%09%09onpopupshowing%3A%20%22return%20this.undoCloseTabsList.updTooltip%28this%2C%20document.tooltipNode%29%3B%22%2C%0A%09%09%09onpopuphiding%3A%20%22this.cancelUpdateTimer%28%29%3B%22%2C%0A%09%09%09style%3A%20%22padding%3A%200%3B%22%0A%09%09%7D%29%3B%0A%09%09tip.undoCloseTabsList%20%3D%20this%3B%0A%09%09tip._updateTimer%20%3D%200%3B%0A%09%09tip.initUpdateTimer%20%3D%20function%28fn%2C%20context%29%20%7B%0A%09%09%09if%28this._updateTimer%29%0A%09%09%09%09clearInterval%28this._updateTimer%29%3B%0A%09%09%09this._updateTimer%20%3D%20setInterval%28function%28%29%20%7B%0A%09%09%09%09fn.call%28context%29%3B%0A%09%09%09%7D%2C%201000%29%3B%0A%09%09%7D%3B%0A%09%09tip.cancelUpdateTimer%20%3D%20function%28%29%20%7B%0A%09%09%09if%28this._updateTimer%29%20%7B%0A%09%09%09%09clearInterval%28this._updateTimer%29%3B%0A%09%09%09%09this._updateTimer%20%3D%200%3B%0A%09%09%09%7D%0A%09%09%7D%3B%0A%09%09var%20btn%20%3D%20this.button%3B%0A%09%09btn.removeAttribute%28%22tooltiptext%22%29%3B%0A%09%09btn.setAttribute%28%22tooltip%22%2C%20this.tipId%29%3B%0A%09%09btn.setAttribute%28%22popupsinherittooltip%22%2C%20%22true%22%29%3B%0A%09%09document.getElementById%28%22mainPopupSet%22%29.appendChild%28tip%29%3B%0A%09%7D%2C%0A%09_hasPbExitObserver%3A%20false%2C%0A%09addPbExitObserver%3A%20function%28add%29%20%7B%0A%09%09if%28add%20%3D%3D%20this._hasPbExitObserver%20%7C%7C%20%21%28%22Services%22%20in%20window%29%29%0A%09%09%09return%3B%0A%09%09this._hasPbExitObserver%20%3D%20add%3B%0A%09%09if%28add%29%0A%09%09%09Services.obs.addObserver%28this%2C%20%22last-pb-context-exited%22%2C%20false%29%3B%0A%09%09else%0A%09%09%09Services.obs.removeObserver%28this%2C%20%22last-pb-context-exited%22%29%3B%0A%09%7D%2C%0A%09destroy%3A%20function%28%29%20%7B%0A%09%09window.removeEventListener%28%22TabClose%22%2C%20%20%20%20%20%20%20this%2C%20false%29%3B%0A%09%09window.removeEventListener%28%22SSTabRestoring%22%2C%20this%2C%20false%29%3B%0A%09%09window.removeEventListener%28%22unload%22%2C%20%20%20%20%20%20%20%20%20this%2C%20false%29%3B%0A%09%09if%28this.appName%20%3D%3D%20%22SeaMonkey%22%29%0A%09%09%09window.removeEventListener%28%22TabOpen%22%2C%20this%2C%20false%29%3B%0A%09%09this.mp.removeEventListener%28%22DOMMenuItemActive%22%2C%20%20%20this%2C%20false%29%3B%0A%09%09this.mp.removeEventListener%28%22DOMMenuItemInactive%22%2C%20this%2C%20false%29%3B%0A%09%09this.addPbExitObserver%28false%29%3B%0A%09%09var%20menu%20%3D%20document.getElementById%28this.tcmId%29%3B%0A%09%09if%28menu%29%20%7B%0A%09%09%09menu.parentNode.removeChild%28menu%29%3B%0A%09%09%09this.tabContextUndoClose.removeAttribute%28%22hidden%22%29%3B%0A%09%09%7D%0A%09%09var%20tip%20%3D%20this.tip%3B%0A%09%09tip%20%26%26%20tip.parentNode%20%26%26%20tip.parentNode.removeChild%28tip%29%3B%0A%09%7D%2C%0A%09handleEvent%3A%20function%28e%29%20%7B%0A%09%09switch%28e.type%29%20%7B%0A%09%09%09case%20%22TabClose%22%3A%0A%09%09%09case%20%22SSTabRestoring%22%3A%0A%09%09%09case%20%22TabOpen%22%3A%0A%09%09%09%09setTimeout%28function%28_this%29%20%7B%0A%09%09%09%09%09_this.updUI%28%29%3B%0A%09%09%09%09%7D%2C%200%2C%20this%29%3B%0A%09%09%09break%3B%0A%09%09%09case%20%22DOMMenuItemActive%22%3A%0A%09%09%09case%20%22DOMMenuItemInactive%22%3A%0A%09%09%09%09if%28%21%28%22XULBrowserWindow%22%20in%20window%29%29%0A%09%09%09%09%09break%3B%0A%09%09%09%09XULBrowserWindow.setOverLink%28%0A%09%09%09%09%09e.type%20%3D%3D%20%22DOMMenuItemActive%22%0A%09%09%09%09%09%09%3F%20%28e.target.getAttribute%28%22cb_urlDecoded%22%29%20%7C%7C%20%22%22%29%0A%09%09%09%09%09%09%09.replace%28/%20%5Cn/g%2C%20%22%2C%20%22%29%0A%09%09%09%09%09%09%3A%20%22%22%2C%0A%09%09%09%09%09null%0A%09%09%09%09%29%3B%0A%09%09%09break%3B%0A%09%09%09case%20%22unload%22%3A%0A%09%09%09%09this.updUIGlobal%28%29%3B%0A%09%09%09%09this.destroy%28%29%3B%0A%09%09%7D%0A%09%7D%2C%0A%09observe%3A%20function%28subject%2C%20topic%2C%20data%29%20%7B%0A%09%09if%28topic%20%3D%3D%20%22last-pb-context-exited%22%29%20%7B%0A%09%09%09setTimeout%28function%28_this%29%20%7B%0A%09%09%09%09_this.updUI%28%29%3B%0A%09%09%09%7D%2C%2025%2C%20this%29%3B%0A%09%09%7D%0A%09%7D%2C%0A%0A%09createElement%3A%20function%28name%2C%20attrs%29%20%7B%0A%09%09var%20node%20%3D%20document.createElement%28name%29%3B%0A%09%09if%28attrs%29%20for%28var%20attrName%20in%20attrs%29%20if%28attrs.hasOwnProperty%28attrName%29%29%0A%09%09%09node.setAttribute%28attrName%2C%20attrs%5BattrName%5D%29%3B%0A%09%09return%20node%3B%0A%09%7D%2C%0A%09get%20tabContextUndoClose%28%29%20%7B%0A%09%09return%20document.getElementById%28%22context_undoCloseTab%22%29%0A%09%09%09%7C%7C%20document.getElementById%28%22tabContextUndoCloseTab%22%29%20//%20Firefox%202.0%0A%09%09%09%7C%7C%20document.getAnonymousElementByAttribute%28gBrowser%2C%20%22tbattr%22%2C%20%22tabbrowser-undoclosetab%22%29%3B%20//%20SeaMonkey%0A%09%7D%2C%0A%09get%20closedWindowCount%28%29%20%7B%0A%09%09if%28%21%28%22getClosedWindowCount%22%20in%20this.ss%29%29%20%7B%0A%09%09%09delete%20this.closedWindowCount%3B%0A%09%09%09return%20this.closedWindowCount%20%3D%200%3B%0A%09%09%7D%0A%09%09this.__defineGetter__%28%22closedWindowCount%22%2C%20function%28%29%20%7B%0A%09%09%09return%20this.ss.getClosedWindowCount%28%29%3B%0A%09%09%7D%29%3B%0A%09%09return%20this.closedWindowCount%3B%0A%09%7D%2C%0A%09get%20closedTabCount%28%29%20%7B%0A%09%09return%20this.ss.getClosedTabCount%28window%29%3B%0A%09%7D%2C%0A%09undoCloseTab%3A%20function%28i%29%20%7B%0A%09%09if%28%22undoCloseTab%22%20in%20window%29%20//%20Firefox%202.0+%0A%09%09%09undoCloseTab%28i%29%3B%0A%09%09else%20//%20SeaMonkey%0A%09%09%09gBrowser.undoCloseTab%28i%29%3B%0A%09%7D%2C%0A%09clearUndoTabsList%3A%20function%28%29%20%7B%0A%09%09var%20closedTabCount%20%3D%20this.closedTabCount%3B%0A%09%09if%28%21closedTabCount%29%0A%09%09%09return%3B%0A%09%09if%28%22forgetClosedTab%22%20in%20this.ss%29%20//%20Gecko%201.9.2+%0A%09%09%09while%28closedTabCount--%29%0A%09%09%09%09this.ss.forgetClosedTab%28window%2C%200%29%3B%0A%09%09else%20%7B%0A%09%09%09//%20Doesn%27t%20work%20in%20SeaMonkey%0A%09%09%09const%20pName%20%3D%20%22browser.sessionstore.max_tabs_undo%22%3B%0A%09%09%09let%20val%20%3D%20cbu.getPrefs%28pName%29%3B%0A%09%09%09cbu.setPrefs%28pName%2C%200%29%3B%0A%09%09%09cbu.setPrefs%28pName%2C%20val%29%3B%0A%09%09%7D%0A%09%09this.updUIGlobal%28%29%3B%0A%09%7D%2C%0A%09clearUndoWindowsList%3A%20function%28%29%20%7B%0A%09%09var%20closedWindowCount%20%3D%20this.closedWindowCount%3B%0A%09%09if%28%21closedWindowCount%29%0A%09%09%09return%3B%0A%09%09if%28%22forgetClosedWindow%22%20in%20this.ss%29%20//%20Gecko%201.9.2+%0A%09%09%09while%28closedWindowCount--%29%0A%09%09%09%09this.ss.forgetClosedWindow%280%29%3B%0A%09%09else%0A%09%09%09this.ss.setWindowState%28window%2C%20%27%7B%22windows%22%3A%5B%7B%7D%5D%2C%22_closedWindows%22%3A%5B%5D%7D%27%2C%20false%29%3B%0A%09%09this.updUIGlobal%28%29%3B%0A%09%7D%2C%0A%09clearAllLists%3A%20function%28%29%20%7B%0A%09%09this.clearUndoTabsList%28%29%3B%0A%09%09this.clearUndoWindowsList%28%29%3B%0A%09%7D%2C%0A%09canDeleteUndoEntry%3A%20function%28mi%29%20%7B%0A%09%09switch%28mi.getAttribute%28%22cb_type%22%29%29%20%7B%0A%09%09%09case%20%22tab%22%3A%20%20%20%20return%20%22forgetClosedTab%22%20%20%20%20in%20this.ss%3B%0A%09%09%09case%20%22window%22%3A%20return%20%22forgetClosedWindow%22%20in%20this.ss%3B%0A%09%09%7D%0A%09%09return%20false%3B%0A%09%7D%2C%0A%09deleteUndoEntry%3A%20function%28mi%29%20%7B%0A%09%09var%20i%20%3D%20+mi.getAttribute%28%22cb_index%22%29%3B%0A%09%09if%28mi.getAttribute%28%22cb_type%22%29%20%3D%3D%20%22window%22%29%20%7B%0A%09%09%09this.ss.forgetClosedWindow%28i%29%3B%0A%09%09%09this.updUIGlobal%28%29%3B%0A%09%09%7D%0A%09%09else%20%7B%0A%09%09%09this.ss.forgetClosedTab%28window%2C%20i%29%3B%0A%09%09%09this.updUI%28%29%3B%0A%09%09%7D%0A%09%09this.drawUndoList%28%29%3B%0A%09%7D%2C%0A%09showMenu%3A%20function%28e%2C%20isContext%2C%20mp%29%20%7B%0A%09%09var%20btn%20%3D%20this.button%3B%0A%09%09document.popupNode%20%3D%20btn.ownerDocument.popupNode%20%3D%20btn%3B%0A%09%09if%28%21mp%29%0A%09%09%09mp%20%3D%20this.mp%3B%0A%09%09if%28%22openPopupAtScreen%22%20in%20mp%29%0A%09%09%09mp.openPopupAtScreen%28e.screenX%2C%20e.screenY%2C%20isContext%29%3B%0A%09%09else%0A%09%09%09mp.showPopup%28btn%2C%20e.screenX%2C%20e.screenY%2C%20isContext%20%3F%20%22context%22%20%3A%20%22popup%22%2C%20null%2C%20null%29%3B%0A%09%7D%2C%0A%09openMenu%3A%20function%28%29%20%7B%0A%09%09var%20mp%20%3D%20this.mp%3B%0A%09%09if%28%22openPopup%22%20in%20mp%29%0A%09%09%09mp.openPopup%28this.button%2C%20%22after_start%22%29%3B%0A%09%09else%0A%09%09%09mp.showPopup%28this.button%2C%20-1%2C%20-1%2C%20%22popup%22%2C%20%22bottomleft%22%2C%20%22topleft%22%29%3B%0A%09%7D%2C%0A%09drawUndoList%3A%20function%28%29%20%7B%0A%09%09var%20mp%20%3D%20this.mp%3B%0A%0A%09%09var%20wc%20%3D%20this.closedWindowCount%3B%0A%09%09var%20tc%20%3D%20this.closedTabCount%3B%0A%09%09var%20ss%20%3D%20this.ss%3B%0A%09%09var%20canRestoreLastSession%20%3D%20%22restoreLastSession%22%20in%20ss%20%26%26%20ss.canRestoreLastSession%0A%09%09if%28%21wc%20%26%26%20%21tc%20%26%26%20%21canRestoreLastSession%29%20%7B%0A%09%09%09mp.textContent%20%3D%20%22%22%3B%0A%09%09%09mp.hidePopup%28%29%3B%0A%09%09%09return%20false%3B%0A%09%09%7D%0A%0A%09%09this._undoWindowItems%20%3D%20wc%20%26%26%20JSON.parse%28ss.getClosedWindowData%28%29%29%3B%0A%09%09this._undoTabItems%20%20%20%20%3D%20tc%20%26%26%20JSON.parse%28ss.getClosedTabData%28window%29%29%3B%0A%09%09var%20df%20%3D%20document.createDocumentFragment%28%29%3B%0A%0A%09%09this.options.menuTemplate.forEach%28function%28sid%2C%20indx%2C%20arr%29%20%7B%0A%09%09%09switch%28sid%29%20%7B%0A%09%09%09%09case%20%22closedWindows%22%3A%0A%09%09%09%09%09wc%20%26%26%20this.addUndoWindowsList%28df%29%3B%0A%09%09%09%09break%3B%0A%09%09%09%09case%20%22restoreClosedWindows%22%3A%0A%09%09%09%09%09wc%20%3E%20this.options.hideRestoreAllForSingleEntry%0A%09%09%09%09%09%26%26%20df.appendChild%28this.createElement%28%22menuitem%22%2C%20%7B%0A%09%09%09%09%09%09label%3A%20_localize%28%22restoreAllWindows%22%29%2C%0A%09%09%09%09%09%09accesskey%3A%20_localize%28%22restoreAllWindowsAccesskey%22%29%2C%0A%09%09%09%09%09%09oncommand%3A%20%22for%28var%20i%20%3D%200%3B%20i%20%3C%20%22%20+%20this._undoWindowItems.length%20+%20%22%3B%20++i%29%20undoCloseWindow%28%29%3B%22%0A%09%09%09%09%09%7D%29%29%3B%0A%09%09%09%09break%3B%0A%09%09%09%09case%20%22clearClosedWindows%22%3A%0A%09%09%09%09%09wc%20%26%26%20df.appendChild%28this.createElement%28%22menuitem%22%2C%20%7B%0A%09%09%09%09%09%09label%3A%20_localize%28%22clearWindowsHistory%22%29%2C%0A%09%09%09%09%09%09accesskey%3A%20_localize%28%22clearWindowsHistoryAccesskey%22%29%2C%0A%09%09%09%09%09%09oncommand%3A%20%22this.parentNode.parentNode.undoCloseTabsList.clearUndoWindowsList%28%29%3B%22%0A%09%09%09%09%09%7D%29%29%3B%0A%09%09%09%09break%3B%0A%09%09%09%09case%20%22closedTabs%22%3A%0A%09%09%09%09%09tc%20%26%26%20this.addUndoTabsList%28df%29%3B%0A%09%09%09%09break%3B%0A%09%09%09%09case%20%22restoreClosedTabs%22%3A%0A%09%09%09%09%09tc%20%3E%20this.options.hideRestoreAllForSingleEntry%0A%09%09%09%09%09%26%26%20df.appendChild%28this.createElement%28%22menuitem%22%2C%20%7B%0A%09%09%09%09%09%09label%3A%20_localize%28%22restoreAllTabs%22%29%2C%0A%09%09%09%09%09%09accesskey%3A%20_localize%28%22restoreAllTabsAccesskey%22%29%2C%0A%09%09%09%09%09%09oncommand%3A%20%22for%28var%20i%20%3D%200%3B%20i%20%3C%20%22%20+%20this._undoTabItems.length%20+%20%22%3B%20++i%29%20this.parentNode.parentNode.undoCloseTabsList.undoCloseTab%28%29%3B%22%0A%09%09%09%09%09%7D%29%29%3B%0A%09%09%09%09break%3B%0A%09%09%09%09case%20%22clearClosedTabs%22%3A%0A%09%09%09%09%09tc%20%26%26%20df.appendChild%28this.createElement%28%22menuitem%22%2C%20%7B%0A%09%09%09%09%09%09label%3A%20_localize%28%22clearTabsHistory%22%29%2C%0A%09%09%09%09%09%09accesskey%3A%20_localize%28%22clearTabsHistoryAccesskey%22%29%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20image%3A%20%20%22data%3Aimage/png%3Bbase64%2CiVBORw0KGgoAAAANSUhEUgAAABUAAAAVCAYAAACpF6WWAAADBElEQVQ4ja2VXWtcVRSGn33Omczkywk2raONo9QqiKnNaIQRFSkUJEPT0hSaBhEvO/6ijlAoIpJa0JKmNgjeSBUrarS2ItgKmjaYllRybObM+dh7Ly8mmU/T5sIN52bt9zy8a+21WNByFov5U4vFvCwW86fYxtlK77QKgHLh4DGA8sPAD9I7rYKx0jRyeY6x0vQDwQ/Tq03B/onjyM+fo4YyyD8RamyCq/OzAJWXriy91wncPzmD/LSAeiSNrIWoF9/i6sI5gIpaLOZl35tT2MvnUXuHUdkMaIPcraIKE1y7eLYB3gTuO3QC+XEBtasfPBfxQ+TmKs4bR7n25adNp8/7Ic7eYdSuAehxITbIahX1conrlz4GqADl0dI08sMl1HB/U3d3HXtzlV+zmbrT1pSeW49x8kOoHX2olIskBrkX4L5+hF8uzPLC4RnMV3Nd93Zpjd8GehoZqc5aPeOHuLuzqEd7UZ6LaIPUNN7BY+gvPkH1es343zXMss/vGw43a9+AtoKfvhfgPj6IM9SLStW7TqygnLpcEotdq2H+us8fO/q6HrMN2grO+yHeYwOo/h6U22hnxFikGqPvrLPU4XBLaBtYW9zBNMprgWqLuR+xVI91AaFlojqBew5MIVawscGGuvnFBrHCngNTsMWA/GdNn3rtCPH8LG5vqpm6CCjVKIGpJfRMzvDn13Ndjrte/8lXDxOd/wgvk0I5qu5WW8RYlOvgeE4jrsOE9NG3ufXNhTZwW5/uLk4SnfsQL+02f4wMSaTxnx0me2OVVNrruk8ff4flK/MNcGOicuOHiM5+QCrlohwQC0liiMKEYDQHGxPVd32FdCbVpUufeJeV7y8CVBygvLNQwj9zGoxFEo0JNVEQE1TjBnAjtUowmiOoxkRBjAk1kmgwFv/MaXYWSgBl9+RINhes3BiXZR9HBAwk2lKLNHHhibZavX/b/+zkSDZncoPj9tYaSkCMoLUh0pZ1dQc6Z5/vbuM5Cm0FXhnZsg+3rd9cDd8qJdtZKdvW/1876l8mq+FwTMY7EQAAAABJRU5ErkJggg%3D%3D%22%2C%0A%09%09%09%09%09%09oncommand%3A%20%22this.parentNode.parentNode.undoCloseTabsList.clearUndoTabsList%28%29%3B%22%0A%09%09%09%09%09%7D%29%29%3B%0A%09%09%09%09break%3B%0A%09%09%09%09case%20%22clearAll%22%3A%0A%09%09%09%09%09%28%0A%09%09%09%09%09%09wc%20%26%26%20tc%0A%09%09%09%09%09%09%7C%7C%20wc%20%26%26%20arr.indexOf%28%22clearClosedWindows%22%29%20%3D%3D%20-1%0A%09%09%09%09%09%09%7C%7C%20tc%20%26%26%20arr.indexOf%28%22clearClosedTabs%22%29%20%3D%3D%20-1%0A%09%09%09%09%09%29%0A%09%09%09%09%09%26%26%20df.appendChild%28this.createElement%28%22menuitem%22%2C%20%7B%0A%09%09%09%09%09%09label%3A%20_localize%28%22clearAllHistory%22%29%2C%0A%09%09%09%09%09%09accesskey%3A%20_localize%28%22clearAllHistoryAccesskey%22%29%2C%0A%09%09%09%09%09%09oncommand%3A%20%22this.parentNode.parentNode.undoCloseTabsList.clearAllLists%28%29%3B%22%0A%09%09%09%09%09%7D%29%29%3B%0A%09%09%09%09break%3B%0A%09%09%09%09case%20%22restoreLastSession%22%3A%20//%20Gecko%202.0+%0A%09%09%09%09%09canRestoreLastSession%20%26%26%20df.appendChild%28this.createElement%28%22menuitem%22%2C%20%7B%0A%09%09%09%09%09%09label%3A%20_localize%28%22restoreLastSession%22%29%2C%0A%09%09%09%09%09%09accesskey%3A%20_localize%28%22restoreLastSessionAccesskey%22%29%2C%0A%09%09%09%09%09%09oncommand%3A%20%22this.parentNode.parentNode.undoCloseTabsList.ss.restoreLastSession%28%29%3B%22%0A%09%09%09%09%09%7D%29%29%3B%0A%09%09%09%09break%3B%0A%09%09%09%09case%20%22buttonMenu%22%3A%0A%09%09%09%09%09let%20cbMenu%20%3D%20this.cbMenu%3B%0A%09%09%09%09%09if%28cbMenu%29%0A%09%09%09%09%09%09df.appendChild%28cbMenu%29%3B%0A%09%09%09%09break%3B%0A%09%09%09%09case%20%22separator%22%3A%0A%09%09%09%09%09if%28df.hasChildNodes%28%29%20%26%26%20df.lastChild.localName%20%21%3D%20%22menuseparator%22%29%0A%09%09%09%09%09%09df.appendChild%28document.createElement%28%22menuseparator%22%29%29%3B%0A%09%09%09%09break%3B%0A%09%09%09%09default%3A%0A%09%09%09%09%09Components.utils.reportError%28this.errPrefix%20+%20%27Invalid%20template%20entry%3A%20%22%27%20+%20sid%20+%20%27%22%27%29%3B%0A%09%09%09%7D%0A%09%09%7D%2C%20this%29%3B%0A%0A%09%09while%28df.hasChildNodes%28%29%20%26%26%20df.lastChild.localName%20%3D%3D%20%22menuseparator%22%29%0A%09%09%09df.removeChild%28df.lastChild%29%3B%0A%0A%09%09this._undoWindowItems%20%3D%20this._undoTabItems%20%3D%20null%3B%0A%0A%09%09mp.textContent%20%3D%20%22%22%3B%0A%09%09if%28%21df.hasChildNodes%28%29%29%20%7B%0A%09%09%09mp.hidePopup%28%29%3B%0A%09%09%09return%20false%3B%0A%09%09%7D%0A%09%09mp.appendChild%28df%29%3B%0A%09%09return%20true%3B%0A%09%7D%2C%0A%09addUndoWindowsList%3A%20function%28undoPopup%29%20%7B%0A%09%09//%20Based%20on%20code%20from%20chrome%3A//browser/content/browser.js%0A%09%09//%20Mozilla/5.0%20%28Windows%3B%20U%3B%20Windows%20NT%205.1%3B%20en-US%3B%20rv%3A1.9.3a1pre%29%20Gecko/20090824%20Minefield/3.7a1pre%0A%0A%09%09var%20keys%20%3D%20this.options.accesskeys.closedWindows%3B%0A%09%09this._undoWindowItems.forEach%28function%28undoItem%2C%20i%29%20%7B%0A%09%09%09var%20tabs%20%3D%20undoItem.tabs%3B%0A%09%09%09var%20%5Bkey%2C%20keyPrefix%5D%20%3D%20this.getKey%28keys%2C%20i%29%3B%0A%09%09%09var%20title%20%3D%20undoItem.title%3B%0A%09%09%09var%20selectedTab%20%3D%20tabs%5BundoItem.selected%20-%201%5D%3B%0A%09%09%09var%20urls%20%3D%20%5B%5D%3B%0A%09%09%09tabs.forEach%28function%28tab%29%20%7B%0A%09%09%09%09if%28%21tab.entries%20%7C%7C%20%21tab.entries.length%29%20//%20Can%20be%20%5B%5D%20for%20about%3Ablank%0A%09%09%09%09%09return%3B%0A%09%09%09%09var%20url%20%3D%20this.convertURI%28tab.entries%5Btab.index%20-%201%5D.url%2C%20120%29%3B%0A%09%09%09%09var%20selectedPrefix%20%3D%20tab%20%3D%3D%20selectedTab%20%26%26%20tabs.length%20%3E%201%0A%09%09%09%09%09%3F%20this.options.windowSelectedTabPrefix%0A%09%09%09%09%09%3A%20%22%22%3B%0A%09%09%09%09urls.push%28selectedPrefix%20+%20url%29%3B%0A%09%09%09%7D%2C%20this%29%3B%0A%09%09%09var%20url%20%3D%20urls.join%28%22%20%5Cn%22%29%3B%0A%09%09%09var%20mi%20%3D%20this.createElement%28%22menuitem%22%2C%20%7B%0A%09%09%09%09label%3A%20keyPrefix%20+%20this.options.windowItemTemplate%0A%09%09%09%09%09.replace%28%22%25title%22%2C%20title%29%0A%09%09%09%09%09.replace%28%22%25count%22%2C%20tabs.length%29%2C%0A%09%09%09%09accesskey%3A%20key%2C%0A%09%09%09%09%22class%22%3A%20%22menuitem-iconic%20bookmark-item%20menuitem-with-favicon%22%2C%0A%09%09%09%09oncommand%3A%20%22undoCloseWindow%28%22%20+%20i%20+%20%22%29%3B%22%2C%0A%09%09%09%09cb_url%3A%20url%2C%0A%09%09%09%09cb_urlDecoded%3A%20this.convertURI%28url%29%2C%0A%09%09%09%09cb_closedAt%3A%20undoItem.closedAt%20%7C%7C%200%2C%0A%09%09%09%09cb_index%3A%20i%2C%0A%09%09%09%09cb_type%3A%20%22window%22%0A%09%09%09%7D%29%3B%0A%09%09%09if%28this.cm%29%0A%09%09%09%09mi.setAttribute%28%22context%22%2C%20this.cmId%29%3B%0A%09%09%09var%20icon%20%3D%20selectedTab.image%20%7C%7C%20selectedTab.attributes%20%26%26%20selectedTab.attributes.image%3B%0A%09%09%09if%28icon%29%0A%09%09%09%09mi.setAttribute%28%22image%22%2C%20this.cachedIcon%28icon%29%29%3B%0A%09%09%09if%28i%20%3D%3D%200%29%0A%09%09%09%09mi.setAttribute%28%22key%22%2C%20%22key_undoCloseWindow%22%29%3B%0A%09%09%09undoPopup.appendChild%28mi%29%3B%0A%09%09%7D%2C%20this%29%3B%0A%09%7D%2C%0A%09addUndoTabsList%3A%20function%28undoPopup%29%20%7B%0A%09%09//%20Based%20on%20code%20from%20chrome%3A//browser/content/browser.js%0A%09%09//%20Mozilla/5.0%20%28Windows%3B%20U%3B%20Windows%20NT%205.1%3B%20en-US%3B%20rv%3A1.9.3a1pre%29%20Gecko/20090824%20Minefield/3.7a1pre%0A%0A%09%09var%20keys%20%3D%20this.options.accesskeys.closedTabs%3B%0A%09%09this._undoTabItems.forEach%28function%28undoItem%2C%20i%29%20%7B%0A%09%09%09var%20state%20%3D%20undoItem.state%3B%0A%09%09%09var%20%5Bkey%2C%20keyPrefix%5D%20%3D%20this.getKey%28keys%2C%20i%29%3B%0A%09%09%09var%20title%20%3D%20undoItem.title%3B%0A%09%09%09var%20url%20%3D%20state%20%26%26%20state.entries%20%26%26%20state.entries%5Bstate.index%20-%201%5D.url%20%7C%7C%20%22%22%3B%0A%09%09%09var%20mi%20%3D%20this.createElement%28%22menuitem%22%2C%20%7B%0A%09%09%09%09label%3A%20keyPrefix%20+%20title%2C%0A%09%09%09%09accesskey%3A%20key%2C%0A%09%09%09%09class%3A%20%22menuitem-iconic%20bookmark-item%20menuitem-with-favicon%22%2C%0A%09%09%09%09oncommand%3A%20%22this.parentNode.parentNode.undoCloseTabsList.undoCloseTab%28%22%20+%20i%20+%20%22%29%3B%22%2C%0A%09%09%09%09cb_url%3A%20url%2C%0A%09%09%09%09cb_urlDecoded%3A%20this.convertURI%28url%29%2C%0A%09%09%09%09cb_closedAt%3A%20undoItem.closedAt%20%7C%7C%200%2C%0A%09%09%09%09cb_index%3A%20i%2C%0A%09%09%09%09cb_type%3A%20%22tab%22%0A%09%09%09%7D%29%3B%0A%09%09%09if%28%0A%09%09%09%09state%0A%09%09%09%09%26%26%20%22attributes%22%20in%20state%0A%09%09%09%09%26%26%20%22privateTab-isPrivate%22%20in%20state.attributes%0A%09%09%09%29%20//%20https%3A//addons.mozilla.org/addon/private-tab/%0A%09%09%09%09mi.setAttribute%28%22privateTab-isPrivate%22%2C%20%22true%22%29%3B%0A%09%09%09if%28this.cm%29%0A%09%09%09%09mi.setAttribute%28%22context%22%2C%20this.cmId%29%3B%0A%09%09%09var%20image%20%3D%20undoItem.image%20//%20Firefox%0A%09%09%09%09%7C%7C%20state%20%26%26%20state.attributes%20%26%26%20state.attributes.image%20//%20SeaMonkey%0A%09%09%09%09%7C%7C%20state%20%26%26%20state.xultab%0A%09%09%09%09%09%26%26%20/%28%3F%3A%5E%7C%20%29image%3D%28%5CS+%29/.test%28state.xultab%29%0A%09%09%09%09%09%26%26%20decodeURI%28RegExp.%241%29%3B%20//%20Only%20Firefox%202.0%20%3F%0A%09%09%09if%28image%29%0A%09%09%09%09mi.setAttribute%28%22image%22%2C%20this.cachedIcon%28image%29%29%3B%0A%09%09%09if%28i%20%3D%3D%200%29%0A%09%09%09%09mi.setAttribute%28%22key%22%2C%20%22key_undoCloseTab%22%29%3B%0A%09%09%09undoPopup.appendChild%28mi%29%3B%0A%09%09%7D%2C%20this%29%3B%0A%09%7D%2C%0A%09getKey%3A%20function%28keys%2C%20i%29%20%7B%0A%09%09var%20key%20%3D%20keys%20%26%26%20keys.charAt%28i%20%25%20keys.length%29%3B%0A%09%09var%20keyPrefix%20%3D%20keys%20%26%26%20%28key%20+%20this.options.accesskeyPostfix%29%3B%0A%09%09return%20%5Bkey%2C%20keyPrefix%5D%3B%0A%09%7D%2C%0A%09checkForMiddleClick%3A%20function%28e%2C%20upd%29%20%7B%0A%09%09var%20mi%20%3D%20e.target%3B%0A%09%09if%28%0A%09%09%09%22doCommand%22%20in%20mi%0A%09%09%09%26%26%20e.button%20%3D%3D%201%0A%09%09%09%26%26%20mi.parentNode%20%3D%3D%20e.currentTarget%0A%09%09%29%20%7B%0A%09%09%09mi.doCommand%28%29%3B%0A%09%09%09if%28upd%29%0A%09%09%09%09upd%28%29%3B%0A%09%09%09else%0A%09%09%09%09this.drawUndoList%28%29%3B%0A%09%09%7D%0A%09%7D%2C%0A%09crop%3A%20function%28s%2C%20crop%29%20%7B%0A%09%09if%28crop%20%3D%3D%20undefined%29%0A%09%09%09crop%20%3D%20500%3B%0A%09%09if%28s.length%20%3C%3D%20crop%29%0A%09%09%09return%20s%3B%0A%09%09var%20start%20%3D%20Math.round%28crop*0.6%29%3B%0A%09%09return%20s.substr%280%2C%20start%29%20+%20%22%u2026%22%20+%20s.substr%28start%20-%20crop%29%3B%0A%09%7D%2C%0A%09convertURI%3A%20function%28uri%2C%20crop%29%20%7B%0A%09%09if%28%21uri%20%7C%7C%20uri.indexOf%28%22%5Cn%22%29%20%21%3D%20-1%29%0A%09%09%09return%20uri%3B%0A%09%09try%20%7B%0A%09%09%09uri%20%3D%20%22losslessDecodeURI%22%20in%20window%0A%09%09%09%09%3F%20losslessDecodeURI%28makeURI%28uri%29%29%0A%09%09%09%09%3A%20decodeURI%28uri%29%3B%0A%09%09%7D%0A%09%09catch%28e%29%20%7B%0A%09%09%09Components.utils.reportError%28e%29%3B%0A%09%09%7D%0A%09%09return%20this.crop%28uri%2C%20crop%29%3B%0A%09%7D%2C%0A%09cachedIcon%3A%20function%28src%29%20%7B%0A%09%09src%20%3D%20src.replace%28/%5B%26%23%5D-moz-resolution%3D%5Cd+%2C%5Cd+%24/%2C%20%22%22%29%3B%20//%20Firefox%2022+%0A%09%09if%28%0A%09%09%09%21/%5Ehttps%3F%3A/.test%28src%29%0A%09%09%09//%20IDN%2C%20see%20https%3A//bugzilla.mozilla.org/show_bug.cgi%3Fid%3D311045%0A%09%09%09%7C%7C%20/%5Ehttps%3F%3A%5C/%5C/%5B%5E.%3A%5C/%5D+%5C.%5B%5Ea-z0-9-%5D+%28%3F%3A%5C/%7C%24%29/.test%28src%29%0A%09%09%09%7C%7C%20this.appName%20%3D%3D%20%22SeaMonkey%22%20%26%26%20this.appVersion%20%3C%3D%202%0A%09%09%09%7C%7C%20this.appName%20%3D%3D%20%22Firefox%22%20%20%20%26%26%20this.appVersion%20%3C%3D%203.5%0A%09%09%29%0A%09%09%09return%20src%3B%0A%09%09return%20%22moz-anno%3Afavicon%3A%22%20+%20src%3B%20//%20https%3A//bugzilla.mozilla.org/show_bug.cgi%3Fid%3D467828%0A%09%7D%2C%0A%09updUI%3A%20function%28%29%20%7B%0A%09%09var%20tabsCount%20%3D%20this.closedTabCount%3B%0A%09%09var%20dis%20%3D%20%21tabsCount%20%26%26%20%21this.closedWindowCount%3B%0A%09%09if%28%0A%09%09%09dis%0A%09%09%09%26%26%20this.options.useMenu%0A%09%09%09%26%26%20this.options.menuTemplate.indexOf%28%22restoreLastSession%22%29%20%21%3D%20-1%0A%09%09%09%26%26%20%22restoreLastSession%22%20in%20this.ss%20%26%26%20this.ss.canRestoreLastSession%0A%09%09%29%0A%09%09%09dis%20%3D%20false%3B%0A%09%09this.button.disabled%20%3D%20dis%3B%0A%09%7D%2C%0A%09updTooltip%3A%20function%28tip%2C%20tn%29%20%7B%0A%09%09var%20template%2C%20header%2C%20title%2C%20url%2C%20closedAt%3B%0A%09%09if%28tn%20%3D%3D%20this.button%29%20%7B%0A%09%09%09template%20%3D%20this.options.buttonTipTemplate%3B%0A%09%09%09header%20%3D%20_localize%28%22restoreTab%22%29%3B%0A%09%09%09let%20undoTabItems%20%3D%20JSON.parse%28this.ss.getClosedTabData%28window%29%29%3B%0A%09%09%09if%28undoTabItems.length%29%20%7B%0A%09%09%09%09let%20lastItem%20%3D%20undoTabItems%5B0%5D%3B%0A%09%09%09%09title%20%3D%20lastItem.title%3B%0A%09%09%09%09url%20%3D%20lastItem.state%20%26%26%20lastItem.state.entries%0A%09%09%09%09%09%26%26%20lastItem.state.entries%5BlastItem.state.index%20-%201%5D.url%3B%0A%09%09%09%09closedAt%20%3D%20lastItem.closedAt%20%7C%7C%200%3B%0A%09%09%09%7D%0A%09%09%7D%0A%09%09else%20if%28tn.hasAttribute%28%22cb_index%22%29%29%20%7B%0A%09%09%09template%20%3D%20this.options.itemTipTemplate%3B%0A%09%09%09title%20%3D%20tn.getAttribute%28%22label%22%29%3B%0A%09%09%09url%20%3D%20tn.getAttribute%28%22cb_url%22%29%3B%0A%09%09%09closedAt%20%3D%20+tn.getAttribute%28%22cb_closedAt%22%29%3B%0A%09%09%7D%0A%09%09else%20%7B%0A%09%09%09return%20false%3B%0A%09%09%7D%0A%0A%09%09var%20tipData%20%3D%20this.getTooltipData%28template%2C%20header%2C%20title%2C%20url%2C%20closedAt%29%3B%0A%09%09tip.textContent%20%3D%20%22%22%3B%0A%09%09tip.appendChild%28tipData%29%3B%0A%09%09if%28closedAt%20%26%26%20template.indexOf%28%22closedAt%22%29%20%21%3D%20-1%29%20%7B%0A%09%09%09tip.initUpdateTimer%28function%28%29%20%7B%0A%09%09%09%09var%20tipData%20%3D%20this.getTooltipData%28template%2C%20header%2C%20title%2C%20url%2C%20closedAt%29%3B%0A%09%09%09%09if%28tipData.textContent%20%21%3D%20tip.textContent%29%20%7B%0A%09%09%09%09%09tip.textContent%20%3D%20%22%22%3B%0A%09%09%09%09%09tip.appendChild%28tipData%29%3B%0A%09%09%09%09%7D%0A%09%09%09%7D%2C%20this%29%3B%0A%09%09%7D%0A%09%09return%20tip.hasChildNodes%28%29%3B%0A%09%7D%2C%0A%09getTooltipData%3A%20function%28template%2C%20header%2C%20title%2C%20url%2C%20closedAt%29%20%7B%0A%09%09var%20df%20%3D%20document.createDocumentFragment%28%29%3B%0A%09%09var%20hasHeader%20%3D%20header%20%26%26%20template.indexOf%28%22header%22%29%20%21%3D%20-1%3B%0A%09%09function%20item%28key%2C%20val%29%20%7B%0A%09%09%09var%20lbl%20%3D%20document.createElement%28%22label%22%29%3B%0A%09%09%09lbl.className%20%3D%20%22cb-%22%20+%20key%3B%0A%09%09%09//lbl.setAttribute%28%22value%22%2C%20val%29%3B%0A%09%09%09lbl.textContent%20%3D%20val%3B%0A%09%09%09lbl.setAttribute%28%22maxwidth%22%2C%20%22450%22%29%3B%20//%20Trick%20to%20restore%20right%20border%20for%20long%20lines%0A%09%09%09if%28key%20%3D%3D%20%22closedAt%22%20%7C%7C%20hasHeader%20%26%26%20key%20%21%3D%20%22header%22%29%0A%09%09%09%09lbl.style.color%20%3D%20%22grayText%22%3B%0A%09%09%09return%20df.appendChild%28lbl%29%3B%0A%09%09%7D%0A%09%09template.forEach%28function%28key%29%20%7B%0A%09%09%09switch%28key%29%20%7B%0A%09%09%09%09case%20%22header%22%3A%0A%09%09%09%09%09if%28header%29%0A%09%09%09%09%09%09item%28key%2C%20header%29%3B%0A%09%09%09%09break%3B%0A%09%09%09%09case%20%22title%22%3A%0A%09%09%09%09%09if%28title%20%26%26%20title%20%21%3D%20url%29%0A%09%09%09%09%09%09item%28key%2C%20title%29%3B%0A%09%09%09%09break%3B%0A%09%09%09%09case%20%22url%22%3A%0A%09%09%09%09%09if%28url%29%0A%09%09%09%09%09%09item%28key%2C%20this.convertURI%28url%29%29%3B%0A%09%09%09%09break%3B%0A%09%09%09%09case%20%22closedAt%22%3A%0A%09%09%09%09%09if%28%21closedAt%29%0A%09%09%09%09%09%09break%3B%0A%09%09%09%09%09let%20dt%20%3D%20Math.round%28Math.max%280%2C%20Date.now%28%29%20-%20closedAt%29/1000%29%3B%0A%09%09%09%09%09let%20days%20%3D%20Math.floor%28dt/24/3600%29%3B%0A%09%09%09%09%09dt%20-%3D%20days*24*3600%3B%0A%09%09%09%09%09let%20d%20%3D%20new%20Date%28%28dt%20+%20new%20Date%28dt%29.getTimezoneOffset%28%29*60%29*1000%29%3B%0A%09%09%09%09%09let%20m%20%3D%20d.getMinutes%28%29%3B%0A%09%09%09%09%09let%20ts%20%3D%20d.getHours%28%29%20+%20%22%3A%22%20+%20%28m%20%3E%209%20%3F%20m%20%3A%20%220%22%20+%20m%29%3B%0A%09%09%09%09%09if%28days%29%0A%09%09%09%09%09%09ts%20%3D%20days%20+%20_localize%28%22day%22%29%20+%20%22%20%22%20+%20ts%3B%0A%09%09%09%09%09let%20tsTip%20%3D%20_localize%28%22itemTip%22%29%0A%09%09%09%09%09%09.replace%28%22%25ago%22%2C%20ts%29%0A%09%09%09%09%09%09.replace%28%22%25date%22%2C%20new%20Date%28closedAt%29.toLocaleString%28%29%29%3B%0A%09%09%09%09%09item%28key%2C%20tsTip%29%3B%0A%09%09%09%7D%0A%09%09%7D%2C%20this%29%3B%0A%09%09return%20df%3B%0A%09%7D%2C%0A%09get%20wm%28%29%20%7B%0A%09%09delete%20this.wm%3B%0A%09%09return%20this.wm%20%3D%20Components.classes%5B%22@mozilla.org/appshell/window-mediator%3B1%22%5D%0A%09%09%09.getService%28Components.interfaces.nsIWindowMediator%29%3B%0A%09%7D%2C%0A%09updUIGlobal%3A%20function%28%29%20%7B%0A%09%09var%20isSeaMonkey%20%3D%20this.appName%20%3D%3D%20%22SeaMonkey%22%3B%0A%09%09var%20ws%20%3D%20this.wm.getEnumerator%28isSeaMonkey%20%3F%20null%20%3A%20%22navigator%3Abrowser%22%29%3B%0A%09%09const%20id%20%3D%20this.button.id%3B%0A%09%09while%28ws.hasMoreElements%28%29%29%20%7B%0A%09%09%09let%20win%20%3D%20ws.getNext%28%29%3B%0A%09%09%09if%28%21isSeaMonkey%20%7C%7C%20this.isBrowserWindow%28win%29%29%20%7B%0A%09%09%09%09let%20btn%20%3D%20win.document.getElementById%28id%29%3B%0A%09%09%09%09if%28btn%20%26%26%20%22undoCloseTabsList%22%20in%20btn%29%20%7B%0A%09%09%09%09%09let%20ucl%20%3D%20btn.undoCloseTabsList%3B%0A%09%09%09%09%09ucl.ensureSessionsInitialized%28ucl.updUI%2C%20ucl%29%3B%0A%09%09%09%09%7D%0A%09%09%09%7D%0A%09%09%7D%0A%09%7D%2C%0A%09isBrowserWindow%3A%20function%28win%29%20%7B%0A%09%09var%20loc%20%3D%20window.location.href%3B%0A%09%09return%20loc%20%3D%3D%20%22chrome%3A//browser/content/browser.xul%22%0A%09%09%09%7C%7C%20loc%20%3D%3D%20%22chrome%3A//navigator/content/navigator.xul%22%3B%0A%09%7D%2C%0A%09ensureSessionsInitialized%3A%20function%28callback%2C%20context%29%20%7B%0A%09%09var%20_this%20%3D%20this%3B%0A%09%09var%20stopTime%20%3D%20Date.now%28%29%20+%203e3%3B%0A%09%09%28function%20ensureInitialized%28%29%20%7B%0A%09%09%09try%20%7B%0A%09%09%09%09_this.ss.getClosedTabCount%28window%29%3B%0A%09%09%09%09callback.call%28context%29%3B%0A%09%09%09%09return%3B%0A%09%09%09%7D%0A%09%09%09catch%28e%29%20%7B%0A%09%09%09%09if%28Date.now%28%29%20%3E%20stopTime%29%20%7B%0A%09%09%09%09%09Components.utils.reportError%28%0A%09%09%09%09%09%09_this.errPrefix%0A%09%09%09%09%09%09+%20%22Can%27t%20initialize%3A%20nsISessionStore.getClosedTabCount%28%29%20failed%22%0A%09%09%09%09%09%29%3B%0A%09%09%09%09%09Components.utils.reportError%28e%29%3B%0A%09%09%09%09%09return%3B%0A%09%09%09%09%7D%0A%09%09%09%7D%0A%09%09%09setTimeout%28ensureInitialized%2C%2050%29%3B%0A%09%09%7D%29%28%29%3B%0A%09%7D%0A%7D%3B%0A%0Aif%28%21this.undoCloseTabsList.options.useMenu%20%26%26%20this.undoCloseTabsList.useCentextMenu%29%20%7B%0A%09this.oncontextmenu%20%3D%20function%28e%29%20%7B%0A%09%09if%28%0A%09%09%09e.target%20%21%3D%20this%0A%09%09%09%7C%7C%20e.ctrlKey%20%7C%7C%20e.shiftKey%20%7C%7C%20e.altKey%20%7C%7C%20e.metaKey%0A%09%09%09%7C%7C%20%21this.undoCloseTabsList.mp.hasChildNodes%28%29%0A%09%09%29%0A%09%09%09return%3B%0A%09%09e.preventDefault%28%29%3B%0A%09%09this.undoCloseTabsList.showMenu%28e%29%3B%20//%20Show%20menu%20without%20%22context%22%20flag%0A%09%7D%3B%0A%7D%0Aif%28this.undoCloseTabsList.options.rightClickToUndoCloseTab%29%20%7B%0A%09this.oncontextmenu%20%3D%20function%28e%29%20%7B%0A%09%09if%28e.target%20%3D%3D%20this%20%26%26%20%21e.ctrlKey%20%26%26%20%21e.shiftKey%20%26%26%20%21e.altKey%20%26%26%20%21e.metaKey%29%0A%09%09%09e.preventDefault%28%29%3B%0A%09%7D%3B%0A%7D%0A%0Athis.disabled%20%3D%20true%3B%0AsetTimeout%28function%28_this%29%20%7B%0A%09_this.undoCloseTabsList.init%28%29%3B%0A%7D%2C%200%2C%20this%29%3B%0A%0A//%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%0A//%20Styles%0A//%20Used%20icons%20from%20Undo%20Closed%20Tabs%20Button%20extension%0A%0A//%20Styles%20can%27t%20override%20hardcoded%20icon%0Aif%28%20//%20Remove%20icon%20only%20if%20nsIStyleSheetService%20works%20on-the-fly%20%28Firefox%203.0+%29%0A%09%21Components.ID%28%22%7B41d979dc-ea03-4235-86ff-1e3c090c5630%7D%22%29%0A%09%09.equals%28Components.interfaces.nsIStyleSheetService%29%0A%29%20%7B%0A%09let%20icon%20%3D%20this.ownerDocument.getAnonymousElementByAttribute%28this%2C%20%22class%22%2C%20%22toolbarbutton-icon%22%29%3B%0A%09if%28icon%29%0A%09%09icon.src%20%3D%20%22%22%3B%0A%09else%0A%09%09this.image%20%3D%20%22%22%3B%0A%7D%0A%0Avar%20cssStr%20%3D%20%27%5C%0A%09@namespace%20url%28%22http%3A//www.mozilla.org/keymaster/gatekeeper/there.is.only.xul%22%29%3B%5Cn%5C%0A%09@-moz-document%20url%28%22%25windowURL%25%22%29%20%7B%5Cn%5C%0A%09%09%25button%25%20%7B%5Cn%5C%0A%09%09%09list-style-image%3A%20url%28%22data%3Aimage/png%3Bbase64%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%22%29%20%21important%3B%5Cn%5C%0A%09%09%09-moz-image-region%3A%20rect%280%2C%2024px%2C%2024px%2C%200%29%20%21important%3B%5Cn%5C%0A%09%09%7D%5Cn%5C%0A%09%09%25button%25%3Ahover%20%7B%5Cn%5C%0A%09%09%09-moz-image-region%3A%20rect%280%2C%2048px%2C%2024px%2C%2024px%29%20%21important%3B%5Cn%5C%0A%09%09%7D%5Cn%5C%0A%09%09%25button%25%5Bdisabled%3D%22true%22%5D%20%7B%5Cn%5C%0A%09%09%09-moz-image-region%3A%20rect%280%2C%2072px%2C%2024px%2C%2048px%29%20%21important%3B%5Cn%5C%0A%09%09%7D%5Cn%5C%0A%09%09toolbar%5Biconsize%3D%22small%22%5D%20%25button%25%20%7B%5Cn%5C%0A%09%09%09-moz-image-region%3A%20rect%2824px%2C%2016px%2C%2040px%2C%200%29%20%21important%3B%5Cn%5C%0A%09%09%7D%5Cn%5C%0A%09%09toolbar%5Biconsize%3D%22small%22%5D%20%25button%25%3Ahover%20%7B%5Cn%5C%0A%09%09%09-moz-image-region%3A%20rect%2824px%2C%2032px%2C%2040px%2C%2016px%29%20%21important%3B%5Cn%5C%0A%09%09%7D%5Cn%5C%0A%09%09toolbar%5Biconsize%3D%22small%22%5D%20%25button%25%5Bdisabled%3D%22true%22%5D%20%7B%5Cn%5C%0A%09%09%09-moz-image-region%3A%20rect%2824px%2C%2048px%2C%2040px%2C%2032px%29%20%21important%3B%5Cn%5C%0A%09%09%7D%5Cn%5C%0A%09%7D%27%0A%09.replace%28/%25windowURL%25/g%2C%20window.location.href%29%0A%09.replace%28/%25button%25/g%2C%20%22%23%22%20+%20this.id%29%3B%0Avar%20cssURI%20%3D%20this.cssURI%20%3D%20Components.classes%5B%22@mozilla.org/network/io-service%3B1%22%5D%0A%09.getService%28Components.interfaces.nsIIOService%29%0A%09.newURI%28%22data%3Atext/css%2C%22%20+%20encodeURIComponent%28cssStr%29%2C%20null%2C%20null%29%3B%0Avar%20sss%20%3D%20this.sss%20%3D%20Components.classes%5B%22@mozilla.org/content/style-sheet-service%3B1%22%5D%0A%09.getService%28Components.interfaces.nsIStyleSheetService%29%3B%0Aif%28%21sss.sheetRegistered%28cssURI%2C%20sss.USER_SHEET%29%29%0A%09sss.loadAndRegisterSheet%28cssURI%2C%20sss.USER_SHEET%29%3B%0A%0A%0Athis.onDestroy%20%3D%20function%28reason%29%20%7B%0A%09this.undoCloseTabsList.destroy%28%29%3B%0A%09if%28reason%20%3D%3D%20%22update%22%20%7C%7C%20reason%20%3D%3D%20%22delete%22%29%20%7B%0A%09%09let%20sss%20%3D%20this.sss%3B%0A%09%09let%20cssURI%20%3D%20this.cssURI%3B%0A%09%09if%28sss.sheetRegistered%28cssURI%2C%20sss.USER_SHEET%29%29%0A%09%09%09sss.unregisterSheet%28cssURI%2C%20sss.USER_SHEET%29%3B%0A%09%7D%0A%7D%3B%0Aif%28this.undoCloseTabsList.options.useMenu%29%20%7B%0A%09this.type%20%3D%20%22menu%22%3B%0A%09this.orient%20%3D%20%22horizontal%22%3B%0A%7D%0A%0A%5D%5D%3E%3C/initcode%3E%0A%20%20%3Ccode%3E%3C%21%5BCDATA%5B/*CODE*/%5D%5D%3E%3C/code%3E%0A%20%20%3Caccelkey%3E%3C%21%5BCDATA%5B%5D%5D%3E%3C/accelkey%3E%0A%20%20%3Chelp%3E%3C%21%5BCDATA%5B%5D%5D%3E%3C/help%3E%0A%20%20%3Cattributes/%3E%0A%3C/custombutton%3E |
Stkvsky > 26-02-2018 20:36:36 |
SendInfo |
Coroner > 22-03-2018 21:01:33 |
SendInfo пишет
А у меня горе горькое, беда бедовая... Да только она, будучи вставлена на место положенное, сиречь панель вкладок рекомое, дюже утолщает егось, бо вкладки у меня сжаты по высоте. Покуда злые нехристи мозилловцы такие вкладки делают вельми пригож мне Арис со своими цсс иноземными... Такое с любой кнопкой происходит, но остальные на панели адреса сидят, а эту единственную я в панель вкладок ставлю. В "старой" версии кнопки я добавлял в "справку" скрытый текст Выделить код Код:#custombuttons-buttonID { margin-right: -4px !important; margin-top: -5px !important; position: fixed !important; } А в код (в самый его конец) скрытый текст Выделить код Код:var cssURI = makeURI("data:text/css," + encodeURIComponent(self.Help)); var sss = Components.classes["@mozilla.org/content/style-sheet-service;1"] .getService(Components.interfaces.nsIStyleSheetService); sss.loadAndRegisterSheet(cssURI, sss.AGENT_SHEET); Это работает, но допустимо ли вот так прям взять и вставить этот код? Может добавить чего надо? Или вставить его выше, где почти аналогичный находится? Или вообще тот что есть подредактировать? |
Dumby > 07-04-2018 11:54:25 |
Infocatcher скрытый текст Выделить код Код:get ss() { delete this.ss; return this.ss = "nsISessionStore" in Components.interfaces ? ( Components.classes["@mozilla.org/browser/sessionstore;1"] || Components.classes["@mozilla.org/suite/sessionstore;1"] ).getService(Components.interfaces.nsISessionStore) : SessionStore; }, |
Infocatcher > 07-04-2018 21:06:07 |
Dumby пишет
Ага, спасибо! |
Dumby > 24-07-2018 15:34:55 |
Infocatcher Выделить код Код:initTooltip: function() { ... document.getElementById("mainPopupSet").appendChild(tip); if(this.appVersion >= 61) { var label = document.getAnonymousElementByAttribute(tip, "class", "tooltip-label"); label && label.remove(); } }, |
drage2 > 24-07-2018 21:16:43 |
А, окончательный код, есть? Меню не видно, как раньше... |
Infocatcher > 27-07-2018 21:16:19 |
Dumby пишет
Что-то поломали они, у меня еще другой тултип самовольно скрывался при зачистке дочерних узлов. |
Alex_one > 02-08-2018 12:58:05 |
Здравствуйте! |
sonyas75 > 02-08-2018 13:46:05 |
Alex_one |
Alex_one > 02-08-2018 18:58:53 |
sonyas75 |
Alex_one > 03-08-2018 12:10:07 |
Как удалить эту строку? Скриншот |
Infocatcher > 03-08-2018 18:05:43 |
Alex_one пишет
В начале кода Далее список того, что будет выведено в меню. 03-08-2018 18:07:59 скрытый текст Выделить код Код:var options = { menuTemplate: [ "closedWindows", "separator", //"restoreClosedWindows", "clearClosedWindows", "separator", "closedTabs", "separator", //"restoreClosedTabs", "clearClosedTabs", "separator", "clearAll", "separator", "restoreLastSession", "separator", "buttonMenu" ], |
Alex_one > 04-08-2018 09:36:58 |
Infocatcher скрытый текст |
Infocatcher > 05-08-2018 12:25:20 |
Alex_one пишет
В том же массиве menuTemplate: [ … ] можно менять порядок пунктов (изначально сверху сделаны пункты про закрытые окна), за пункт «Очистить историю закрытых вкладок» отвечает строка "clearClosedTabs". |
Alex_one > 05-08-2018 15:44:08 |
Infocatcher |
solombala > 20-01-2020 22:11:29 |
Infocatcher скрытый текст var cssStr = '\ @namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");\n\ @-moz-document url("%windowURL%") {\n\ %button% {\n\ list-style-image: |
xrun1 > 21-01-2020 01:46:30 |
solombala
|
T0PMØ3iLLA > 21-01-2020 09:36:41 |
Пф.. меню закрытых вкладок показывает, для меня значит работает. Последнюю закрытую возвращаю по Ctrl+Shift+T, как-то не приходило в голову нажимать левой кнопкой мыши по этой кнопке |
Dumby > 07-03-2020 11:19:53 |
Infocatcher |
Infocatcher > 08-03-2020 23:27:47 |
Ехал инкапсулятор через инкапсулятор… |
Dumby > 09-03-2020 16:33:53 |
Infocatcher пишет
Да, это полезно, если там что-то задаётся через let, const или class Но, в данном случае, никак вредить не стали, и losslessDecodeURI Вот, есть ли здесь ошибки, если записать, например, так? скрытый текст Выделить код Код:get _losslessDecodeURI() { var ldu; if("losslessDecodeURI" in window) ldu = losslessDecodeURI; else if("UrlbarInput" in window) // Firefox 75+ ldu = Cu.import("resource:///modules/UrlbarInput.jsm", {}) .losslessDecodeURI; delete this._losslessDecodeURI; return this._losslessDecodeURI = ldu ? function(uri) { return ldu(makeURI(uri)); } : decodeURI; }, |
Infocatcher > 10-03-2020 00:20:50 |
Dumby пишет
О, и правда… Распорка упростилась: https://github.com/Infocatcher/Custom_B … 055c1e4085 Печальный у них там подход: прямо вот напрашивается декодирование ссылок во всплывающих подсказках закладок, но нет. скрытый текст chrome://browser/content/browser.js Выделить код Код:var XULBrowserWindow = { … setOverLink(url) { if (url) { url = Services.textToSubURI.unEscapeURIForUI("UTF-8", url); // Encode bidirectional formatting characters. // (RFC 3987 sections 3.2 and 4.1 paragraph 6) url = url.replace( /[\u200e\u200f\u202a\u202b\u202c\u202d\u202e]/g, encodeURIComponent ); if (UrlbarPrefs.get("trimURLs")) { url = BrowserUtils.trimURL(url); } } this.overLink = url; LinkTargetDisplay.update(); }, resource://gre/modules/Services.jsm Выделить код Код:var initTable = { … textToSubURI: ["@mozilla.org/intl/texttosuburi;1", "nsITextToSubURI"], |
Infocatcher > 14-03-2020 21:33:35 |
Undo Close Tabs 0.3.3.2 (2020-03-14) |
vending_machine > 10-06-2020 11:02:11 |
Подскажите, как удалить в коде кнопки (1)историю записи открытых окон и, соответственно, пункты про (2)Восстановить окна и (3)Очистить окна. |
momo2000 > 15-06-2020 08:27:49 |
menuTemplate: [ Удалить то, что выделено жирным |
vending_machine > 15-06-2020 08:46:29 |
momo2000 пишет
Спасибо |
Jurgens > 03-11-2020 12:07:53 |
Infocatcher ========= PS.
Никто больше не в курсе? |
xrun1 > 03-11-2020 15:47:32 |
Jurgens |
Jurgens > 03-11-2020 16:27:46 |
xrun1 ----- А как сделать, чтобы список закрытых вкладок не очищался после перезапуска браузера? |
xrun1 > 03-11-2020 16:38:50 |
Jurgens |
Jurgens > 03-11-2020 16:52:07 |
xrun1 |
xrun1 > 03-11-2020 18:10:17 |
Jurgens
|
Jurgens > 03-11-2020 18:25:34 |
xrun1 |
Infocatcher > 04-11-2020 21:20:06 |
Jurgens пишет
Так-то я заглядываю иногда… Jurgens пишет
У меня расширение Undo Close Tab работает аналогично кнопке: если сессия не была восстановлена, список закрытых вкладок пустой. Jurgens пишет
Что подразумевается под перезапуском? Но вообще, вроде как, я воспроизвел (на Firefox 83.0b8)… Но при этом в родном меню недавно закрытые вкладки тоже отсутствуют, так что это к разработчикам браузера вопрос – какая-то проблема с перезапуском. |
Jurgens > 04-11-2020 22:19:43 |
Infocatcher
Перезапуск и подразумевается. Закрытие браузера, и последующий его запуск. Но походу и что-то в самом браузере не в порядке. Установил в параметре browser.sessionstore.max_tabs_undo значение 50 - ноль эмоций, как было 25 вкладок в Undo Close Tab, так и осталось. Получается, что и в кнопке такое сделать нереально? Просто до недавнего времени сидел на FF52.9, теперь вот пытаюсь насколько возможно интегрировать свои привычные плюшки в FF82. |
Jurgens > 05-11-2020 13:58:15 |
Ну вот так нагляднее будет наверное: Меню расширения Undo Close Tab - 25 записей Меню расширения Undo Close Tab - без изменений |
Rango > 28-11-2020 16:57:46 |
Infocatcher пишет
Не-не, он прав, всего пару версий ФФ назад всё сохранялось. Jurgens пишет
Офигеть, а я голову себе уже сломал почему изменилось. 28-11-2020 16:58:40 |
vending_machine > 22-05-2023 12:35:42 |
Почему-то перестал по правому клику выпадать список закрытых вкладок. В найденной Bump version to 0.3.3.3 - 2021-09-04 — то же. |
Dumby > 22-05-2023 16:15:42 |
vending_machine пишет
Что значит «перестал»? Чтобы по правому клику стал выпадать список закрытых вкладок, |
vending_machine > 22-05-2023 16:36:58 |
Dumby пишет
Да, видимо, после этого. Я тогда начал просто пользоваться кнопкой История. А теперь думаю - "а один-то клик лучше"
Спасибо. |
vending_machine > 29-03-2024 21:25:27 |
¿ Можно ли в этой замечательной кнопке сделать так, чтобы она не запоминала определённый сайт ? (открывающийся по клику в другом приложении) |
Alex_one > 30-03-2024 13:40:23 |
Здравствуйте. |
VORON > 30-03-2024 13:57:34 |
Alex_one скрытый текст Выделить код Код:// http://infocatcher.ucoz.net/js/cb/undoCloseTabs.js // https://forum.mozilla-russia.org/viewtopic.php?id=56267 // https://github.com/Infocatcher/Custom_Buttons/tree/master/Undo_Close_Tabs // Undo Close Tabs button for Custom Buttons // (code for "initialization" section) // (c) Infocatcher 2009-2021 // version 0.3.3.3 - 2021-09-04 var options = { menuTemplate: [ "closedWindows", "separator", "restoreClosedWindows", "clearClosedWindows", "separator", "closedTabs", "separator", "restoreClosedTabs", "clearClosedTabs", "separator", "clearAll", "separator", "restoreLastSession", "separator", "buttonMenu" ], showInTabContextMenu: false, /* menuTemplateTabContext: [ // like menuTemplate "closedTabs", "separator", "restoreClosedTabs", "clearClosedTabs" ], */ windowItemTemplate: "(%count) %title", windowSelectedTabPrefix: "*", buttonTipTemplate: ["header", "title", "url", "closedAt"], itemTipTemplate: ["title", "url", "closedAt"], hideRestoreAllForSingleEntry: false, allowDeleteEntries: true, accesskeys: { // Empty string ("") to disable or string with possible values ("0123...", "abcd...") closedTabs: "", closedWindows: "" }, accesskeySeparator: " ", // <accesskey><separator><label> openMenuOnMouseover: false, useMenu: false, rightClickToUndoCloseTab: false // Useful with "useMenu: true" }; function _localize(sid) { var strings = { en: { restoreTab: "Restore the most recently closed tab", restoreAllTabs: "Restore all tabs", restoreAllTabsAccesskey: "t", clearTabsHistory: "Clear history of closed tabs", clearTabsHistoryAccesskey: "b", restoreAllWindows: "Restore all windows", restoreAllWindowsAccesskey: "w", clearWindowsHistory: "Clear history of closed windows", clearWindowsHistoryAccesskey: "d", clearAllHistory: "Clear all history", clearAllHistoryAccesskey: "C", restoreLastSession: "Restore last session", restoreLastSessionAccesskey: "s", deleteUndoEntry: "Delete", buttonMenu: "Button menu", buttonMenuAccesskey: "m", tabContextMenu: "Recently Closed Tabs", tabContextMenuAccesskey: "y", itemTip: "%ago ago, %date", day: "d" }, ru: { restoreTab: "Восстановить последнюю закрытую вкладку", restoreAllTabs: "Восстановить все вкладки", restoreAllTabsAccesskey: "л", clearTabsHistory: "Очистить историю закрытых вкладок", clearTabsHistoryAccesskey: "д", restoreAllWindows: "Восстановить все окна", restoreAllWindowsAccesskey: "о", clearWindowsHistory: "Очистить историю закрытых окон", clearWindowsHistoryAccesskey: "н", clearAllHistory: "Очистить всю историю", clearAllHistoryAccesskey: "ч", restoreLastSession: "Восстановить последнюю сессию", restoreLastSessionAccesskey: "с", deleteUndoEntry: "Удалить", buttonMenu: "Меню кнопки", buttonMenuAccesskey: "М", tabContextMenu: "Недавно закрытые вкладки", tabContextMenuAccesskey: "о", itemTip: "%ago назад, %date", day: "д" } }; var locale = (function() { if("Services" in window && "locale" in Services) { var locales = Services.locale.requestedLocales // Firefox 64+ || Services.locale.getRequestedLocales && Services.locale.getRequestedLocales(); if(locales) return locales[0]; } var prefs = "Services" in window && Services.prefs || Components.classes["@mozilla.org/preferences-service;1"] .getService(Components.interfaces.nsIPrefBranch); function pref(name, type) { return prefs.getPrefType(name) != prefs.PREF_INVALID ? prefs["get" + type + "Pref"](name) : undefined; } if(!pref("intl.locale.matchOS", "Bool")) { // Also see https://bugzilla.mozilla.org/show_bug.cgi?id=1414390 var locale = pref("general.useragent.locale", "Char"); if(locale && locale.substr(0, 9) != "chrome://") return locale; } return Components.classes["@mozilla.org/chrome/chrome-registry;1"] .getService(Components.interfaces.nsIXULChromeRegistry) .getSelectedLocale("global"); })().match(/^[a-z]*/)[0]; _localize = function(sid) { return strings[locale] && strings[locale][sid] || strings.en[sid] || sid; }; return _localize.apply(this, arguments); } var JSON = "JSON" in window ? { parse: function(arg) { return typeof arg == "string" ? (JSON = window.JSON).parse(arg) : (this.parse = function(obj) { return obj; }) && arg; } } : "nsIJSON" in Components.interfaces ? { parse: function(s) { return Components.classes["@mozilla.org/dom/json;1"] .createInstance(Components.interfaces.nsIJSON) .decode(s); } } : { parse: function(s) { return Components.utils.evalInSandbox("(" + s + ")", new Components.utils.Sandbox("about:blank")); } }; this.onclick = function(e) { if(e.target != this) return; if(e.button == 1 || e.button == 0 && (e.ctrlKey || e.shiftKey || e.altKey || e.metaKey)) this.undoCloseTabsList.clearAllLists(); else if( e.button == 0 || e.button == 2 && !e.ctrlKey && !e.shiftKey && !e.altKey && !e.metaKey && this.undoCloseTabsList.options.rightClickToUndoCloseTab ) { if( e.button == 0 && !this.undoCloseTabsList.options.useMenu || e.button == 2 && this.undoCloseTabsList.options.rightClickToUndoCloseTab ) { if(this.undoCloseTabsList.closedTabCount) this.undoCloseTabsList.undoCloseTab(); else this.undoCloseTabsList.drawUndoList() && this.undoCloseTabsList.showMenu(e); } // Allow use "command" section only from hotkey: e.preventDefault(); e.stopPropagation(); } }; if(!this.hasOwnProperty("defaultContextId")) this.defaultContextId = this.getAttribute("context") || "custombuttons-contextpopup"; this.onmousedown = function(e) { if(e.target != this) return; if(this.undoCloseTabsList.options.useMenu) { if(e.button == 0) this.undoCloseTabsList.drawUndoList(); } else if(e.button == 2) { var showCbMenu = e.ctrlKey || e.shiftKey || e.altKey || e.metaKey || !this.undoCloseTabsList.drawUndoList(); this.setAttribute( "context", showCbMenu ? this.defaultContextId : this.undoCloseTabsList.mpId ); } }; this.onmouseover = function(e) { if(e.target != this) return; if(!this.disabled) this.undoCloseTabsList.updUI(); this.undoCloseTabsList.options.useMenu && Array.prototype.some.call( this.parentNode.getElementsByTagName("*"), function(node) { if( node != this && node.namespaceURI == xulns // See https://github.com/Infocatcher/Custom_Buttons/issues/28 //&& node.boxObject //&& node.boxObject instanceof Components.interfaces.nsIMenuBoxObject && "open" in node && node.open && node.getElementsByTagName("menupopup").length && this.undoCloseTabsList.drawUndoList() ) { node.open = false; this.open = true; return true; } return false; }, this ); if( this.undoCloseTabsList.options.openMenuOnMouseover && this.undoCloseTabsList.drawUndoList() ) this.undoCloseTabsList.openMenu(); }; this.undoCloseTabsList = { button: this, options: options, mpId: this.id + "-context", cmId: this.id + "-contextSub", tcmId: this.id + "-tabContextMenu", tipId: this.id + "-tooltip", errPrefix: "[Custom Buttons :: Undo Close Tabs List]: ", get mp() { var btn = this.button; var mp = btn.getElementsByTagName("menupopup"); mp = mp.length && mp[0]; mp && mp.parentNode.removeChild(mp); mp = this.createElement("menupopup", { id: this.mpId, onclick: "this.parentNode.undoCloseTabsList.checkForMiddleClick(event);", onpopupshowing: "if(event.target == this) document.popupNode = this.parentNode;", onpopuphidden: "if(event.target == this) document.popupNode = null;" }); if(this.cm) mp.setAttribute("context", this.cmId); var tb = btn.parentNode; if( this.options.useMenu && tb.getAttribute("orient") == "vertical" ) { // https://addons.mozilla.org/firefox/addon/vertical-toolbar/ var isRight = tb.parentNode.getAttribute("placement") == "right"; mp.setAttribute("position", isRight ? "start_before" : "end_before"); } delete this.mp; return this.mp = btn.appendChild(mp); }, get useCentextMenu() { delete this.useCentextMenu; return this.useCentextMenu = this.options.allowDeleteEntries && ("forgetClosedTab" in this.ss || "forgetClosedWindow" in this.ss); }, get cm() { delete this.cm; if(!this.useCentextMenu) return this.cm = null; var cm = document.getElementById(this.cmId); cm && cm.parentNode.removeChild(cm); cm = this.createElement("menupopup", { id: this.cmId, onpopupshowing: "return this.undoCloseTabsList.canDeleteUndoEntry(this.triggerNode || document.popupNode);" }); var mi = this.createElement("menuitem", { oncommand: "this.parentNode.undoCloseTabsList.deleteUndoEntry(this.parentNode.triggerNode || document.popupNode);", label: _localize("deleteUndoEntry"), closemenu: "single" }); cm.appendChild(mi); cm.undoCloseTabsList = this; return this.cm = document.getElementById("mainPopupSet").appendChild(cm); }, get cbMenu() { var cbPopup = document.getElementById(this.button.defaultContextId); if(!cbPopup) { Components.utils.reportError(this.errPrefix + "cb menu not found"); return this.cbMenu = null; } cbPopup = cbPopup.cloneNode(true); var id = "-" + this.button.id.match(/\d*$/)[0] + "-cloned"; cbPopup.id += id; Array.prototype.slice.call(cbPopup.getElementsByAttribute("id", "*")).forEach(function(node) { node.id += id; }); var menu = this.createElement("menu", { label: _localize("buttonMenu"), accesskey: _localize("buttonMenuAccesskey") }); menu.appendChild(cbPopup); cbPopup.setAttribute( "onpopupshowing", '\ var btn = document.popupNode = this.parentNode.parentNode.parentNode\n\ .undoCloseTabsList.button;\n\ custombutton.setContextMenuVisibility(btn);' ); delete this.cbMenu; return this.cbMenu = menu; }, get ss() { delete this.ss; return this.ss = "nsISessionStore" in Components.interfaces ? ( Components.classes["@mozilla.org/browser/sessionstore;1"] || Components.classes["@mozilla.org/suite/sessionstore;1"] ).getService(Components.interfaces.nsISessionStore) : SessionStore; // Firefox 61+ https://bugzilla.mozilla.org/show_bug.cgi?id=1450559 }, get appInfo() { delete this.appInfo; return this.appInfo = Components.classes["@mozilla.org/xre/app-info;1"] .getService(Components.interfaces.nsIXULAppInfo); }, get appVersion() { delete this.appVersion; return this.appVersion = parseFloat(this.appInfo.version); }, get platformVersion() { delete this.platformVersion; return this.platformVersion = parseFloat(this.appInfo.platformVersion); }, get appName() { delete this.appName; return this.appName = this.appInfo.name; }, init: function() { window.addEventListener("TabClose", this, false); window.addEventListener("SSTabRestoring", this, false); window.addEventListener("unload", this, false); if(this.appName == "SeaMonkey") // No SSTab* events in SeaMonkey window.addEventListener("TabOpen", this, false); setTimeout(function(_this) { _this.mp.addEventListener("DOMMenuItemActive", _this, false); _this.mp.addEventListener("DOMMenuItemInactive", _this, false); _this.initTooltip(); }, 50, this); this.addPbExitObserver(true); this.updUIGlobal(); if(this.options.showInTabContextMenu) setTimeout(function(_this) { _this.initTabContext(); }, 100, this); }, initTabContext: function() { var origMi = this.tabContextUndoClose; if(!origMi) { LOG("Can't find \"Undo Close Tab\" item in tab context menu"); return; } var menu = document.getElementById(this.tcmId); menu && menu.parentNode.removeChild(menu); // For SeaMonkey menu = this.createElement("menu", { id: this.tcmId, label: _localize("tabContextMenu"), accesskey: _localize("tabContextMenuAccesskey"), tooltip: this.tipId, popupsinherittooltip: "true" }); menu.undoCloseTabsList = this; menu.onclick = function(e) { if(e.target != this) return; if(e.button == 1 || e.button == 0 && (e.ctrlKey || e.shiftKey || e.altKey || e.metaKey)) { if(this.undoCloseTabsList.closedTabCount) { this.undoCloseTabsList.undoCloseTab(); closeMenus(this); } } }; var origMp = this.mp; var mp = origMp.cloneNode(true); mp.id = this.button.id + "-tabContext"; var _this = this; function drawUndoList() { var ok = false; var opts = _this.options; var origTemplate = opts.menuTemplate; opts.menuTemplate = opts.menuTemplateTabContext || origTemplate; _this.mp = mp; try { ok = _this.drawUndoList(); } catch(e) { Components.utils.reportError(e); } opts.menuTemplate = origTemplate; _this.mp = origMp; return ok; } function updMenu() { if(drawUndoList()) menu.removeAttribute("disabled"); else menu.setAttribute("disabled", "true"); } mp._updatePopup = function(e) { if(e.target != this) return; document.popupNode = _this.button; drawUndoList(); }; mp.setAttribute("onpopupshowing", "this._updatePopup(event);"); mp.onclick = function(e) { _this.checkForMiddleClick(e, updMenu); }; menu.appendChild(mp); addEventListener("popupshown", function(e) { if(e.target == e.currentTarget) setTimeout(updMenu, 0); // Pseudo async }, false, origMi.parentNode); addEventListener("DOMMenuItemActive", this, false, mp); addEventListener("DOMMenuItemInactive", this, false, mp); origMi.parentNode.insertBefore(menu, origMi.nextSibling); origMi.setAttribute("hidden", "true"); }, initTooltip: function() { var tip = document.getElementById(this.tipId); tip && tip.parentNode.removeChild(tip); tip = this.tip = this.createElement("tooltip", { id: this.tipId, orient: "vertical", onpopupshowing: "return this.undoCloseTabsList.updTooltip(this, this.triggerNode || document.tooltipNode);", onpopuphiding: "this.cancelUpdateTimer();" }); tip.undoCloseTabsList = this; tip._updateTimer = 0; tip.initUpdateTimer = function(fn, context) { if(this._updateTimer) clearInterval(this._updateTimer); this._updateTimer = setInterval(function() { fn.call(context); }, 1000); }; tip.cancelUpdateTimer = function() { if(this._updateTimer) { clearInterval(this._updateTimer); this._updateTimer = 0; } }; var btn = this.button; btn.removeAttribute("tooltiptext"); btn.setAttribute("tooltip", this.tipId); btn.setAttribute("popupsinherittooltip", "true"); document.getElementById("mainPopupSet").appendChild(tip); if(this.appVersion >= 61 && "getAnonymousElementByAttribute" in document) { var label = document.getAnonymousElementByAttribute(tip, "class", "tooltip-label"); label && label.remove(); } }, _hasPbExitObserver: false, addPbExitObserver: function(add) { if(add == this._hasPbExitObserver || !("Services" in window)) return; this._hasPbExitObserver = add; if(add) Services.obs.addObserver(this, "last-pb-context-exited", false); else Services.obs.removeObserver(this, "last-pb-context-exited"); }, destroy: function() { window.removeEventListener("TabClose", this, false); window.removeEventListener("SSTabRestoring", this, false); window.removeEventListener("unload", this, false); if(this.appName == "SeaMonkey") window.removeEventListener("TabOpen", this, false); this.mp.removeEventListener("DOMMenuItemActive", this, false); this.mp.removeEventListener("DOMMenuItemInactive", this, false); this.addPbExitObserver(false); var menu = document.getElementById(this.tcmId); if(menu) { menu.parentNode.removeChild(menu); this.tabContextUndoClose.removeAttribute("hidden"); } var tip = this.tip; tip && tip.parentNode && tip.parentNode.removeChild(tip); }, handleEvent: function(e) { switch(e.type) { case "TabClose": case "SSTabRestoring": case "TabOpen": setTimeout(function(_this) { _this.updUI(); }, 0, this); break; case "DOMMenuItemActive": case "DOMMenuItemInactive": if(!("XULBrowserWindow" in window)) break; XULBrowserWindow.setOverLink( e.type == "DOMMenuItemActive" ? (e.target.getAttribute("cb_urlDecoded") || "") .replace(/ \n/g, ", ") : "", null ); break; case "unload": this.updUIGlobal(); this.destroy(); } }, observe: function(subject, topic, data) { if(topic == "last-pb-context-exited") { setTimeout(function(_this) { _this.updUI(); }, 25, this); } }, createElement: function(name, attrs) { var node = document.createElementNS(xulns, name); if(attrs) for(var attrName in attrs) if(attrs.hasOwnProperty(attrName)) node.setAttribute(attrName, attrs[attrName]); return node; }, get tabContextUndoClose() { return document.getElementById("context_undoCloseTab") || document.getElementById("tabContextUndoCloseTab") // Firefox 2.0 || document.getAnonymousElementByAttribute(gBrowser, "tbattr", "tabbrowser-undoclosetab"); // SeaMonkey }, get closedWindowCount() { if(!("getClosedWindowCount" in this.ss)) { delete this.closedWindowCount; return this.closedWindowCount = 0; } this.__defineGetter__("closedWindowCount", function() { return this.ss.getClosedWindowCount(); }); return this.closedWindowCount; }, get closedTabCount() { return this.ss.getClosedTabCount(window); }, undoCloseTab: function(i) { if("undoCloseTab" in window) // Firefox 2.0+ undoCloseTab(i); else // SeaMonkey gBrowser.undoCloseTab(i); }, clearUndoTabsList: function() { var closedTabCount = this.closedTabCount; if(!closedTabCount) return; if("forgetClosedTab" in this.ss) // Gecko 1.9.2+ while(closedTabCount--) this.ss.forgetClosedTab(window, 0); else { // Doesn't work in SeaMonkey const pName = "browser.sessionstore.max_tabs_undo"; let val = cbu.getPrefs(pName); cbu.setPrefs(pName, 0); cbu.setPrefs(pName, val); } this.updUIGlobal(); }, clearUndoWindowsList: function() { var closedWindowCount = this.closedWindowCount; if(!closedWindowCount) return; if("forgetClosedWindow" in this.ss) // Gecko 1.9.2+ while(closedWindowCount--) this.ss.forgetClosedWindow(0); else this.ss.setWindowState(window, '{"windows":[{}],"_closedWindows":[]}', false); this.updUIGlobal(); }, clearAllLists: function() { this.clearUndoTabsList(); this.clearUndoWindowsList(); }, canDeleteUndoEntry: function(mi) { switch(mi.getAttribute("cb_type")) { case "tab": return "forgetClosedTab" in this.ss; case "window": return "forgetClosedWindow" in this.ss; } return false; }, deleteUndoEntry: function(mi) { var i = +mi.getAttribute("cb_index"); if(mi.getAttribute("cb_type") == "window") { this.ss.forgetClosedWindow(i); this.updUIGlobal(); } else { this.ss.forgetClosedTab(window, i); this.updUI(); } this.drawUndoList(); }, showMenu: function(e, isContext, mp) { var btn = this.button; document.popupNode = btn.ownerDocument.popupNode = btn; if(!mp) mp = this.mp; if("openPopupAtScreen" in mp) mp.openPopupAtScreen(e.screenX, e.screenY, isContext); else mp.showPopup(btn, e.screenX, e.screenY, isContext ? "context" : "popup", null, null); }, openMenu: function() { var mp = this.mp; if("openPopup" in mp) mp.openPopup(this.button, "after_start"); else mp.showPopup(this.button, -1, -1, "popup", "bottomleft", "topleft"); }, drawUndoList: function() { var mp = this.mp; var wc = this.closedWindowCount; var tc = this.closedTabCount; var ss = this.ss; var canRestoreLastSession = "restoreLastSession" in ss && ss.canRestoreLastSession if(!wc && !tc && !canRestoreLastSession) { mp.textContent = ""; mp.hidePopup(); return false; } this._undoWindowItems = wc && JSON.parse(ss.getClosedWindowData()); this._undoTabItems = tc && JSON.parse(ss.getClosedTabData(window)); var df = document.createDocumentFragment(); this.options.menuTemplate.forEach(function(sid, indx, arr) { switch(sid) { case "closedWindows": wc && this.addUndoWindowsList(df); break; case "restoreClosedWindows": wc > this.options.hideRestoreAllForSingleEntry && df.appendChild(this.createElement("menuitem", { label: _localize("restoreAllWindows"), accesskey: _localize("restoreAllWindowsAccesskey"), oncommand: "for(var i = 0; i < " + this._undoWindowItems.length + "; ++i) undoCloseWindow();" })); break; case "clearClosedWindows": wc && df.appendChild(this.createElement("menuitem", { label: _localize("clearWindowsHistory"), accesskey: _localize("clearWindowsHistoryAccesskey"), oncommand: "this.parentNode.parentNode.undoCloseTabsList.clearUndoWindowsList();" })); break; case "closedTabs": tc && this.addUndoTabsList(df); break; case "restoreClosedTabs": tc > this.options.hideRestoreAllForSingleEntry && df.appendChild(this.createElement("menuitem", { label: _localize("restoreAllTabs"), accesskey: _localize("restoreAllTabsAccesskey"), oncommand: "for(var i = 0; i < " + this._undoTabItems.length + "; ++i) this.parentNode.parentNode.undoCloseTabsList.undoCloseTab();" })); break; case "clearClosedTabs": tc && df.appendChild(this.createElement("menuitem", { label: _localize("clearTabsHistory"), accesskey: _localize("clearTabsHistoryAccesskey"), oncommand: "this.parentNode.parentNode.undoCloseTabsList.clearUndoTabsList();" })); break; case "clearAll": ( wc && tc || wc && arr.indexOf("clearClosedWindows") == -1 || tc && arr.indexOf("clearClosedTabs") == -1 ) && df.appendChild(this.createElement("menuitem", { label: _localize("clearAllHistory"), accesskey: _localize("clearAllHistoryAccesskey"), oncommand: "this.parentNode.parentNode.undoCloseTabsList.clearAllLists();" })); break; case "restoreLastSession": // Gecko 2.0+ canRestoreLastSession && df.appendChild(this.createElement("menuitem", { label: _localize("restoreLastSession"), accesskey: _localize("restoreLastSessionAccesskey"), oncommand: "this.parentNode.parentNode.undoCloseTabsList.ss.restoreLastSession();" })); break; case "buttonMenu": let cbMenu = this.cbMenu; if(cbMenu) df.appendChild(cbMenu); break; case "separator": if(df.hasChildNodes() && df.lastChild.localName != "menuseparator") df.appendChild(document.createElementNS(xulns, "menuseparator")); break; default: Components.utils.reportError(this.errPrefix + 'Invalid template entry: "' + sid + '"'); } }, this); while(df.hasChildNodes() && df.lastChild.localName == "menuseparator") df.removeChild(df.lastChild); this._undoWindowItems = this._undoTabItems = null; mp.textContent = ""; if(!df.hasChildNodes()) { mp.hidePopup(); return false; } mp.appendChild(df); return true; }, addUndoWindowsList: function(undoPopup) { // Based on code from chrome://browser/content/browser.js // Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.3a1pre) Gecko/20090824 Minefield/3.7a1pre var keys = this.options.accesskeys.closedWindows; this._undoWindowItems.forEach(function(undoItem, i) { var tabs = undoItem.tabs; var [key, keyPrefix] = this.getKey(keys, i); var title = undoItem.title; var selected = undoItem.selected; var selectedTab = tabs[selected && selected - 1]; var urls = []; tabs.forEach(function(tab) { if(!tab.entries || !tab.entries.length) // Can be [] for about:blank return; var url = this.convertURI(tab.entries[tab.index - 1].url, 120); var selectedPrefix = tab == selectedTab && tabs.length > 1 ? this.options.windowSelectedTabPrefix : ""; urls.push(selectedPrefix + url); }, this); var url = urls.join(" \n"); var mi = this.createElement("menuitem", { label: keyPrefix + this.options.windowItemTemplate .replace("%title", title) .replace("%count", tabs.length), accesskey: key, "class": "menuitem-iconic bookmark-item menuitem-with-favicon", oncommand: "undoCloseWindow(" + i + ");", cb_url: url, cb_urlDecoded: this.convertURI(url), cb_closedAt: undoItem.closedAt || 0, cb_index: i, cb_type: "window" }); if(this.cm) mi.setAttribute("context", this.cmId); var icon = selectedTab.image || selectedTab.attributes && selectedTab.attributes.image; if(icon) mi.setAttribute("image", this.cachedIcon(icon)); if(i == 0) mi.setAttribute("key", "key_undoCloseWindow"); undoPopup.appendChild(mi); }, this); }, addUndoTabsList: function(undoPopup) { // Based on code from chrome://browser/content/browser.js // Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.3a1pre) Gecko/20090824 Minefield/3.7a1pre var keys = this.options.accesskeys.closedTabs; this._undoTabItems.forEach(function(undoItem, i) { var state = undoItem.state; var [key, keyPrefix] = this.getKey(keys, i); var title = undoItem.title; var url = state && state.entries && state.entries[state.index - 1].url || ""; var mi = this.createElement("menuitem", { label: keyPrefix + title, accesskey: key, class: "menuitem-iconic bookmark-item menuitem-with-favicon", oncommand: "this.parentNode.parentNode.undoCloseTabsList.undoCloseTab(" + i + ");", cb_url: url, cb_urlDecoded: this.convertURI(url), cb_closedAt: undoItem.closedAt || 0, cb_index: i, cb_type: "tab" }); if( state && "attributes" in state && "privateTab-isPrivate" in state.attributes ) // https://addons.mozilla.org/addon/private-tab/ mi.setAttribute("privateTab-isPrivate", "true"); if(this.cm) mi.setAttribute("context", this.cmId); var image = undoItem.image // Firefox || state && state.attributes && state.attributes.image // SeaMonkey || state && state.xultab && /(?:^| )image=(\S+)/.test(state.xultab) && decodeURI(RegExp.$1); // Only Firefox 2.0 ? if(image) mi.setAttribute("image", this.cachedIcon(image)); if(i == 0) mi.setAttribute("key", "key_undoCloseTab"); undoPopup.appendChild(mi); }, this); }, getKey: function(keys, i) { var key = keys && keys.charAt(i % keys.length); var keyPrefix = keys && (key + this.options.accesskeySeparator); return [key, keyPrefix]; }, checkForMiddleClick: function(e, upd) { var mi = e.target; if( "doCommand" in mi && e.button == 1 && mi.parentNode == e.currentTarget ) { mi.doCommand(); if(upd) upd(); else this.drawUndoList(); } }, crop: function(s, crop) { if(crop == undefined) crop = 500; if(s.length <= crop) return s; var start = Math.round(crop*0.6); return s.substr(0, start) + "…" + s.substr(start - crop); }, convertURI: function(uri, crop) { if(!uri || uri.indexOf("\n") != -1) return uri; uri = this.losslessDecodeURI(uri); return this.crop(uri, crop); }, losslessDecodeURI: function(uri) { if(uri) try { return this._losslessDecodeURI(uri); } catch(e) { Components.utils.reportError(e); } return uri; }, get _losslessDecodeURI() { var ldu; if("losslessDecodeURI" in window) ldu = losslessDecodeURI; else if("UrlbarInput" in window) // Firefox 75+ ldu = Components.utils.import("resource:///modules/UrlbarInput.jsm", {}).losslessDecodeURI; delete this._losslessDecodeURI; return this._losslessDecodeURI = ldu ? function(uri) { return ldu(makeURI(uri)); } : decodeURI; }, cachedIcon: function(src) { src = src.replace(/[&#]-moz-resolution=\d+,\d+$/, ""); // Firefox 22+ if( !/^https?:/.test(src) // IDN, see https://bugzilla.mozilla.org/show_bug.cgi?id=311045 || /^https?:\/\/[^.:\/]+\.[^a-z0-9-]+(?:\/|$)/.test(src) && this.platformVersion < 46 || this.appName == "SeaMonkey" && this.appVersion <= 2 || this.appName == "Firefox" && this.appVersion <= 3.5 ) return src; return "moz-anno:favicon:" + src; // https://bugzilla.mozilla.org/show_bug.cgi?id=467828 }, updUI: function() { var tabsCount = this.closedTabCount; var dis = !tabsCount && !this.closedWindowCount; if( dis && this.options.useMenu && this.options.menuTemplate.indexOf("restoreLastSession") != -1 && "restoreLastSession" in this.ss && this.ss.canRestoreLastSession ) dis = false; this.button.disabled = dis; }, updTooltip: function(tip, tn) { var template, header, title, url, closedAt; if(tn == this.button) { template = this.options.buttonTipTemplate; header = _localize("restoreTab"); let undoTabItems = JSON.parse(this.ss.getClosedTabData(window)); if(undoTabItems.length) { let lastItem = undoTabItems[0]; title = lastItem.title; url = lastItem.state && lastItem.state.entries && lastItem.state.entries[lastItem.state.index - 1].url; closedAt = lastItem.closedAt || 0; } } else if(tn.hasAttribute("cb_index")) { template = this.options.itemTipTemplate; title = tn.getAttribute("label"); url = tn.getAttribute("cb_url"); closedAt = +tn.getAttribute("cb_closedAt"); } else { return false; } var tipData = this.getTooltipData(template, header, title, url, closedAt); tip.textContent = ""; tip.appendChild(tipData); if(closedAt && template.indexOf("closedAt") != -1) { tip.initUpdateTimer(function() { var tipData = this.getTooltipData(template, header, title, url, closedAt); if(tipData.textContent != tip.textContent) { tip.textContent = ""; tip.appendChild(tipData); } }, this); } return tip.hasChildNodes(); }, getTooltipData: function(template, header, title, url, closedAt) { var df = document.createDocumentFragment(); var hasHeader = header && template.indexOf("header") != -1; function item(key, val) { var lbl = document.createElementNS(xulns, "label"); lbl.className = "cb-" + key + " tooltip-label"; lbl.textContent = val; lbl.setAttribute("maxwidth", "450"); // Trick to restore right border for long lines if(key == "closedAt" || hasHeader && key != "header") lbl.style.color = "grayText"; return df.appendChild(lbl); } template.forEach(function(key) { switch(key) { case "header": if(header) item(key, header); break; case "title": if(title && title != url) item(key, title); break; case "url": if(url) item(key, this.convertURI(url)); break; case "closedAt": if(!closedAt) break; let dt = Math.round(Math.max(0, Date.now() - closedAt)/1000); let days = Math.floor(dt/24/3600); dt -= days*24*3600; let d = new Date((dt + new Date(dt).getTimezoneOffset()*60)*1000); let m = d.getMinutes(); let ts = d.getHours() + ":" + (m > 9 ? m : "0" + m); if(days) ts = days + _localize("day") + " " + ts; let tsTip = _localize("itemTip") .replace("%ago", ts) .replace("%date", new Date(closedAt).toLocaleString()); item(key, tsTip); } }, this); return df; }, get wm() { delete this.wm; return this.wm = Components.classes["@mozilla.org/appshell/window-mediator;1"] .getService(Components.interfaces.nsIWindowMediator); }, updUIGlobal: function() { var isSeaMonkey = this.appName == "SeaMonkey"; var ws = this.wm.getEnumerator(isSeaMonkey ? null : "navigator:browser"); const id = this.button.id; while(ws.hasMoreElements()) { let win = ws.getNext(); if(isSeaMonkey && !this.isBrowserWindow(win)) continue; let btn = win.document.getElementById(id); if(btn && "undoCloseTabsList" in btn) { let ucl = btn.undoCloseTabsList; ucl.ensureSessionsInitialized(ucl.updUI, ucl); } } }, isBrowserWindow: function(win) { var loc = window.location.href; return loc == "chrome://browser/content/browser.xul" || loc == "chrome://navigator/content/navigator.xul"; }, ensureSessionsInitialized: function(callback, context) { var _this = this; var stopTime = Date.now() + 3e3; (function ensureInitialized() { try { _this.ss.getClosedTabCount(window); callback.call(context); return; } catch(e) { if(Date.now() > stopTime) { Components.utils.reportError( _this.errPrefix + "Can't initialize: nsISessionStore.getClosedTabCount() failed" ); Components.utils.reportError(e); return; } } setTimeout(ensureInitialized, 50); })(); } }; if(!this.undoCloseTabsList.options.useMenu && this.undoCloseTabsList.useCentextMenu) { this.oncontextmenu = function(e) { if( e.target != this || e.ctrlKey || e.shiftKey || e.altKey || e.metaKey || !this.undoCloseTabsList.mp.hasChildNodes() ) return; e.preventDefault(); this.undoCloseTabsList.showMenu(e); // Show menu without "context" flag }; } if(this.undoCloseTabsList.options.rightClickToUndoCloseTab) { this.oncontextmenu = function(e) { if(e.target == this && !e.ctrlKey && !e.shiftKey && !e.altKey && !e.metaKey) e.preventDefault(); }; } this.disabled = true; setTimeout(function(_this) { _this.undoCloseTabsList.init(); }, 0, this); //=================== // Styles // Used icons from Undo Closed Tabs Button extension // Styles can't override hardcoded icon if( // Remove icon only if nsIStyleSheetService works on-the-fly (Firefox 3.0+) !Components.ID("{41d979dc-ea03-4235-86ff-1e3c090c5630}") .equals(Components.interfaces.nsIStyleSheetService) ) { let icon = this.icon || this.ownerDocument.getAnonymousElementByAttribute(this, "class", "toolbarbutton-icon"); if(icon) icon.src = ""; else this.image = ""; } var cssStr = '\ @namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");\n\ @-moz-document url("%windowURL%") {\n\ %button% {\n\ list-style-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAEEUlEQVRIS9XVbWxTVRgA4Pfce3tv27t2bbNuXbfCBuyzAZ2MEdkkLH5gJvEH8TOZEo0JFdgmbgjTgEHUGQXGMJEMmDJMiNvQjS9BJhH8MY3IfsB0rnTraCcbm13b2+/1fni2xAVuxOHAH57+adNz3uee9z3vuQj+44FmG79VksglAIoMgBhCSLpdnFkBkiQxl2OQgRdbJhjoKkQofM+ALklSGSNwf1iAjbXNZ3MdI+MB+7vPF989IEnoZwBVQhCWBgVhW13b+WX5KXpFR7fDe/ntZ8wYiONUiXLojlKEU4LGANgRDpZHBH7r9iPnilZaM4jKFTlQ/P5XvHV+6o5si7HzuWUL+hzngSstRfxf0DSwa9cHa3GgWgmQTv4UNMMggyWTMuYtYepOXCKfKMiGZ4tyQEMDjPrDcGVoDI780As3/AGhJIVs2vTk6pqkJAhOFn8KaG1tpV1u53h5+RpGr7s1/uTxCIgk6g/EiaqmM2i5NRseL7SCgwMg8Wo9A5CsBLjPADDki8CbbRdgQiI631n/2NOFANwUUF9frxPECVf1628gn893Sx55IIhxBavcffIi1fO7H15atRJiAoD8XBI4UmYCwOIkCdY3fyuyrGrHZ+UldXJAwoDn5hThQESYpNXXQpJuw4HTiuzM+fBAfu7UFIQ/0wN/nfydrEKwSCdARfMZftVSa6kcEPx+v0NeA7wlKowYXX+AT604+DWTmT4XcufhFsN6r9MJ/gAHiVotpBmNoNNoIctAw8Xf7FKMjx2TA7zX6/3p7860SBCKEGJSBrj4PIyozMkm0KhZsDv7hTUP5Xt+HfFpuvqGVBZTKizEuOePEYiL0V/kQJzjuG9u1zS8RDAhRFv6/FFr5YFTaopicJGRt932yDmJQLQ3JpY9+lEHVZCTB6PecTAmEMNyIIZr8MU/3U8iSSo5RGfZPZGFFftPaU0a9dgxW+mXBEGQtJJ5xbq1hUo3mdENzxjYyoq65UAUA5/MdAGKiFQHSGbB1WEPDZGIq3COYRQD1I/XPJttn39PKRlWYpUgfvraU2/JgXAwGHxvRkAUEd6JAteYJAUhioNLwaigLN1z8sNQLA5mQyK//YWHr8zRaV9EjY2NikDAuwkQ2oL7IIRH9UzATf9PPuBUS4gIKY92u/Zf5zhixaKsAa1BXzOhhrNoz96d21JNaavT0tO9xQ+W5GDg5X8BTE/lCSIBUcqW3kGX3XW1Jz7sdtVXrn31EGpo2Nm0bl1VHt7maTw7Eo1GL8wGwPcOiRSKMpIgUpzOAd2JjqOdNTW1B1HDx7ttlRs2mnCDHZ5NYPkalmXnut3uxe3tbZeqqzd/h/bt21tgs1WocYP13AtAr9cnDg4Omo8fb7leVbXFdUfvg7uB///An8idyhRIYoVPAAAAAElFTkSuQmCC") !important;\n\ }\n\ %button%:hover {\n\ list-style-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAECUlEQVRIS9XVe2xTVRgA8O/ce3tv310fa8P6AOoapwznYtXFzchQJNEYNTHEODSaYLK4jsEaGcQnEpAQu8r+WLJMMmOMIQXnNgeKYTJjfBGzMEGTztVubcGmD9q1t+263t7r2Qxka8DhwD88//SP2/P97vd95zsXwX+80ErjC4JAjE4BvWEN5BFCwvXirAjAwWkfgIVjwczK4Sc7QtlbBpwRBLG+ADVcDnbu+fjUHZMX4+mJA00NNw8IAvoZQKIEsLOp4pv7PaMP2jRKanjclzi/99kKDBSuVaobKhEuCYoCyKIZaMjOcW+89clIXe1qA9H80Hp4uqu/UGszvlNl1J/eVF/pjY9CurERcVcyugq4XAdf5gXowP2SL00XAUkzSGteSxuq7LIDw2Miu9UET9y7DhgSwHcpAhN/RuHrC34QeJ57wED17nryqQ6dDtj5jBYAj8dDB4L+WNNzz0uUStWS+PPHI4so5EtzRNuRL9Hday1QX22D6RkOSLxbShGgZAgwKSiYjsTgo2/GQCGTfbXP8egWO0BqAXC73WVFfi7gbN+Fkskkv1jggCAui2Ri1/BZ6pfpGGy+7x7IFnjA2f69rvziSDopBUY5Cd1ffMtXmfX7+rY2vFsKCBiILwbwfiJL0tIpVihz9J4UlWvL4TaTaWnwRZaMJkFOzMFnP5zjmhprG0uB4szMzGTpkcMImQFG7csUV7X2nmA0ZRow6w2Amw/BSARmZ3MgFotBi8srk0iAERHweygkVBoUg6UAl0gkzl7rTPMEIcogxuBPcVbHByckKrkKJIwYwtFw8cUN1bFfLyaU33uDEp1KDQatDkLRCNy+SnGhFCikUqlT1xsaTiCYDKLNE+n8ndt7Tkp5QKhcKkoMtTwyUgREx7LcY5tdg5TNtBoSbBos5ZJLpUAe9+DoP91PHEmKWUTbJpP59Y7uIYVBKY0NNm/8lCAIkqBE22re9lB6rR7FUwl45fH7x0qBWQx0L3cB8oiUpkmm0h9JiIRsNlBrUkcxQI14w7udx34kxIwE9wLxfW3P7CkFsizL7l8W4HnEk6RovvlksTiLgwvJXEG6sXP4YJ4rQoVGxe3d+vC41ax8AfX09IhS7OXXEBDteA4yeDmXAxY9n3/BhUnApvjoOX9vPJODhnXWKbVWsyMlhdOo8/1Dr1tMa7YYjRWpurp6KwZe+hfA1b/iAyAHmvZ4g0Ff0PtbLhzwH25pbulDne5DPa2OnXfhNAeLON1CofDdSgB875Akw2zCKZn8f0xKhz4fGH21veMIch9+b9uO7U4LHrAPVxK4dI9MJrMGAoHqgYHj405nxxnU1eWqaW1tV+ABO38rALVaXRYK+Q39/Z5wW9vuwA19D24G/v8DfwHJNM8naEZRUgAAAABJRU5ErkJggg==") !important;\n\ }\n\ %button%[disabled="true"] {\n\ list-style-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAADCklEQVRIS9WVz0sbQRTHZ3Y32awxYkOIMaQQjBJ026zVVLCeCpX2H2jpqaceSjGnUpBcKj0IpVA81UtLT4VCoYdepJcapBYKGjfNbwNqTGJsbGKi5pdmd/s2tEVCjBrroQMLw8x77/Pem+/MYnTOA59zfHQmwPj4+AWCIG5OTk6+OyrRpgFOp7MTgn6pVCpdLS0t9MTExH49SFMACNaFMZ7v6enRRSKRiiRJnbCWbQgAI8LjWbyBMaFtdC7r67GLwWD4CQRnLBYL4XK5yoIgbKpUqkB7e9u3oSHrlMViz/2J8bcCnl/8TJCUmVJQW0cB0ls/W91u3gqDNBqNVTNoEcrlcmhnZwdtJDdEiqSEUql0zeFwLMj7VYDf728t7xdTV/oHFeBQrAdIJpPkzMwMA5ljnU5XNwfoAgI7tLKyUhJF0T42NuavApaWltolJEQBQGWz2Xw971gsRvM8r+nr68NKpbKhulOplBSNRldBYWwtgNze3o4d5b28vKxdW1vTQRWEQqFoCIEqCtC26VoAARV4GnkCxJRIJExms5mEgeLxuJDP5wmKokSNRkNotVosw/f29hDYLdQCMABcx91ukKYV2mAxGAykDBgZGflUKBQYCHoVMlebTCYMypLh8VoA2t3d/XAcQN4Ph8P2TCbTC1NxeHj4rbwGFYzOuma1jIphoCKUTqdjtQAJAK9PApBtoF3Xi8WimeO4N78Bt+fm5vRqtZqGivIHBwePawEiaPr5SQFVncPNBHmK8hza4giFQx0KSlGB4D/0en13LUAAgPM0gMO2cKhTcA40yNMN79Moy7IZ7PV6OyrC/iuMkZ2zDSgB8KBZADwXz4KhgIAkKQECe2SzDS5ij8c9beg03tK0tpUZhtHANb93BsAU+KvyhXwlHl+f7+cG7uPvPv7FZZazQv9eQi+Fcrm82SyApmk9nIkK/B8GAr6vNlv/U+wL+O6yvawR1PC+2cCH/QBAwlNyJxTyhViW+4gjEa+lu/sSA0ar/wIgCwu+rmAwmIN3K9rUD+c0ifz/gF/LJ4uAUJQHTwAAAABJRU5ErkJggg==") !important;\n\ }\n\ toolbar[iconsize="small"] %button% {\n\ list-style-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAACPElEQVQ4T2NkIBL8//+fEQj+oytnJEY/UDPXzPOPTdINZQ+jG0LQgPvv/wvsvf9k54FzN432X39S9rQ3oR/ZUrgBvb29akxMf7mQJcWVNYTeCWvOfvrijVK9nymDRevqKwqsfxdYiLDNqUgP+whSCzZg4sS+dkYmxlx2NrYfMAM4efiYXonr8Z27/4q52NeGQZiLlYGd4Q/D9iuPGDafu/3/zZevvocrwraCDZgwoWd/QECwtbi4xD8QHxRS178xsPq2LmfKC/FlEBAUYfgDFORlZWCQ52FgUOP5zVCz9sjfiw/eKMENCAwMMeXl5XsMc8FPJhbOjv235A5fe8zoZWvLwMTIxPD45UsGPm5uBiVxQQZN7u8MnVtPXUN2gbGAgOAJpDBg/MrIKtCy/bLRsVtPmXi4uBj+/fn2+9vPvyycHJyMLgZaDAcvXPoFN8A/IMhIUEBoLUoIA+Ps4382qfotZ112nL3JVOyieyjdQYfXuGWtgbCgCOOnzx//IrvAgJ9fYDKWdMH4mYlduX/HOa0AHamD3Jyc5v5TtptzsrMzeBmrXWKcNGkS399/Pw8GBoTIA71QgSNhwaL7/9zjdzN6d10wdDdR/5XrbWbNOHvOjA18fHwmTo6ubECQQChlcnBzR5y9/yT4wcVTb1+/fW7DuGjR3EXR0QlfgMn16N+/fy8TMoCJiUkCiK0PHNqvduXSuTrGNWtWugcHh737+PHjHUKaYfL8/Pyip04dV7tw4dBhgnmBkKEUGwAAgK/XtUYSNDQAAAAASUVORK5CYII=") !important;\n\ }\n\ toolbar[iconsize="small"] %button%:hover {\n\ list-style-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAACRElEQVQ4T2NkIBr8Z2RgYPyPrhwoSBj8//+fbfXt11phqqIXGRhRDSFoAFAzz8KLzzdvP3nZ+titFwWPe+OnIVsJN6BnSo88ww8GTmRJBRUV/jeSuvOOXL6nVeJuxBA3Z+cZWfY/M0x1BZc3+Pp+A6kFGzBxYm8T0GnFrKwsP2AGsHPyMH2RNebdfukxc6KLOYMAFzvDq3fvGC49fMFw+dGL/z9+/nQ7UBm+B2zAhIk9+3x9A2ylJKX/gfigkLr9jZHVt305Y4i9JQMbJy/Dn3//GbhZmRiEuVgYWP9+ZVh19MLfHz9/y0MMmNCz39cvwEJQQOgBzAU/mdg4m3dflTty7TGjkYYm2KmvP3xg4OLgYBDm42H48/09w/UnLy8hG2AuLCRyFCkMGL8ysAo0brtoeOzmEyZ2NjYGFsY/v7///sfCzMTCKCEiyvDo+dNfcAP8/AJNhYSEV6GEMCMj0BA2yaqNZ1x3nr/FlO+kfSTbSY/bqHmtAQ8PH+OPH9/+ohggKCjUhyVVMH5hYlfs3XFeO1BH8hAHB4d50NTt5pzs7AyuhioXGWfO7OD/9p35EDAQFcVExYuxJat///6BLWJiYvo/59jtjN5dF418zDV/ZbpZWDDOnTtzI7+AoLGDvSM3KytbFKF0ycHNHXnx/tPgW+dPvnn99qk948LF8+bFRMV/Aqa4Y9+/f79G0AAODjGgUywOHdivefHipUbGVetWOYUGhr778OEDPAoJGSIgICB87Ngh5bNnL54gmBcIGUaxAQAqY9puYCzN/wAAAABJRU5ErkJggg==") !important;\n\ }\n\ toolbar[iconsize="small"] %button%[disabled="true"] {\n\ list-style-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAB70lEQVQ4T2NkoBAwEqu/vLzcjpOT81pDQ8MbZD1EGVBZWZn579+/qUxMTBXt7e1dGAbcv3+f4/2n9z6M//7zoLvo7NlzXh8+fPQTFxdnfwEEvPy8R+RlpWd4evruBakFu+DCpfNLONg4/NjZ2X4jG3D16jWup0+fsRsZGTGysLAwvH79muH9+/cMQHMY2NjY8jMzMyfBDNivrKhs+f8/wy+YAb9+/WJcs2YNj66uLgMvLy+Kw75//85w6dKl74yMjNZwAxQVlEz//f13D1nlgwcPBG/evCmloqLCBFQMth1oMwMfHx/Dx48f/z99+vQssgHGDP8ZjqCHwd27d+UfP36szs7ODvLGO2BAcgNdwCEhIcH46NGjt8gGGP3/938VtmgFBrIB0N8mcnJyB1VVVbkOHjxgzMnJxfT169cnCAPklQyApk/AlS6ePXumJSQk9ACoxuHKlStmQPonUG0e4+XLl8X//v29V0lJWQoYKaWEEtaXL1/SgX43AQbJWhMT01DGq9ev7ODm4tKWEJdi+/PnTxwhA4CpMfz161e+79+/e/f7919Pxtu3b85RUlJ5+////8PAwLlPyAAODg5BoPONXr16YfDmzbtWxseP79vLyCgAY+j9Q0KaYfJAVwgCA1DpzZs3p4nKC/gMptgAAO1G2FJifkXnAAAAAElFTkSuQmCC") !important;\n\ }\n\ }' .replace(/%windowURL%/g, window.location.href) .replace(/%button%/g, "#" + this.id); var cssURI = this.cssURI = Components.classes["@mozilla.org/network/io-service;1"] .getService(Components.interfaces.nsIIOService) .newURI("data:text/css," + encodeURIComponent(cssStr), null, null); var sss = this.sss = Components.classes["@mozilla.org/content/style-sheet-service;1"] .getService(Components.interfaces.nsIStyleSheetService); if(!sss.sheetRegistered(cssURI, sss.USER_SHEET)) sss.loadAndRegisterSheet(cssURI, sss.USER_SHEET); this.onDestroy = function(reason) { this.undoCloseTabsList.destroy(); if(reason == "destructor") // May happens before "unload" this.undoCloseTabsList.updUIGlobal(); if(reason == "update" || reason == "delete") { let sss = this.sss; let cssURI = this.cssURI; if(sss.sheetRegistered(cssURI, sss.USER_SHEET)) sss.unregisterSheet(cssURI, sss.USER_SHEET); } }; if(this.undoCloseTabsList.options.useMenu) { this.type = "menu"; this.orient = "horizontal"; } |
Alex_one > 30-03-2024 14:06:51 |
VORON пишет
В Инициализацию - верно ведь? |
VORON > 30-03-2024 14:42:03 |
Alex_one скрытый текст Выделить код Код:custombutton://%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%0D%0A%3Ccustombutton%20xmlns%3Acb%3D%22http%3A//xsms.nm.ru/custombuttons/%22%3E%0A%20%20%3Cname%3EUndo%20Close%20Tab%3C/name%3E%0A%20%20%3Cimage%3E%3C%21%5BCDATA%5Bdata%3Aimage/png%3Bbase64%2CiVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAABZVBMVEX////w8PD09PTx8fHw8PCPkIvv7++LjIfw8PDu7u6ZmZXv7+/29vbw8PD///+Txdt8lJ2RkY2Sk4+bzeJcnLsbcp6LjIcwf6bg4N/m//+XyuDf7/+LvNGmr68ufqbg4N9OhaLm8PJvrstCjrPg4N9Rk7Q8hqfk8PRoqMc5h60vgKk9ia/f4N7w8PDi7/ZgpMOLtMny9fYmeaIqfaff4N6hpKLv7+/h8PVwqcTB1N3L3ebv7+9trMqLjIeOj4rf39719vbM7PaMt81hpMPL7fmbnJeoqaXr6+tin774+/vF2t+lq6qKlI+hop38/Pz7+/v5+fn9/f29vruLjIeqq6f7+/v5+fnGxsSLjId5rcfg8vw4ibN8ud3n8vgacZ2extrA5//4+/wacp4yha8ZcZ18wuyIxuthrNc5irdvt+KRzvO62ep+w+7N6PeY1/+U1v+h2/9am7sbcp4keaXm8/ovgq07jLe+yJo8AAAAWXRSTlMAES5KZr+CMJ7X7Lr4ZwHdD4f0yftxJtP6Cj4Q/EIe9HPg/tXy/kvL/fr++fGfuf3Bzv787+6DptCRyLvRDs/u+P3O+TSw5Or8ovXiHqKWW0aBpyVHNSZMDw1FfDAAAACvSURBVHhehchTcwRBAIXRXmewtG3btm0jtn9/elPZmpqnnKd7P0DgADK5glyUQpH4b0pYkJo730t1PADxBSiKhlVvT4v11myBgSHD8Vz+cP388rr7rGlg0CIIojccrx5v7u4fjDCYMAxLWm1f33bHcuWEwXUBuT3eS58/cBuEIcQ8iURj8cT7RwqkM1n6LzabXtgUS6BcqdLO6o1mC7Q7XepZrz8YgtGYQphMZ+BfP976HHRDoNUhAAAAAElFTkSuQmCC%5D%5D%3E%3C/image%3E%0A%20%20%3Cmode%3E0%3C/mode%3E%0A%20%20%3Cinitcode%3E%3C%21%5BCDATA%5B//%20http%3A//infocatcher.ucoz.net/js/cb/undoCloseTabs.js%0A//%20https%3A//forum.mozilla-russia.org/viewtopic.php%3Fid%3D56267%0A//%20https%3A//github.com/Infocatcher/Custom_Buttons/tree/master/Undo_Close_Tabs%0A%0A//%20Undo%20Close%20Tabs%20button%20for%20Custom%20Buttons%0A//%20%28code%20for%20%22initialization%22%20section%29%0A%0A//%20%28c%29%20Infocatcher%202009-2021%0A//%20version%200.3.3.3%20-%202021-09-04%0A%0Avar%20options%20%3D%20%7B%0A%09menuTemplate%3A%20%5B%0A%09%09%22closedWindows%22%2C%0A%09%09%22separator%22%2C%0A%09%09%22restoreClosedWindows%22%2C%0A%09%09%22clearClosedWindows%22%2C%0A%09%09%22separator%22%2C%0A%09%09%22closedTabs%22%2C%0A%09%09%22separator%22%2C%0A%09%09%22restoreClosedTabs%22%2C%0A%09%09%22clearClosedTabs%22%2C%0A%09%09%22separator%22%2C%0A%09%09%22clearAll%22%2C%0A%09%09%22separator%22%2C%0A%09%09%22restoreLastSession%22%2C%0A%09%09%22separator%22%2C%0A%09%09%22buttonMenu%22%0A%09%5D%2C%0A%09showInTabContextMenu%3A%20false%2C%0A%09/*%0A%09menuTemplateTabContext%3A%20%5B%20//%20like%20menuTemplate%0A%09%09%22closedTabs%22%2C%0A%09%09%22separator%22%2C%0A%09%09%22restoreClosedTabs%22%2C%0A%09%09%22clearClosedTabs%22%0A%09%5D%2C%0A%09*/%0A%09windowItemTemplate%3A%20%22%28%25count%29%20%25title%22%2C%0A%09windowSelectedTabPrefix%3A%20%22*%22%2C%0A%09buttonTipTemplate%3A%20%5B%22header%22%2C%20%22title%22%2C%20%22url%22%2C%20%22closedAt%22%5D%2C%0A%09itemTipTemplate%3A%20%5B%22title%22%2C%20%22url%22%2C%20%22closedAt%22%5D%2C%0A%09hideRestoreAllForSingleEntry%3A%20false%2C%0A%09allowDeleteEntries%3A%20true%2C%0A%09accesskeys%3A%20%7B%20//%20Empty%20string%20%28%22%22%29%20to%20disable%20or%20string%20with%20possible%20values%20%28%220123...%22%2C%20%22abcd...%22%29%0A%09%09closedTabs%3A%20%22%22%2C%0A%09%09closedWindows%3A%20%22%22%0A%09%7D%2C%0A%09accesskeySeparator%3A%20%22%20%22%2C%20//%20%3Caccesskey%3E%3Cseparator%3E%3Clabel%3E%0A%09openMenuOnMouseover%3A%20false%2C%0A%09useMenu%3A%20false%2C%0A%09rightClickToUndoCloseTab%3A%20false%20//%20Useful%20with%20%22useMenu%3A%20true%22%0A%7D%3B%0A%0Afunction%20_localize%28sid%29%20%7B%0A%09var%20strings%20%3D%20%7B%0A%09%09en%3A%20%7B%0A%09%09%09restoreTab%3A%20%22Restore%20the%20most%20recently%20closed%20tab%22%2C%0A%0A%09%09%09restoreAllTabs%3A%20%22Restore%20all%20tabs%22%2C%0A%09%09%09restoreAllTabsAccesskey%3A%20%22t%22%2C%0A%09%09%09clearTabsHistory%3A%20%22Clear%20history%20of%20closed%20tabs%22%2C%0A%09%09%09clearTabsHistoryAccesskey%3A%20%22b%22%2C%0A%0A%09%09%09restoreAllWindows%3A%20%22Restore%20all%20windows%22%2C%0A%09%09%09restoreAllWindowsAccesskey%3A%20%22w%22%2C%0A%09%09%09clearWindowsHistory%3A%20%22Clear%20history%20of%20closed%20windows%22%2C%0A%09%09%09clearWindowsHistoryAccesskey%3A%20%22d%22%2C%0A%0A%09%09%09clearAllHistory%3A%20%22Clear%20all%20history%22%2C%0A%09%09%09clearAllHistoryAccesskey%3A%20%22C%22%2C%0A%0A%09%09%09restoreLastSession%3A%20%22Restore%20last%20session%22%2C%0A%09%09%09restoreLastSessionAccesskey%3A%20%22s%22%2C%0A%0A%09%09%09deleteUndoEntry%3A%20%22Delete%22%2C%0A%0A%09%09%09buttonMenu%3A%20%22Button%20menu%22%2C%0A%09%09%09buttonMenuAccesskey%3A%20%22m%22%2C%0A%0A%09%09%09tabContextMenu%3A%20%22Recently%20Closed%20Tabs%22%2C%0A%09%09%09tabContextMenuAccesskey%3A%20%22y%22%2C%0A%0A%09%09%09itemTip%3A%20%22%25ago%20ago%2C%20%25date%22%2C%0A%09%09%09day%3A%20%22d%22%0A%09%09%7D%2C%0A%09%09ru%3A%20%7B%0A%09%09%09restoreTab%3A%20%22%u0412%u043E%u0441%u0441%u0442%u0430%u043D%u043E%u0432%u0438%u0442%u044C%20%u043F%u043E%u0441%u043B%u0435%u0434%u043D%u044E%u044E%20%u0437%u0430%u043A%u0440%u044B%u0442%u0443%u044E%20%u0432%u043A%u043B%u0430%u0434%u043A%u0443%22%2C%0A%0A%09%09%09restoreAllTabs%3A%20%22%u0412%u043E%u0441%u0441%u0442%u0430%u043D%u043E%u0432%u0438%u0442%u044C%20%u0432%u0441%u0435%20%u0432%u043A%u043B%u0430%u0434%u043A%u0438%22%2C%0A%09%09%09restoreAllTabsAccesskey%3A%20%22%u043B%22%2C%0A%09%09%09clearTabsHistory%3A%20%22%u041E%u0447%u0438%u0441%u0442%u0438%u0442%u044C%20%u0438%u0441%u0442%u043E%u0440%u0438%u044E%20%u0437%u0430%u043A%u0440%u044B%u0442%u044B%u0445%20%u0432%u043A%u043B%u0430%u0434%u043E%u043A%22%2C%0A%09%09%09clearTabsHistoryAccesskey%3A%20%22%u0434%22%2C%0A%0A%09%09%09restoreAllWindows%3A%20%22%u0412%u043E%u0441%u0441%u0442%u0430%u043D%u043E%u0432%u0438%u0442%u044C%20%u0432%u0441%u0435%20%u043E%u043A%u043D%u0430%22%2C%0A%09%09%09restoreAllWindowsAccesskey%3A%20%22%u043E%22%2C%0A%09%09%09clearWindowsHistory%3A%20%22%u041E%u0447%u0438%u0441%u0442%u0438%u0442%u044C%20%u0438%u0441%u0442%u043E%u0440%u0438%u044E%20%u0437%u0430%u043A%u0440%u044B%u0442%u044B%u0445%20%u043E%u043A%u043E%u043D%22%2C%0A%09%09%09clearWindowsHistoryAccesskey%3A%20%22%u043D%22%2C%0A%0A%09%09%09clearAllHistory%3A%20%22%u041E%u0447%u0438%u0441%u0442%u0438%u0442%u044C%20%u0432%u0441%u044E%20%u0438%u0441%u0442%u043E%u0440%u0438%u044E%22%2C%0A%09%09%09clearAllHistoryAccesskey%3A%20%22%u0447%22%2C%0A%0A%09%09%09restoreLastSession%3A%20%22%u0412%u043E%u0441%u0441%u0442%u0430%u043D%u043E%u0432%u0438%u0442%u044C%20%u043F%u043E%u0441%u043B%u0435%u0434%u043D%u044E%u044E%20%u0441%u0435%u0441%u0441%u0438%u044E%22%2C%0A%09%09%09restoreLastSessionAccesskey%3A%20%22%u0441%22%2C%0A%0A%09%09%09deleteUndoEntry%3A%20%22%u0423%u0434%u0430%u043B%u0438%u0442%u044C%22%2C%0A%0A%09%09%09buttonMenu%3A%20%22%u041C%u0435%u043D%u044E%20%u043A%u043D%u043E%u043F%u043A%u0438%22%2C%0A%09%09%09buttonMenuAccesskey%3A%20%22%u041C%22%2C%0A%0A%09%09%09tabContextMenu%3A%20%22%u041D%u0435%u0434%u0430%u0432%u043D%u043E%20%u0437%u0430%u043A%u0440%u044B%u0442%u044B%u0435%20%u0432%u043A%u043B%u0430%u0434%u043A%u0438%22%2C%0A%09%09%09tabContextMenuAccesskey%3A%20%22%u043E%22%2C%0A%0A%09%09%09itemTip%3A%20%22%25ago%20%u043D%u0430%u0437%u0430%u0434%2C%20%25date%22%2C%0A%09%09%09day%3A%20%22%u0434%22%0A%09%09%7D%0A%09%7D%3B%0A%09var%20locale%20%3D%20%28function%28%29%20%7B%0A%09%09if%28%22Services%22%20in%20window%20%26%26%20%22locale%22%20in%20Services%29%20%7B%0A%09%09%09var%20locales%20%3D%20Services.locale.requestedLocales%20//%20Firefox%2064+%0A%09%09%09%09%7C%7C%20Services.locale.getRequestedLocales%20%26%26%20Services.locale.getRequestedLocales%28%29%3B%0A%09%09%09if%28locales%29%0A%09%09%09%09return%20locales%5B0%5D%3B%0A%09%09%7D%0A%09%09var%20prefs%20%3D%20%22Services%22%20in%20window%20%26%26%20Services.prefs%0A%09%09%09%7C%7C%20Components.classes%5B%22@mozilla.org/preferences-service%3B1%22%5D%0A%09%09%09%09.getService%28Components.interfaces.nsIPrefBranch%29%3B%0A%09%09function%20pref%28name%2C%20type%29%20%7B%0A%09%09%09return%20prefs.getPrefType%28name%29%20%21%3D%20prefs.PREF_INVALID%20%3F%20prefs%5B%22get%22%20+%20type%20+%20%22Pref%22%5D%28name%29%20%3A%20undefined%3B%0A%09%09%7D%0A%09%09if%28%21pref%28%22intl.locale.matchOS%22%2C%20%22Bool%22%29%29%20%7B%20//%20Also%20see%20https%3A//bugzilla.mozilla.org/show_bug.cgi%3Fid%3D1414390%0A%09%09%09var%20locale%20%3D%20pref%28%22general.useragent.locale%22%2C%20%22Char%22%29%3B%0A%09%09%09if%28locale%20%26%26%20locale.substr%280%2C%209%29%20%21%3D%20%22chrome%3A//%22%29%0A%09%09%09%09return%20locale%3B%0A%09%09%7D%0A%09%09return%20Components.classes%5B%22@mozilla.org/chrome/chrome-registry%3B1%22%5D%0A%09%09%09.getService%28Components.interfaces.nsIXULChromeRegistry%29%0A%09%09%09.getSelectedLocale%28%22global%22%29%3B%0A%09%7D%29%28%29.match%28/%5E%5Ba-z%5D*/%29%5B0%5D%3B%0A%09_localize%20%3D%20function%28sid%29%20%7B%0A%09%09return%20strings%5Blocale%5D%20%26%26%20strings%5Blocale%5D%5Bsid%5D%20%7C%7C%20strings.en%5Bsid%5D%20%7C%7C%20sid%3B%0A%09%7D%3B%0A%09return%20_localize.apply%28this%2C%20arguments%29%3B%0A%7D%0A%0Avar%20JSON%20%3D%20%22JSON%22%20in%20window%0A%09%3F%20%7B%0A%09%09parse%3A%20function%28arg%29%20%7B%0A%09%09%09return%20typeof%20arg%20%3D%3D%20%22string%22%0A%09%09%09%09%3F%20%28JSON%20%3D%20window.JSON%29.parse%28arg%29%0A%09%09%09%09%3A%20%28this.parse%20%3D%20function%28obj%29%20%7B%0A%09%09%09%09%09return%20obj%3B%0A%09%09%09%09%7D%29%20%26%26%20arg%3B%0A%09%09%7D%0A%09%7D%0A%09%3A%20%22nsIJSON%22%20in%20Components.interfaces%0A%09%09%3F%20%7B%0A%09%09%09parse%3A%20function%28s%29%20%7B%0A%09%09%09%09return%20Components.classes%5B%22@mozilla.org/dom/json%3B1%22%5D%0A%09%09%09%09%09.createInstance%28Components.interfaces.nsIJSON%29%0A%09%09%09%09%09.decode%28s%29%3B%0A%09%09%09%7D%0A%09%09%7D%0A%09%09%3A%20%7B%0A%09%09%09parse%3A%20function%28s%29%20%7B%0A%09%09%09%09return%20Components.utils.evalInSandbox%28%22%28%22%20+%20s%20+%20%22%29%22%2C%20new%20Components.utils.Sandbox%28%22about%3Ablank%22%29%29%3B%0A%09%09%09%7D%0A%09%09%7D%3B%0A%0Athis.onclick%20%3D%20function%28e%29%20%7B%0A%09if%28e.target%20%21%3D%20this%29%0A%09%09return%3B%0A%09if%28e.button%20%3D%3D%201%20%7C%7C%20e.button%20%3D%3D%200%20%26%26%20%28e.ctrlKey%20%7C%7C%20e.shiftKey%20%7C%7C%20e.altKey%20%7C%7C%20e.metaKey%29%29%0A%09%09this.undoCloseTabsList.clearAllLists%28%29%3B%0A%09else%20if%28%0A%09%09e.button%20%3D%3D%200%0A%09%09%7C%7C%20e.button%20%3D%3D%202%20%26%26%20%21e.ctrlKey%20%26%26%20%21e.shiftKey%20%26%26%20%21e.altKey%20%26%26%20%21e.metaKey%0A%09%09%09%26%26%20this.undoCloseTabsList.options.rightClickToUndoCloseTab%0A%09%29%20%7B%0A%09%09if%28%0A%09%09%09e.button%20%3D%3D%200%20%26%26%20%21this.undoCloseTabsList.options.useMenu%0A%09%09%09%7C%7C%20e.button%20%3D%3D%202%20%26%26%20this.undoCloseTabsList.options.rightClickToUndoCloseTab%0A%09%09%29%20%7B%0A%09%09%09if%28this.undoCloseTabsList.closedTabCount%29%0A%09%09%09%09this.undoCloseTabsList.undoCloseTab%28%29%3B%0A%09%09%09else%0A%09%09%09%09this.undoCloseTabsList.drawUndoList%28%29%20%26%26%20this.undoCloseTabsList.showMenu%28e%29%3B%0A%09%09%7D%0A%09%09//%20Allow%20use%20%22command%22%20section%20only%20from%20hotkey%3A%0A%09%09e.preventDefault%28%29%3B%0A%09%09e.stopPropagation%28%29%3B%0A%09%7D%0A%7D%3B%0Aif%28%21this.hasOwnProperty%28%22defaultContextId%22%29%29%0A%09this.defaultContextId%20%3D%20this.getAttribute%28%22context%22%29%20%7C%7C%20%22custombuttons-contextpopup%22%3B%0Athis.onmousedown%20%3D%20function%28e%29%20%7B%0A%09if%28e.target%20%21%3D%20this%29%0A%09%09return%3B%0A%09if%28this.undoCloseTabsList.options.useMenu%29%20%7B%0A%09%09if%28e.button%20%3D%3D%200%29%0A%09%09%09this.undoCloseTabsList.drawUndoList%28%29%3B%0A%09%7D%0A%09else%20if%28e.button%20%3D%3D%202%29%20%7B%0A%09%09var%20showCbMenu%20%3D%20e.ctrlKey%20%7C%7C%20e.shiftKey%20%7C%7C%20e.altKey%20%7C%7C%20e.metaKey%20%7C%7C%20%21this.undoCloseTabsList.drawUndoList%28%29%3B%0A%09%09this.setAttribute%28%0A%09%09%09%22context%22%2C%0A%09%09%09showCbMenu%0A%09%09%09%09%3F%20this.defaultContextId%0A%09%09%09%09%3A%20this.undoCloseTabsList.mpId%0A%09%09%29%3B%0A%09%7D%0A%7D%3B%0Athis.onmouseover%20%3D%20function%28e%29%20%7B%0A%09if%28e.target%20%21%3D%20this%29%0A%09%09return%3B%0A%09if%28%21this.disabled%29%0A%09%09this.undoCloseTabsList.updUI%28%29%3B%0A%09this.undoCloseTabsList.options.useMenu%20%26%26%20Array.prototype.some.call%28%0A%09%09this.parentNode.getElementsByTagName%28%22*%22%29%2C%0A%09%09function%28node%29%20%7B%0A%09%09%09if%28%0A%09%09%09%09node%20%21%3D%20this%0A%09%09%09%09%26%26%20node.namespaceURI%20%3D%3D%20xulns%0A%09%09%09%09//%20See%20https%3A//github.com/Infocatcher/Custom_Buttons/issues/28%0A%09%09%09%09//%26%26%20node.boxObject%0A%09%09%09%09//%26%26%20node.boxObject%20instanceof%20Components.interfaces.nsIMenuBoxObject%0A%09%09%09%09%26%26%20%22open%22%20in%20node%0A%09%09%09%09%26%26%20node.open%0A%09%09%09%09%26%26%20node.getElementsByTagName%28%22menupopup%22%29.length%0A%09%09%09%09%26%26%20this.undoCloseTabsList.drawUndoList%28%29%0A%09%09%09%29%20%7B%0A%09%09%09%09node.open%20%3D%20false%3B%0A%09%09%09%09this.open%20%3D%20true%3B%0A%09%09%09%09return%20true%3B%0A%09%09%09%7D%0A%09%09%09return%20false%3B%0A%09%09%7D%2C%0A%09%09this%0A%09%29%3B%0A%09if%28%0A%09%09this.undoCloseTabsList.options.openMenuOnMouseover%0A%09%09%26%26%20this.undoCloseTabsList.drawUndoList%28%29%0A%09%29%0A%09%09this.undoCloseTabsList.openMenu%28%29%3B%0A%7D%3B%0A%0Athis.undoCloseTabsList%20%3D%20%7B%0A%09button%3A%20this%2C%0A%09options%3A%20options%2C%0A%09mpId%3A%20this.id%20+%20%22-context%22%2C%0A%09cmId%3A%20this.id%20+%20%22-contextSub%22%2C%0A%09tcmId%3A%20this.id%20+%20%22-tabContextMenu%22%2C%0A%09tipId%3A%20this.id%20+%20%22-tooltip%22%2C%0A%09errPrefix%3A%20%22%5BCustom%20Buttons%20%3A%3A%20Undo%20Close%20Tabs%20List%5D%3A%20%22%2C%0A%09get%20mp%28%29%20%7B%0A%09%09var%20btn%20%3D%20this.button%3B%0A%09%09var%20mp%20%3D%20btn.getElementsByTagName%28%22menupopup%22%29%3B%0A%09%09mp%20%3D%20mp.length%20%26%26%20mp%5B0%5D%3B%0A%09%09mp%20%26%26%20mp.parentNode.removeChild%28mp%29%3B%0A%09%09mp%20%3D%20this.createElement%28%22menupopup%22%2C%20%7B%0A%09%09%09id%3A%20this.mpId%2C%0A%09%09%09onclick%3A%20%22this.parentNode.undoCloseTabsList.checkForMiddleClick%28event%29%3B%22%2C%0A%09%09%09onpopupshowing%3A%20%22if%28event.target%20%3D%3D%20this%29%20document.popupNode%20%3D%20this.parentNode%3B%22%2C%0A%09%09%09onpopuphidden%3A%20%22if%28event.target%20%3D%3D%20this%29%20document.popupNode%20%3D%20null%3B%22%0A%09%09%7D%29%3B%0A%09%09if%28this.cm%29%0A%09%09%09mp.setAttribute%28%22context%22%2C%20this.cmId%29%3B%0A%09%09var%20tb%20%3D%20btn.parentNode%3B%0A%09%09if%28%0A%09%09%09this.options.useMenu%0A%09%09%09%26%26%20tb.getAttribute%28%22orient%22%29%20%3D%3D%20%22vertical%22%0A%09%09%29%20%7B%0A%09%09%09//%20https%3A//addons.mozilla.org/firefox/addon/vertical-toolbar/%0A%09%09%09var%20isRight%20%3D%20tb.parentNode.getAttribute%28%22placement%22%29%20%3D%3D%20%22right%22%3B%0A%09%09%09mp.setAttribute%28%22position%22%2C%20isRight%20%3F%20%22start_before%22%20%3A%20%22end_before%22%29%3B%0A%09%09%7D%0A%09%09delete%20this.mp%3B%0A%09%09return%20this.mp%20%3D%20btn.appendChild%28mp%29%3B%0A%09%7D%2C%0A%09get%20useCentextMenu%28%29%20%7B%0A%09%09delete%20this.useCentextMenu%3B%0A%09%09return%20this.useCentextMenu%20%3D%20this.options.allowDeleteEntries%0A%09%09%09%26%26%20%28%22forgetClosedTab%22%20in%20this.ss%20%7C%7C%20%22forgetClosedWindow%22%20in%20this.ss%29%3B%0A%09%7D%2C%0A%09get%20cm%28%29%20%7B%0A%09%09delete%20this.cm%3B%0A%09%09if%28%21this.useCentextMenu%29%0A%09%09%09return%20this.cm%20%3D%20null%3B%0A%09%09var%20cm%20%3D%20document.getElementById%28this.cmId%29%3B%0A%09%09cm%20%26%26%20cm.parentNode.removeChild%28cm%29%3B%0A%09%09cm%20%3D%20this.createElement%28%22menupopup%22%2C%20%7B%0A%09%09%09id%3A%20this.cmId%2C%0A%09%09%09onpopupshowing%3A%20%22return%20this.undoCloseTabsList.canDeleteUndoEntry%28this.triggerNode%20%7C%7C%20document.popupNode%29%3B%22%0A%09%09%7D%29%3B%0A%09%09var%20mi%20%3D%20this.createElement%28%22menuitem%22%2C%20%7B%0A%09%09%09oncommand%3A%20%22this.parentNode.undoCloseTabsList.deleteUndoEntry%28this.parentNode.triggerNode%20%7C%7C%20document.popupNode%29%3B%22%2C%0A%09%09%09label%3A%20_localize%28%22deleteUndoEntry%22%29%2C%0A%09%09%09closemenu%3A%20%22single%22%0A%09%09%7D%29%3B%0A%09%09cm.appendChild%28mi%29%3B%0A%09%09cm.undoCloseTabsList%20%3D%20this%3B%0A%09%09return%20this.cm%20%3D%20document.getElementById%28%22mainPopupSet%22%29.appendChild%28cm%29%3B%0A%09%7D%2C%0A%09get%20cbMenu%28%29%20%7B%0A%09%09var%20cbPopup%20%3D%20document.getElementById%28this.button.defaultContextId%29%3B%0A%09%09if%28%21cbPopup%29%20%7B%0A%09%09%09Components.utils.reportError%28this.errPrefix%20+%20%22cb%20menu%20not%20found%22%29%3B%0A%09%09%09return%20this.cbMenu%20%3D%20null%3B%0A%09%09%7D%0A%09%09cbPopup%20%3D%20cbPopup.cloneNode%28true%29%3B%0A%09%09var%20id%20%3D%20%22-%22%20+%20this.button.id.match%28/%5Cd*%24/%29%5B0%5D%20+%20%22-cloned%22%3B%0A%09%09cbPopup.id%20+%3D%20id%3B%0A%09%09Array.prototype.slice.call%28cbPopup.getElementsByAttribute%28%22id%22%2C%20%22*%22%29%29.forEach%28function%28node%29%20%7B%0A%09%09%09node.id%20+%3D%20id%3B%0A%09%09%7D%29%3B%0A%09%09var%20menu%20%3D%20this.createElement%28%22menu%22%2C%20%7B%0A%09%09%09label%3A%20_localize%28%22buttonMenu%22%29%2C%0A%09%09%09accesskey%3A%20_localize%28%22buttonMenuAccesskey%22%29%0A%09%09%7D%29%3B%0A%09%09menu.appendChild%28cbPopup%29%3B%0A%09%09cbPopup.setAttribute%28%0A%09%09%09%22onpopupshowing%22%2C%0A%09%09%09%27%5C%0A%09%09%09var%20btn%20%3D%20document.popupNode%20%3D%20this.parentNode.parentNode.parentNode%5Cn%5C%0A%09%09%09%09.undoCloseTabsList.button%3B%5Cn%5C%0A%09%09%09custombutton.setContextMenuVisibility%28btn%29%3B%27%0A%09%09%29%3B%0A%09%09delete%20this.cbMenu%3B%0A%09%09return%20this.cbMenu%20%3D%20menu%3B%0A%09%7D%2C%0A%09get%20ss%28%29%20%7B%0A%09%09delete%20this.ss%3B%0A%09%09return%20this.ss%20%3D%20%22nsISessionStore%22%20in%20Components.interfaces%0A%09%09%09%3F%20%28%0A%09%09%09%09Components.classes%5B%22@mozilla.org/browser/sessionstore%3B1%22%5D%0A%09%09%09%09%7C%7C%20Components.classes%5B%22@mozilla.org/suite/sessionstore%3B1%22%5D%0A%09%09%09%29.getService%28Components.interfaces.nsISessionStore%29%0A%09%09%09%3A%20SessionStore%3B%20//%20Firefox%2061+%20https%3A//bugzilla.mozilla.org/show_bug.cgi%3Fid%3D1450559%0A%09%7D%2C%0A%09get%20appInfo%28%29%20%7B%0A%09%09delete%20this.appInfo%3B%0A%09%09return%20this.appInfo%20%3D%20Components.classes%5B%22@mozilla.org/xre/app-info%3B1%22%5D%0A%09%09%09.getService%28Components.interfaces.nsIXULAppInfo%29%3B%0A%09%7D%2C%0A%09get%20appVersion%28%29%20%7B%0A%09%09delete%20this.appVersion%3B%0A%09%09return%20this.appVersion%20%3D%20parseFloat%28this.appInfo.version%29%3B%0A%09%7D%2C%0A%09get%20platformVersion%28%29%20%7B%0A%09%09delete%20this.platformVersion%3B%0A%09%09return%20this.platformVersion%20%3D%20parseFloat%28this.appInfo.platformVersion%29%3B%0A%09%7D%2C%0A%09get%20appName%28%29%20%7B%0A%09%09delete%20this.appName%3B%0A%09%09return%20this.appName%20%3D%20this.appInfo.name%3B%0A%09%7D%2C%0A%0A%09init%3A%20function%28%29%20%7B%0A%09%09window.addEventListener%28%22TabClose%22%2C%20%20%20%20%20%20%20this%2C%20false%29%3B%0A%09%09window.addEventListener%28%22SSTabRestoring%22%2C%20this%2C%20false%29%3B%0A%09%09window.addEventListener%28%22unload%22%2C%20%20%20%20%20%20%20%20%20this%2C%20false%29%3B%0A%09%09if%28this.appName%20%3D%3D%20%22SeaMonkey%22%29%20//%20No%20SSTab*%20events%20in%20SeaMonkey%0A%09%09%09window.addEventListener%28%22TabOpen%22%2C%20this%2C%20false%29%3B%0A%09%09setTimeout%28function%28_this%29%20%7B%0A%09%09%09_this.mp.addEventListener%28%22DOMMenuItemActive%22%2C%20%20%20_this%2C%20false%29%3B%0A%09%09%09_this.mp.addEventListener%28%22DOMMenuItemInactive%22%2C%20_this%2C%20false%29%3B%0A%09%09%09_this.initTooltip%28%29%3B%0A%09%09%7D%2C%2050%2C%20this%29%3B%0A%09%09this.addPbExitObserver%28true%29%3B%0A%09%09this.updUIGlobal%28%29%3B%0A%09%09if%28this.options.showInTabContextMenu%29%20setTimeout%28function%28_this%29%20%7B%0A%09%09%09_this.initTabContext%28%29%3B%0A%09%09%7D%2C%20100%2C%20this%29%3B%0A%09%7D%2C%0A%09initTabContext%3A%20function%28%29%20%7B%0A%09%09var%20origMi%20%3D%20this.tabContextUndoClose%3B%0A%09%09if%28%21origMi%29%20%7B%0A%09%09%09LOG%28%22Can%27t%20find%20%5C%22Undo%20Close%20Tab%5C%22%20item%20in%20tab%20context%20menu%22%29%3B%0A%09%09%09return%3B%0A%09%09%7D%0A%09%09var%20menu%20%3D%20document.getElementById%28this.tcmId%29%3B%0A%09%09menu%20%26%26%20menu.parentNode.removeChild%28menu%29%3B%20//%20For%20SeaMonkey%0A%09%09menu%20%3D%20this.createElement%28%22menu%22%2C%20%7B%0A%09%09%09id%3A%20this.tcmId%2C%0A%09%09%09label%3A%20_localize%28%22tabContextMenu%22%29%2C%0A%09%09%09accesskey%3A%20_localize%28%22tabContextMenuAccesskey%22%29%2C%0A%09%09%09tooltip%3A%20this.tipId%2C%0A%09%09%09popupsinherittooltip%3A%20%22true%22%0A%09%09%7D%29%3B%0A%09%09menu.undoCloseTabsList%20%3D%20this%3B%0A%09%09menu.onclick%20%3D%20function%28e%29%20%7B%0A%09%09%09if%28e.target%20%21%3D%20this%29%0A%09%09%09%09return%3B%0A%09%09%09if%28e.button%20%3D%3D%201%20%7C%7C%20e.button%20%3D%3D%200%20%26%26%20%28e.ctrlKey%20%7C%7C%20e.shiftKey%20%7C%7C%20e.altKey%20%7C%7C%20e.metaKey%29%29%20%7B%0A%09%09%09%09if%28this.undoCloseTabsList.closedTabCount%29%20%7B%0A%09%09%09%09%09this.undoCloseTabsList.undoCloseTab%28%29%3B%0A%09%09%09%09%09closeMenus%28this%29%3B%0A%09%09%09%09%7D%0A%09%09%09%7D%0A%09%09%7D%3B%0A%09%09var%20origMp%20%3D%20this.mp%3B%0A%09%09var%20mp%20%3D%20origMp.cloneNode%28true%29%3B%0A%09%09mp.id%20%3D%20this.button.id%20+%20%22-tabContext%22%3B%0A%09%09var%20_this%20%3D%20this%3B%0A%09%09function%20drawUndoList%28%29%20%7B%0A%09%09%09var%20ok%20%3D%20false%3B%0A%09%09%09var%20opts%20%3D%20_this.options%3B%0A%09%09%09var%20origTemplate%20%3D%20opts.menuTemplate%3B%0A%09%09%09opts.menuTemplate%20%3D%20opts.menuTemplateTabContext%20%7C%7C%20origTemplate%3B%0A%09%09%09_this.mp%20%3D%20mp%3B%0A%09%09%09try%20%7B%0A%09%09%09%09ok%20%3D%20_this.drawUndoList%28%29%3B%0A%09%09%09%7D%0A%09%09%09catch%28e%29%20%7B%0A%09%09%09%09Components.utils.reportError%28e%29%3B%0A%09%09%09%7D%0A%09%09%09opts.menuTemplate%20%3D%20origTemplate%3B%0A%09%09%09_this.mp%20%3D%20origMp%3B%0A%09%09%09return%20ok%3B%0A%09%09%7D%0A%09%09function%20updMenu%28%29%20%7B%0A%09%09%09if%28drawUndoList%28%29%29%0A%09%09%09%09menu.removeAttribute%28%22disabled%22%29%3B%0A%09%09%09else%0A%09%09%09%09menu.setAttribute%28%22disabled%22%2C%20%22true%22%29%3B%0A%09%09%7D%0A%09%09mp._updatePopup%20%3D%20function%28e%29%20%7B%0A%09%09%09if%28e.target%20%21%3D%20this%29%0A%09%09%09%09return%3B%0A%09%09%09document.popupNode%20%3D%20_this.button%3B%0A%09%09%09drawUndoList%28%29%3B%0A%09%09%7D%3B%0A%09%09mp.setAttribute%28%22onpopupshowing%22%2C%20%22this._updatePopup%28event%29%3B%22%29%3B%0A%09%09mp.onclick%20%3D%20function%28e%29%20%7B%0A%09%09%09_this.checkForMiddleClick%28e%2C%20updMenu%29%3B%0A%09%09%7D%3B%0A%09%09menu.appendChild%28mp%29%3B%0A%09%09addEventListener%28%22popupshown%22%2C%20function%28e%29%20%7B%0A%09%09%09if%28e.target%20%3D%3D%20e.currentTarget%29%0A%09%09%09%09setTimeout%28updMenu%2C%200%29%3B%20//%20Pseudo%20async%0A%09%09%7D%2C%20false%2C%20origMi.parentNode%29%3B%0A%09%09addEventListener%28%22DOMMenuItemActive%22%2C%20%20%20this%2C%20false%2C%20mp%29%3B%0A%09%09addEventListener%28%22DOMMenuItemInactive%22%2C%20this%2C%20false%2C%20mp%29%3B%0A%09%09origMi.parentNode.insertBefore%28menu%2C%20origMi.nextSibling%29%3B%0A%09%09origMi.setAttribute%28%22hidden%22%2C%20%22true%22%29%3B%0A%09%7D%2C%0A%09initTooltip%3A%20function%28%29%20%7B%0A%09%09var%20tip%20%3D%20document.getElementById%28this.tipId%29%3B%0A%09%09tip%20%26%26%20tip.parentNode.removeChild%28tip%29%3B%0A%09%09tip%20%3D%20this.tip%20%3D%20this.createElement%28%22tooltip%22%2C%20%7B%0A%09%09%09id%3A%20this.tipId%2C%0A%09%09%09orient%3A%20%22vertical%22%2C%0A%09%09%09onpopupshowing%3A%20%22return%20this.undoCloseTabsList.updTooltip%28this%2C%20this.triggerNode%20%7C%7C%20document.tooltipNode%29%3B%22%2C%0A%09%09%09onpopuphiding%3A%20%22this.cancelUpdateTimer%28%29%3B%22%0A%09%09%7D%29%3B%0A%09%09tip.undoCloseTabsList%20%3D%20this%3B%0A%09%09tip._updateTimer%20%3D%200%3B%0A%09%09tip.initUpdateTimer%20%3D%20function%28fn%2C%20context%29%20%7B%0A%09%09%09if%28this._updateTimer%29%0A%09%09%09%09clearInterval%28this._updateTimer%29%3B%0A%09%09%09this._updateTimer%20%3D%20setInterval%28function%28%29%20%7B%0A%09%09%09%09fn.call%28context%29%3B%0A%09%09%09%7D%2C%201000%29%3B%0A%09%09%7D%3B%0A%09%09tip.cancelUpdateTimer%20%3D%20function%28%29%20%7B%0A%09%09%09if%28this._updateTimer%29%20%7B%0A%09%09%09%09clearInterval%28this._updateTimer%29%3B%0A%09%09%09%09this._updateTimer%20%3D%200%3B%0A%09%09%09%7D%0A%09%09%7D%3B%0A%09%09var%20btn%20%3D%20this.button%3B%0A%09%09btn.removeAttribute%28%22tooltiptext%22%29%3B%0A%09%09btn.setAttribute%28%22tooltip%22%2C%20this.tipId%29%3B%0A%09%09btn.setAttribute%28%22popupsinherittooltip%22%2C%20%22true%22%29%3B%0A%09%09document.getElementById%28%22mainPopupSet%22%29.appendChild%28tip%29%3B%0A%09%09if%28this.appVersion%20%3E%3D%2061%20%26%26%20%22getAnonymousElementByAttribute%22%20in%20document%29%20%7B%0A%09%09%09var%20label%20%3D%20document.getAnonymousElementByAttribute%28tip%2C%20%22class%22%2C%20%22tooltip-label%22%29%3B%0A%09%09%09label%20%26%26%20label.remove%28%29%3B%0A%09%09%7D%0A%09%7D%2C%0A%09_hasPbExitObserver%3A%20false%2C%0A%09addPbExitObserver%3A%20function%28add%29%20%7B%0A%09%09if%28add%20%3D%3D%20this._hasPbExitObserver%20%7C%7C%20%21%28%22Services%22%20in%20window%29%29%0A%09%09%09return%3B%0A%09%09this._hasPbExitObserver%20%3D%20add%3B%0A%09%09if%28add%29%0A%09%09%09Services.obs.addObserver%28this%2C%20%22last-pb-context-exited%22%2C%20false%29%3B%0A%09%09else%0A%09%09%09Services.obs.removeObserver%28this%2C%20%22last-pb-context-exited%22%29%3B%0A%09%7D%2C%0A%09destroy%3A%20function%28%29%20%7B%0A%09%09window.removeEventListener%28%22TabClose%22%2C%20%20%20%20%20%20%20this%2C%20false%29%3B%0A%09%09window.removeEventListener%28%22SSTabRestoring%22%2C%20this%2C%20false%29%3B%0A%09%09window.removeEventListener%28%22unload%22%2C%20%20%20%20%20%20%20%20%20this%2C%20false%29%3B%0A%09%09if%28this.appName%20%3D%3D%20%22SeaMonkey%22%29%0A%09%09%09window.removeEventListener%28%22TabOpen%22%2C%20this%2C%20false%29%3B%0A%09%09this.mp.removeEventListener%28%22DOMMenuItemActive%22%2C%20%20%20this%2C%20false%29%3B%0A%09%09this.mp.removeEventListener%28%22DOMMenuItemInactive%22%2C%20this%2C%20false%29%3B%0A%09%09this.addPbExitObserver%28false%29%3B%0A%09%09var%20menu%20%3D%20document.getElementById%28this.tcmId%29%3B%0A%09%09if%28menu%29%20%7B%0A%09%09%09menu.parentNode.removeChild%28menu%29%3B%0A%09%09%09this.tabContextUndoClose.removeAttribute%28%22hidden%22%29%3B%0A%09%09%7D%0A%09%09var%20tip%20%3D%20this.tip%3B%0A%09%09tip%20%26%26%20tip.parentNode%20%26%26%20tip.parentNode.removeChild%28tip%29%3B%0A%09%7D%2C%0A%09handleEvent%3A%20function%28e%29%20%7B%0A%09%09switch%28e.type%29%20%7B%0A%09%09%09case%20%22TabClose%22%3A%0A%09%09%09case%20%22SSTabRestoring%22%3A%0A%09%09%09case%20%22TabOpen%22%3A%0A%09%09%09%09setTimeout%28function%28_this%29%20%7B%0A%09%09%09%09%09_this.updUI%28%29%3B%0A%09%09%09%09%7D%2C%200%2C%20this%29%3B%0A%09%09%09break%3B%0A%09%09%09case%20%22DOMMenuItemActive%22%3A%0A%09%09%09case%20%22DOMMenuItemInactive%22%3A%0A%09%09%09%09if%28%21%28%22XULBrowserWindow%22%20in%20window%29%29%0A%09%09%09%09%09break%3B%0A%09%09%09%09XULBrowserWindow.setOverLink%28%0A%09%09%09%09%09e.type%20%3D%3D%20%22DOMMenuItemActive%22%0A%09%09%09%09%09%09%3F%20%28e.target.getAttribute%28%22cb_urlDecoded%22%29%20%7C%7C%20%22%22%29%0A%09%09%09%09%09%09%09.replace%28/%20%5Cn/g%2C%20%22%2C%20%22%29%0A%09%09%09%09%09%09%3A%20%22%22%2C%0A%09%09%09%09%09null%0A%09%09%09%09%29%3B%0A%09%09%09break%3B%0A%09%09%09case%20%22unload%22%3A%0A%09%09%09%09this.updUIGlobal%28%29%3B%0A%09%09%09%09this.destroy%28%29%3B%0A%09%09%7D%0A%09%7D%2C%0A%09observe%3A%20function%28subject%2C%20topic%2C%20data%29%20%7B%0A%09%09if%28topic%20%3D%3D%20%22last-pb-context-exited%22%29%20%7B%0A%09%09%09setTimeout%28function%28_this%29%20%7B%0A%09%09%09%09_this.updUI%28%29%3B%0A%09%09%09%7D%2C%2025%2C%20this%29%3B%0A%09%09%7D%0A%09%7D%2C%0A%0A%09createElement%3A%20function%28name%2C%20attrs%29%20%7B%0A%09%09var%20node%20%3D%20document.createElementNS%28xulns%2C%20name%29%3B%0A%09%09if%28attrs%29%20for%28var%20attrName%20in%20attrs%29%20if%28attrs.hasOwnProperty%28attrName%29%29%0A%09%09%09node.setAttribute%28attrName%2C%20attrs%5BattrName%5D%29%3B%0A%09%09return%20node%3B%0A%09%7D%2C%0A%09get%20tabContextUndoClose%28%29%20%7B%0A%09%09return%20document.getElementById%28%22context_undoCloseTab%22%29%0A%09%09%09%7C%7C%20document.getElementById%28%22tabContextUndoCloseTab%22%29%20//%20Firefox%202.0%0A%09%09%09%7C%7C%20document.getAnonymousElementByAttribute%28gBrowser%2C%20%22tbattr%22%2C%20%22tabbrowser-undoclosetab%22%29%3B%20//%20SeaMonkey%0A%09%7D%2C%0A%09get%20closedWindowCount%28%29%20%7B%0A%09%09if%28%21%28%22getClosedWindowCount%22%20in%20this.ss%29%29%20%7B%0A%09%09%09delete%20this.closedWindowCount%3B%0A%09%09%09return%20this.closedWindowCount%20%3D%200%3B%0A%09%09%7D%0A%09%09this.__defineGetter__%28%22closedWindowCount%22%2C%20function%28%29%20%7B%0A%09%09%09return%20this.ss.getClosedWindowCount%28%29%3B%0A%09%09%7D%29%3B%0A%09%09return%20this.closedWindowCount%3B%0A%09%7D%2C%0A%09get%20closedTabCount%28%29%20%7B%0A%09%09return%20this.ss.getClosedTabCount%28window%29%3B%0A%09%7D%2C%0A%09undoCloseTab%3A%20function%28i%29%20%7B%0A%09%09if%28%22undoCloseTab%22%20in%20window%29%20//%20Firefox%202.0+%0A%09%09%09undoCloseTab%28i%29%3B%0A%09%09else%20//%20SeaMonkey%0A%09%09%09gBrowser.undoCloseTab%28i%29%3B%0A%09%7D%2C%0A%09clearUndoTabsList%3A%20function%28%29%20%7B%0A%09%09var%20closedTabCount%20%3D%20this.closedTabCount%3B%0A%09%09if%28%21closedTabCount%29%0A%09%09%09return%3B%0A%09%09if%28%22forgetClosedTab%22%20in%20this.ss%29%20//%20Gecko%201.9.2+%0A%09%09%09while%28closedTabCount--%29%0A%09%09%09%09this.ss.forgetClosedTab%28window%2C%200%29%3B%0A%09%09else%20%7B%0A%09%09%09//%20Doesn%27t%20work%20in%20SeaMonkey%0A%09%09%09const%20pName%20%3D%20%22browser.sessionstore.max_tabs_undo%22%3B%0A%09%09%09let%20val%20%3D%20cbu.getPrefs%28pName%29%3B%0A%09%09%09cbu.setPrefs%28pName%2C%200%29%3B%0A%09%09%09cbu.setPrefs%28pName%2C%20val%29%3B%0A%09%09%7D%0A%09%09this.updUIGlobal%28%29%3B%0A%09%7D%2C%0A%09clearUndoWindowsList%3A%20function%28%29%20%7B%0A%09%09var%20closedWindowCount%20%3D%20this.closedWindowCount%3B%0A%09%09if%28%21closedWindowCount%29%0A%09%09%09return%3B%0A%09%09if%28%22forgetClosedWindow%22%20in%20this.ss%29%20//%20Gecko%201.9.2+%0A%09%09%09while%28closedWindowCount--%29%0A%09%09%09%09this.ss.forgetClosedWindow%280%29%3B%0A%09%09else%0A%09%09%09this.ss.setWindowState%28window%2C%20%27%7B%22windows%22%3A%5B%7B%7D%5D%2C%22_closedWindows%22%3A%5B%5D%7D%27%2C%20false%29%3B%0A%09%09this.updUIGlobal%28%29%3B%0A%09%7D%2C%0A%09clearAllLists%3A%20function%28%29%20%7B%0A%09%09this.clearUndoTabsList%28%29%3B%0A%09%09this.clearUndoWindowsList%28%29%3B%0A%09%7D%2C%0A%09canDeleteUndoEntry%3A%20function%28mi%29%20%7B%0A%09%09switch%28mi.getAttribute%28%22cb_type%22%29%29%20%7B%0A%09%09%09case%20%22tab%22%3A%20%20%20%20return%20%22forgetClosedTab%22%20%20%20%20in%20this.ss%3B%0A%09%09%09case%20%22window%22%3A%20return%20%22forgetClosedWindow%22%20in%20this.ss%3B%0A%09%09%7D%0A%09%09return%20false%3B%0A%09%7D%2C%0A%09deleteUndoEntry%3A%20function%28mi%29%20%7B%0A%09%09var%20i%20%3D%20+mi.getAttribute%28%22cb_index%22%29%3B%0A%09%09if%28mi.getAttribute%28%22cb_type%22%29%20%3D%3D%20%22window%22%29%20%7B%0A%09%09%09this.ss.forgetClosedWindow%28i%29%3B%0A%09%09%09this.updUIGlobal%28%29%3B%0A%09%09%7D%0A%09%09else%20%7B%0A%09%09%09this.ss.forgetClosedTab%28window%2C%20i%29%3B%0A%09%09%09this.updUI%28%29%3B%0A%09%09%7D%0A%09%09this.drawUndoList%28%29%3B%0A%09%7D%2C%0A%09showMenu%3A%20function%28e%2C%20isContext%2C%20mp%29%20%7B%0A%09%09var%20btn%20%3D%20this.button%3B%0A%09%09document.popupNode%20%3D%20btn.ownerDocument.popupNode%20%3D%20btn%3B%0A%09%09if%28%21mp%29%0A%09%09%09mp%20%3D%20this.mp%3B%0A%09%09if%28%22openPopupAtScreen%22%20in%20mp%29%0A%09%09%09mp.openPopupAtScreen%28e.screenX%2C%20e.screenY%2C%20isContext%29%3B%0A%09%09else%0A%09%09%09mp.showPopup%28btn%2C%20e.screenX%2C%20e.screenY%2C%20isContext%20%3F%20%22context%22%20%3A%20%22popup%22%2C%20null%2C%20null%29%3B%0A%09%7D%2C%0A%09openMenu%3A%20function%28%29%20%7B%0A%09%09var%20mp%20%3D%20this.mp%3B%0A%09%09if%28%22openPopup%22%20in%20mp%29%0A%09%09%09mp.openPopup%28this.button%2C%20%22after_start%22%29%3B%0A%09%09else%0A%09%09%09mp.showPopup%28this.button%2C%20-1%2C%20-1%2C%20%22popup%22%2C%20%22bottomleft%22%2C%20%22topleft%22%29%3B%0A%09%7D%2C%0A%09drawUndoList%3A%20function%28%29%20%7B%0A%09%09var%20mp%20%3D%20this.mp%3B%0A%0A%09%09var%20wc%20%3D%20this.closedWindowCount%3B%0A%09%09var%20tc%20%3D%20this.closedTabCount%3B%0A%09%09var%20ss%20%3D%20this.ss%3B%0A%09%09var%20canRestoreLastSession%20%3D%20%22restoreLastSession%22%20in%20ss%20%26%26%20ss.canRestoreLastSession%0A%09%09if%28%21wc%20%26%26%20%21tc%20%26%26%20%21canRestoreLastSession%29%20%7B%0A%09%09%09mp.textContent%20%3D%20%22%22%3B%0A%09%09%09mp.hidePopup%28%29%3B%0A%09%09%09return%20false%3B%0A%09%09%7D%0A%0A%09%09this._undoWindowItems%20%3D%20wc%20%26%26%20JSON.parse%28ss.getClosedWindowData%28%29%29%3B%0A%09%09this._undoTabItems%20%20%20%20%3D%20tc%20%26%26%20JSON.parse%28ss.getClosedTabData%28window%29%29%3B%0A%09%09var%20df%20%3D%20document.createDocumentFragment%28%29%3B%0A%0A%09%09this.options.menuTemplate.forEach%28function%28sid%2C%20indx%2C%20arr%29%20%7B%0A%09%09%09switch%28sid%29%20%7B%0A%09%09%09%09case%20%22closedWindows%22%3A%0A%09%09%09%09%09wc%20%26%26%20this.addUndoWindowsList%28df%29%3B%0A%09%09%09%09break%3B%0A%09%09%09%09case%20%22restoreClosedWindows%22%3A%0A%09%09%09%09%09wc%20%3E%20this.options.hideRestoreAllForSingleEntry%0A%09%09%09%09%09%26%26%20df.appendChild%28this.createElement%28%22menuitem%22%2C%20%7B%0A%09%09%09%09%09%09label%3A%20_localize%28%22restoreAllWindows%22%29%2C%0A%09%09%09%09%09%09accesskey%3A%20_localize%28%22restoreAllWindowsAccesskey%22%29%2C%0A%09%09%09%09%09%09oncommand%3A%20%22for%28var%20i%20%3D%200%3B%20i%20%3C%20%22%20+%20this._undoWindowItems.length%20+%20%22%3B%20++i%29%20undoCloseWindow%28%29%3B%22%0A%09%09%09%09%09%7D%29%29%3B%0A%09%09%09%09break%3B%0A%09%09%09%09case%20%22clearClosedWindows%22%3A%0A%09%09%09%09%09wc%20%26%26%20df.appendChild%28this.createElement%28%22menuitem%22%2C%20%7B%0A%09%09%09%09%09%09label%3A%20_localize%28%22clearWindowsHistory%22%29%2C%0A%09%09%09%09%09%09accesskey%3A%20_localize%28%22clearWindowsHistoryAccesskey%22%29%2C%0A%09%09%09%09%09%09oncommand%3A%20%22this.parentNode.parentNode.undoCloseTabsList.clearUndoWindowsList%28%29%3B%22%0A%09%09%09%09%09%7D%29%29%3B%0A%09%09%09%09break%3B%0A%09%09%09%09case%20%22closedTabs%22%3A%0A%09%09%09%09%09tc%20%26%26%20this.addUndoTabsList%28df%29%3B%0A%09%09%09%09break%3B%0A%09%09%09%09case%20%22restoreClosedTabs%22%3A%0A%09%09%09%09%09tc%20%3E%20this.options.hideRestoreAllForSingleEntry%0A%09%09%09%09%09%26%26%20df.appendChild%28this.createElement%28%22menuitem%22%2C%20%7B%0A%09%09%09%09%09%09label%3A%20_localize%28%22restoreAllTabs%22%29%2C%0A%09%09%09%09%09%09accesskey%3A%20_localize%28%22restoreAllTabsAccesskey%22%29%2C%0A%09%09%09%09%09%09oncommand%3A%20%22for%28var%20i%20%3D%200%3B%20i%20%3C%20%22%20+%20this._undoTabItems.length%20+%20%22%3B%20++i%29%20this.parentNode.parentNode.undoCloseTabsList.undoCloseTab%28%29%3B%22%0A%09%09%09%09%09%7D%29%29%3B%0A%09%09%09%09break%3B%0A%09%09%09%09case%20%22clearClosedTabs%22%3A%0A%09%09%09%09%09tc%20%26%26%20df.appendChild%28this.createElement%28%22menuitem%22%2C%20%7B%0A%09%09%09%09%09%09label%3A%20_localize%28%22clearTabsHistory%22%29%2C%0A%09%09%09%09%09%09accesskey%3A%20_localize%28%22clearTabsHistoryAccesskey%22%29%2C%0A%09%09%09%09%09%09oncommand%3A%20%22this.parentNode.parentNode.undoCloseTabsList.clearUndoTabsList%28%29%3B%22%0A%09%09%09%09%09%7D%29%29%3B%0A%09%09%09%09break%3B%0A%09%09%09%09case%20%22clearAll%22%3A%0A%09%09%09%09%09%28%0A%09%09%09%09%09%09wc%20%26%26%20tc%0A%09%09%09%09%09%09%7C%7C%20wc%20%26%26%20arr.indexOf%28%22clearClosedWindows%22%29%20%3D%3D%20-1%0A%09%09%09%09%09%09%7C%7C%20tc%20%26%26%20arr.indexOf%28%22clearClosedTabs%22%29%20%3D%3D%20-1%0A%09%09%09%09%09%29%0A%09%09%09%09%09%26%26%20df.appendChild%28this.createElement%28%22menuitem%22%2C%20%7B%0A%09%09%09%09%09%09label%3A%20_localize%28%22clearAllHistory%22%29%2C%0A%09%09%09%09%09%09accesskey%3A%20_localize%28%22clearAllHistoryAccesskey%22%29%2C%0A%09%09%09%09%09%09oncommand%3A%20%22this.parentNode.parentNode.undoCloseTabsList.clearAllLists%28%29%3B%22%0A%09%09%09%09%09%7D%29%29%3B%0A%09%09%09%09break%3B%0A%09%09%09%09case%20%22restoreLastSession%22%3A%20//%20Gecko%202.0+%0A%09%09%09%09%09canRestoreLastSession%20%26%26%20df.appendChild%28this.createElement%28%22menuitem%22%2C%20%7B%0A%09%09%09%09%09%09label%3A%20_localize%28%22restoreLastSession%22%29%2C%0A%09%09%09%09%09%09accesskey%3A%20_localize%28%22restoreLastSessionAccesskey%22%29%2C%0A%09%09%09%09%09%09oncommand%3A%20%22this.parentNode.parentNode.undoCloseTabsList.ss.restoreLastSession%28%29%3B%22%0A%09%09%09%09%09%7D%29%29%3B%0A%09%09%09%09break%3B%0A%09%09%09%09case%20%22buttonMenu%22%3A%0A%09%09%09%09%09let%20cbMenu%20%3D%20this.cbMenu%3B%0A%09%09%09%09%09if%28cbMenu%29%0A%09%09%09%09%09%09df.appendChild%28cbMenu%29%3B%0A%09%09%09%09break%3B%0A%09%09%09%09case%20%22separator%22%3A%0A%09%09%09%09%09if%28df.hasChildNodes%28%29%20%26%26%20df.lastChild.localName%20%21%3D%20%22menuseparator%22%29%0A%09%09%09%09%09%09df.appendChild%28document.createElementNS%28xulns%2C%20%22menuseparator%22%29%29%3B%0A%09%09%09%09break%3B%0A%09%09%09%09default%3A%0A%09%09%09%09%09Components.utils.reportError%28this.errPrefix%20+%20%27Invalid%20template%20entry%3A%20%22%27%20+%20sid%20+%20%27%22%27%29%3B%0A%09%09%09%7D%0A%09%09%7D%2C%20this%29%3B%0A%0A%09%09while%28df.hasChildNodes%28%29%20%26%26%20df.lastChild.localName%20%3D%3D%20%22menuseparator%22%29%0A%09%09%09df.removeChild%28df.lastChild%29%3B%0A%0A%09%09this._undoWindowItems%20%3D%20this._undoTabItems%20%3D%20null%3B%0A%0A%09%09mp.textContent%20%3D%20%22%22%3B%0A%09%09if%28%21df.hasChildNodes%28%29%29%20%7B%0A%09%09%09mp.hidePopup%28%29%3B%0A%09%09%09return%20false%3B%0A%09%09%7D%0A%09%09mp.appendChild%28df%29%3B%0A%09%09return%20true%3B%0A%09%7D%2C%0A%09addUndoWindowsList%3A%20function%28undoPopup%29%20%7B%0A%09%09//%20Based%20on%20code%20from%20chrome%3A//browser/content/browser.js%0A%09%09//%20Mozilla/5.0%20%28Windows%3B%20U%3B%20Windows%20NT%205.1%3B%20en-US%3B%20rv%3A1.9.3a1pre%29%20Gecko/20090824%20Minefield/3.7a1pre%0A%0A%09%09var%20keys%20%3D%20this.options.accesskeys.closedWindows%3B%0A%09%09this._undoWindowItems.forEach%28function%28undoItem%2C%20i%29%20%7B%0A%09%09%09var%20tabs%20%3D%20undoItem.tabs%3B%0A%09%09%09var%20%5Bkey%2C%20keyPrefix%5D%20%3D%20this.getKey%28keys%2C%20i%29%3B%0A%09%09%09var%20title%20%3D%20undoItem.title%3B%0A%09%09%09var%20selected%20%3D%20undoItem.selected%3B%0A%09%09%09var%20selectedTab%20%3D%20tabs%5Bselected%20%26%26%20selected%20-%201%5D%3B%0A%09%09%09var%20urls%20%3D%20%5B%5D%3B%0A%09%09%09tabs.forEach%28function%28tab%29%20%7B%0A%09%09%09%09if%28%21tab.entries%20%7C%7C%20%21tab.entries.length%29%20//%20Can%20be%20%5B%5D%20for%20about%3Ablank%0A%09%09%09%09%09return%3B%0A%09%09%09%09var%20url%20%3D%20this.convertURI%28tab.entries%5Btab.index%20-%201%5D.url%2C%20120%29%3B%0A%09%09%09%09var%20selectedPrefix%20%3D%20tab%20%3D%3D%20selectedTab%20%26%26%20tabs.length%20%3E%201%0A%09%09%09%09%09%3F%20this.options.windowSelectedTabPrefix%0A%09%09%09%09%09%3A%20%22%22%3B%0A%09%09%09%09urls.push%28selectedPrefix%20+%20url%29%3B%0A%09%09%09%7D%2C%20this%29%3B%0A%09%09%09var%20url%20%3D%20urls.join%28%22%20%5Cn%22%29%3B%0A%09%09%09var%20mi%20%3D%20this.createElement%28%22menuitem%22%2C%20%7B%0A%09%09%09%09label%3A%20keyPrefix%20+%20this.options.windowItemTemplate%0A%09%09%09%09%09.replace%28%22%25title%22%2C%20title%29%0A%09%09%09%09%09.replace%28%22%25count%22%2C%20tabs.length%29%2C%0A%09%09%09%09accesskey%3A%20key%2C%0A%09%09%09%09%22class%22%3A%20%22menuitem-iconic%20bookmark-item%20menuitem-with-favicon%22%2C%0A%09%09%09%09oncommand%3A%20%22undoCloseWindow%28%22%20+%20i%20+%20%22%29%3B%22%2C%0A%09%09%09%09cb_url%3A%20url%2C%0A%09%09%09%09cb_urlDecoded%3A%20this.convertURI%28url%29%2C%0A%09%09%09%09cb_closedAt%3A%20undoItem.closedAt%20%7C%7C%200%2C%0A%09%09%09%09cb_index%3A%20i%2C%0A%09%09%09%09cb_type%3A%20%22window%22%0A%09%09%09%7D%29%3B%0A%09%09%09if%28this.cm%29%0A%09%09%09%09mi.setAttribute%28%22context%22%2C%20this.cmId%29%3B%0A%09%09%09var%20icon%20%3D%20selectedTab.image%20%7C%7C%20selectedTab.attributes%20%26%26%20selectedTab.attributes.image%3B%0A%09%09%09if%28icon%29%0A%09%09%09%09mi.setAttribute%28%22image%22%2C%20this.cachedIcon%28icon%29%29%3B%0A%09%09%09if%28i%20%3D%3D%200%29%0A%09%09%09%09mi.setAttribute%28%22key%22%2C%20%22key_undoCloseWindow%22%29%3B%0A%09%09%09undoPopup.appendChild%28mi%29%3B%0A%09%09%7D%2C%20this%29%3B%0A%09%7D%2C%0A%09addUndoTabsList%3A%20function%28undoPopup%29%20%7B%0A%09%09//%20Based%20on%20code%20from%20chrome%3A//browser/content/browser.js%0A%09%09//%20Mozilla/5.0%20%28Windows%3B%20U%3B%20Windows%20NT%205.1%3B%20en-US%3B%20rv%3A1.9.3a1pre%29%20Gecko/20090824%20Minefield/3.7a1pre%0A%0A%09%09var%20keys%20%3D%20this.options.accesskeys.closedTabs%3B%0A%09%09this._undoTabItems.forEach%28function%28undoItem%2C%20i%29%20%7B%0A%09%09%09var%20state%20%3D%20undoItem.state%3B%0A%09%09%09var%20%5Bkey%2C%20keyPrefix%5D%20%3D%20this.getKey%28keys%2C%20i%29%3B%0A%09%09%09var%20title%20%3D%20undoItem.title%3B%0A%09%09%09var%20url%20%3D%20state%20%26%26%20state.entries%20%26%26%20state.entries%5Bstate.index%20-%201%5D.url%20%7C%7C%20%22%22%3B%0A%09%09%09var%20mi%20%3D%20this.createElement%28%22menuitem%22%2C%20%7B%0A%09%09%09%09label%3A%20keyPrefix%20+%20title%2C%0A%09%09%09%09accesskey%3A%20key%2C%0A%09%09%09%09class%3A%20%22menuitem-iconic%20bookmark-item%20menuitem-with-favicon%22%2C%0A%09%09%09%09oncommand%3A%20%22this.parentNode.parentNode.undoCloseTabsList.undoCloseTab%28%22%20+%20i%20+%20%22%29%3B%22%2C%0A%09%09%09%09cb_url%3A%20url%2C%0A%09%09%09%09cb_urlDecoded%3A%20this.convertURI%28url%29%2C%0A%09%09%09%09cb_closedAt%3A%20undoItem.closedAt%20%7C%7C%200%2C%0A%09%09%09%09cb_index%3A%20i%2C%0A%09%09%09%09cb_type%3A%20%22tab%22%0A%09%09%09%7D%29%3B%0A%09%09%09if%28%0A%09%09%09%09state%0A%09%09%09%09%26%26%20%22attributes%22%20in%20state%0A%09%09%09%09%26%26%20%22privateTab-isPrivate%22%20in%20state.attributes%0A%09%09%09%29%20//%20https%3A//addons.mozilla.org/addon/private-tab/%0A%09%09%09%09mi.setAttribute%28%22privateTab-isPrivate%22%2C%20%22true%22%29%3B%0A%09%09%09if%28this.cm%29%0A%09%09%09%09mi.setAttribute%28%22context%22%2C%20this.cmId%29%3B%0A%09%09%09var%20image%20%3D%20undoItem.image%20//%20Firefox%0A%09%09%09%09%7C%7C%20state%20%26%26%20state.attributes%20%26%26%20state.attributes.image%20//%20SeaMonkey%0A%09%09%09%09%7C%7C%20state%20%26%26%20state.xultab%0A%09%09%09%09%09%26%26%20/%28%3F%3A%5E%7C%20%29image%3D%28%5CS+%29/.test%28state.xultab%29%0A%09%09%09%09%09%26%26%20decodeURI%28RegExp.%241%29%3B%20//%20Only%20Firefox%202.0%20%3F%0A%09%09%09if%28image%29%0A%09%09%09%09mi.setAttribute%28%22image%22%2C%20this.cachedIcon%28image%29%29%3B%0A%09%09%09if%28i%20%3D%3D%200%29%0A%09%09%09%09mi.setAttribute%28%22key%22%2C%20%22key_undoCloseTab%22%29%3B%0A%09%09%09undoPopup.appendChild%28mi%29%3B%0A%09%09%7D%2C%20this%29%3B%0A%09%7D%2C%0A%09getKey%3A%20function%28keys%2C%20i%29%20%7B%0A%09%09var%20key%20%3D%20keys%20%26%26%20keys.charAt%28i%20%25%20keys.length%29%3B%0A%09%09var%20keyPrefix%20%3D%20keys%20%26%26%20%28key%20+%20this.options.accesskeySeparator%29%3B%0A%09%09return%20%5Bkey%2C%20keyPrefix%5D%3B%0A%09%7D%2C%0A%09checkForMiddleClick%3A%20function%28e%2C%20upd%29%20%7B%0A%09%09var%20mi%20%3D%20e.target%3B%0A%09%09if%28%0A%09%09%09%22doCommand%22%20in%20mi%0A%09%09%09%26%26%20e.button%20%3D%3D%201%0A%09%09%09%26%26%20mi.parentNode%20%3D%3D%20e.currentTarget%0A%09%09%29%20%7B%0A%09%09%09mi.doCommand%28%29%3B%0A%09%09%09if%28upd%29%0A%09%09%09%09upd%28%29%3B%0A%09%09%09else%0A%09%09%09%09this.drawUndoList%28%29%3B%0A%09%09%7D%0A%09%7D%2C%0A%09crop%3A%20function%28s%2C%20crop%29%20%7B%0A%09%09if%28crop%20%3D%3D%20undefined%29%0A%09%09%09crop%20%3D%20500%3B%0A%09%09if%28s.length%20%3C%3D%20crop%29%0A%09%09%09return%20s%3B%0A%09%09var%20start%20%3D%20Math.round%28crop*0.6%29%3B%0A%09%09return%20s.substr%280%2C%20start%29%20+%20%22%u2026%22%20+%20s.substr%28start%20-%20crop%29%3B%0A%09%7D%2C%0A%09convertURI%3A%20function%28uri%2C%20crop%29%20%7B%0A%09%09if%28%21uri%20%7C%7C%20uri.indexOf%28%22%5Cn%22%29%20%21%3D%20-1%29%0A%09%09%09return%20uri%3B%0A%09%09uri%20%3D%20this.losslessDecodeURI%28uri%29%3B%0A%09%09return%20this.crop%28uri%2C%20crop%29%3B%0A%09%7D%2C%0A%09losslessDecodeURI%3A%20function%28uri%29%20%7B%0A%09%09if%28uri%29%20try%20%7B%0A%09%09%09return%20this._losslessDecodeURI%28uri%29%3B%0A%09%09%7D%0A%09%09catch%28e%29%20%7B%0A%09%09%09Components.utils.reportError%28e%29%3B%0A%09%09%7D%0A%09%09return%20uri%3B%0A%09%7D%2C%0A%09get%20_losslessDecodeURI%28%29%20%7B%0A%09%09var%20ldu%3B%0A%09%09if%28%22losslessDecodeURI%22%20in%20window%29%0A%09%09%09ldu%20%3D%20losslessDecodeURI%3B%0A%09%09else%20if%28%22UrlbarInput%22%20in%20window%29%20//%20Firefox%2075+%0A%09%09%09ldu%20%3D%20Components.utils.import%28%22resource%3A///modules/UrlbarInput.jsm%22%2C%20%7B%7D%29.losslessDecodeURI%3B%0A%09%09delete%20this._losslessDecodeURI%3B%0A%09%09return%20this._losslessDecodeURI%20%3D%20ldu%0A%09%09%09%3F%20function%28uri%29%20%7B%0A%09%09%09%09return%20ldu%28makeURI%28uri%29%29%3B%0A%09%09%09%7D%0A%09%09%09%3A%20decodeURI%3B%0A%09%7D%2C%0A%09cachedIcon%3A%20function%28src%29%20%7B%0A%09%09src%20%3D%20src.replace%28/%5B%26%23%5D-moz-resolution%3D%5Cd+%2C%5Cd+%24/%2C%20%22%22%29%3B%20//%20Firefox%2022+%0A%09%09if%28%0A%09%09%09%21/%5Ehttps%3F%3A/.test%28src%29%0A%09%09%09//%20IDN%2C%20see%20https%3A//bugzilla.mozilla.org/show_bug.cgi%3Fid%3D311045%0A%09%09%09%7C%7C%20/%5Ehttps%3F%3A%5C/%5C/%5B%5E.%3A%5C/%5D+%5C.%5B%5Ea-z0-9-%5D+%28%3F%3A%5C/%7C%24%29/.test%28src%29%20%26%26%20this.platformVersion%20%3C%2046%0A%09%09%09%7C%7C%20this.appName%20%3D%3D%20%22SeaMonkey%22%20%26%26%20this.appVersion%20%3C%3D%202%0A%09%09%09%7C%7C%20this.appName%20%3D%3D%20%22Firefox%22%20%20%20%26%26%20this.appVersion%20%3C%3D%203.5%0A%09%09%29%0A%09%09%09return%20src%3B%0A%09%09return%20%22moz-anno%3Afavicon%3A%22%20+%20src%3B%20//%20https%3A//bugzilla.mozilla.org/show_bug.cgi%3Fid%3D467828%0A%09%7D%2C%0A%09updUI%3A%20function%28%29%20%7B%0A%09%09var%20tabsCount%20%3D%20this.closedTabCount%3B%0A%09%09var%20dis%20%3D%20%21tabsCount%20%26%26%20%21this.closedWindowCount%3B%0A%09%09if%28%0A%09%09%09dis%0A%09%09%09%26%26%20this.options.useMenu%0A%09%09%09%26%26%20this.options.menuTemplate.indexOf%28%22restoreLastSession%22%29%20%21%3D%20-1%0A%09%09%09%26%26%20%22restoreLastSession%22%20in%20this.ss%20%26%26%20this.ss.canRestoreLastSession%0A%09%09%29%0A%09%09%09dis%20%3D%20false%3B%0A%09%09this.button.disabled%20%3D%20dis%3B%0A%09%7D%2C%0A%09updTooltip%3A%20function%28tip%2C%20tn%29%20%7B%0A%09%09var%20template%2C%20header%2C%20title%2C%20url%2C%20closedAt%3B%0A%09%09if%28tn%20%3D%3D%20this.button%29%20%7B%0A%09%09%09template%20%3D%20this.options.buttonTipTemplate%3B%0A%09%09%09header%20%3D%20_localize%28%22restoreTab%22%29%3B%0A%09%09%09let%20undoTabItems%20%3D%20JSON.parse%28this.ss.getClosedTabData%28window%29%29%3B%0A%09%09%09if%28undoTabItems.length%29%20%7B%0A%09%09%09%09let%20lastItem%20%3D%20undoTabItems%5B0%5D%3B%0A%09%09%09%09title%20%3D%20lastItem.title%3B%0A%09%09%09%09url%20%3D%20lastItem.state%20%26%26%20lastItem.state.entries%0A%09%09%09%09%09%26%26%20lastItem.state.entries%5BlastItem.state.index%20-%201%5D.url%3B%0A%09%09%09%09closedAt%20%3D%20lastItem.closedAt%20%7C%7C%200%3B%0A%09%09%09%7D%0A%09%09%7D%0A%09%09else%20if%28tn.hasAttribute%28%22cb_index%22%29%29%20%7B%0A%09%09%09template%20%3D%20this.options.itemTipTemplate%3B%0A%09%09%09title%20%3D%20tn.getAttribute%28%22label%22%29%3B%0A%09%09%09url%20%3D%20tn.getAttribute%28%22cb_url%22%29%3B%0A%09%09%09closedAt%20%3D%20+tn.getAttribute%28%22cb_closedAt%22%29%3B%0A%09%09%7D%0A%09%09else%20%7B%0A%09%09%09return%20false%3B%0A%09%09%7D%0A%0A%09%09var%20tipData%20%3D%20this.getTooltipData%28template%2C%20header%2C%20title%2C%20url%2C%20closedAt%29%3B%0A%09%09tip.textContent%20%3D%20%22%22%3B%0A%09%09tip.appendChild%28tipData%29%3B%0A%09%09if%28closedAt%20%26%26%20template.indexOf%28%22closedAt%22%29%20%21%3D%20-1%29%20%7B%0A%09%09%09tip.initUpdateTimer%28function%28%29%20%7B%0A%09%09%09%09var%20tipData%20%3D%20this.getTooltipData%28template%2C%20header%2C%20title%2C%20url%2C%20closedAt%29%3B%0A%09%09%09%09if%28tipData.textContent%20%21%3D%20tip.textContent%29%20%7B%0A%09%09%09%09%09tip.textContent%20%3D%20%22%22%3B%0A%09%09%09%09%09tip.appendChild%28tipData%29%3B%0A%09%09%09%09%7D%0A%09%09%09%7D%2C%20this%29%3B%0A%09%09%7D%0A%09%09return%20tip.hasChildNodes%28%29%3B%0A%09%7D%2C%0A%09getTooltipData%3A%20function%28template%2C%20header%2C%20title%2C%20url%2C%20closedAt%29%20%7B%0A%09%09var%20df%20%3D%20document.createDocumentFragment%28%29%3B%0A%09%09var%20hasHeader%20%3D%20header%20%26%26%20template.indexOf%28%22header%22%29%20%21%3D%20-1%3B%0A%09%09function%20item%28key%2C%20val%29%20%7B%0A%09%09%09var%20lbl%20%3D%20document.createElementNS%28xulns%2C%20%22label%22%29%3B%0A%09%09%09lbl.className%20%3D%20%22cb-%22%20+%20key%20+%20%22%20tooltip-label%22%3B%0A%09%09%09lbl.textContent%20%3D%20val%3B%0A%09%09%09lbl.setAttribute%28%22maxwidth%22%2C%20%22450%22%29%3B%20//%20Trick%20to%20restore%20right%20border%20for%20long%20lines%0A%09%09%09if%28key%20%3D%3D%20%22closedAt%22%20%7C%7C%20hasHeader%20%26%26%20key%20%21%3D%20%22header%22%29%0A%09%09%09%09lbl.style.color%20%3D%20%22grayText%22%3B%0A%09%09%09return%20df.appendChild%28lbl%29%3B%0A%09%09%7D%0A%09%09template.forEach%28function%28key%29%20%7B%0A%09%09%09switch%28key%29%20%7B%0A%09%09%09%09case%20%22header%22%3A%0A%09%09%09%09%09if%28header%29%0A%09%09%09%09%09%09item%28key%2C%20header%29%3B%0A%09%09%09%09break%3B%0A%09%09%09%09case%20%22title%22%3A%0A%09%09%09%09%09if%28title%20%26%26%20title%20%21%3D%20url%29%0A%09%09%09%09%09%09item%28key%2C%20title%29%3B%0A%09%09%09%09break%3B%0A%09%09%09%09case%20%22url%22%3A%0A%09%09%09%09%09if%28url%29%0A%09%09%09%09%09%09item%28key%2C%20this.convertURI%28url%29%29%3B%0A%09%09%09%09break%3B%0A%09%09%09%09case%20%22closedAt%22%3A%0A%09%09%09%09%09if%28%21closedAt%29%0A%09%09%09%09%09%09break%3B%0A%09%09%09%09%09let%20dt%20%3D%20Math.round%28Math.max%280%2C%20Date.now%28%29%20-%20closedAt%29/1000%29%3B%0A%09%09%09%09%09let%20days%20%3D%20Math.floor%28dt/24/3600%29%3B%0A%09%09%09%09%09dt%20-%3D%20days*24*3600%3B%0A%09%09%09%09%09let%20d%20%3D%20new%20Date%28%28dt%20+%20new%20Date%28dt%29.getTimezoneOffset%28%29*60%29*1000%29%3B%0A%09%09%09%09%09let%20m%20%3D%20d.getMinutes%28%29%3B%0A%09%09%09%09%09let%20ts%20%3D%20d.getHours%28%29%20+%20%22%3A%22%20+%20%28m%20%3E%209%20%3F%20m%20%3A%20%220%22%20+%20m%29%3B%0A%09%09%09%09%09if%28days%29%0A%09%09%09%09%09%09ts%20%3D%20days%20+%20_localize%28%22day%22%29%20+%20%22%20%22%20+%20ts%3B%0A%09%09%09%09%09let%20tsTip%20%3D%20_localize%28%22itemTip%22%29%0A%09%09%09%09%09%09.replace%28%22%25ago%22%2C%20ts%29%0A%09%09%09%09%09%09.replace%28%22%25date%22%2C%20new%20Date%28closedAt%29.toLocaleString%28%29%29%3B%0A%09%09%09%09%09item%28key%2C%20tsTip%29%3B%0A%09%09%09%7D%0A%09%09%7D%2C%20this%29%3B%0A%09%09return%20df%3B%0A%09%7D%2C%0A%09get%20wm%28%29%20%7B%0A%09%09delete%20this.wm%3B%0A%09%09return%20this.wm%20%3D%20Components.classes%5B%22@mozilla.org/appshell/window-mediator%3B1%22%5D%0A%09%09%09.getService%28Components.interfaces.nsIWindowMediator%29%3B%0A%09%7D%2C%0A%09updUIGlobal%3A%20function%28%29%20%7B%0A%09%09var%20isSeaMonkey%20%3D%20this.appName%20%3D%3D%20%22SeaMonkey%22%3B%0A%09%09var%20ws%20%3D%20this.wm.getEnumerator%28isSeaMonkey%20%3F%20null%20%3A%20%22navigator%3Abrowser%22%29%3B%0A%09%09const%20id%20%3D%20this.button.id%3B%0A%09%09while%28ws.hasMoreElements%28%29%29%20%7B%0A%09%09%09let%20win%20%3D%20ws.getNext%28%29%3B%0A%09%09%09if%28isSeaMonkey%20%26%26%20%21this.isBrowserWindow%28win%29%29%0A%09%09%09%09continue%3B%0A%09%09%09let%20btn%20%3D%20win.document.getElementById%28id%29%3B%0A%09%09%09if%28btn%20%26%26%20%22undoCloseTabsList%22%20in%20btn%29%20%7B%0A%09%09%09%09let%20ucl%20%3D%20btn.undoCloseTabsList%3B%0A%09%09%09%09ucl.ensureSessionsInitialized%28ucl.updUI%2C%20ucl%29%3B%0A%09%09%09%7D%0A%09%09%7D%0A%09%7D%2C%0A%09isBrowserWindow%3A%20function%28win%29%20%7B%0A%09%09var%20loc%20%3D%20window.location.href%3B%0A%09%09return%20loc%20%3D%3D%20%22chrome%3A//browser/content/browser.xul%22%0A%09%09%09%7C%7C%20loc%20%3D%3D%20%22chrome%3A//navigator/content/navigator.xul%22%3B%0A%09%7D%2C%0A%09ensureSessionsInitialized%3A%20function%28callback%2C%20context%29%20%7B%0A%09%09var%20_this%20%3D%20this%3B%0A%09%09var%20stopTime%20%3D%20Date.now%28%29%20+%203e3%3B%0A%09%09%28function%20ensureInitialized%28%29%20%7B%0A%09%09%09try%20%7B%0A%09%09%09%09_this.ss.getClosedTabCount%28window%29%3B%0A%09%09%09%09callback.call%28context%29%3B%0A%09%09%09%09return%3B%0A%09%09%09%7D%0A%09%09%09catch%28e%29%20%7B%0A%09%09%09%09if%28Date.now%28%29%20%3E%20stopTime%29%20%7B%0A%09%09%09%09%09Components.utils.reportError%28%0A%09%09%09%09%09%09_this.errPrefix%0A%09%09%09%09%09%09+%20%22Can%27t%20initialize%3A%20nsISessionStore.getClosedTabCount%28%29%20failed%22%0A%09%09%09%09%09%29%3B%0A%09%09%09%09%09Components.utils.reportError%28e%29%3B%0A%09%09%09%09%09return%3B%0A%09%09%09%09%7D%0A%09%09%09%7D%0A%09%09%09setTimeout%28ensureInitialized%2C%2050%29%3B%0A%09%09%7D%29%28%29%3B%0A%09%7D%0A%7D%3B%0A%0Aif%28%21this.undoCloseTabsList.options.useMenu%20%26%26%20this.undoCloseTabsList.useCentextMenu%29%20%7B%0A%09this.oncontextmenu%20%3D%20function%28e%29%20%7B%0A%09%09if%28%0A%09%09%09e.target%20%21%3D%20this%0A%09%09%09%7C%7C%20e.ctrlKey%20%7C%7C%20e.shiftKey%20%7C%7C%20e.altKey%20%7C%7C%20e.metaKey%0A%09%09%09%7C%7C%20%21this.undoCloseTabsList.mp.hasChildNodes%28%29%0A%09%09%29%0A%09%09%09return%3B%0A%09%09e.preventDefault%28%29%3B%0A%09%09this.undoCloseTabsList.showMenu%28e%29%3B%20//%20Show%20menu%20without%20%22context%22%20flag%0A%09%7D%3B%0A%7D%0Aif%28this.undoCloseTabsList.options.rightClickToUndoCloseTab%29%20%7B%0A%09this.oncontextmenu%20%3D%20function%28e%29%20%7B%0A%09%09if%28e.target%20%3D%3D%20this%20%26%26%20%21e.ctrlKey%20%26%26%20%21e.shiftKey%20%26%26%20%21e.altKey%20%26%26%20%21e.metaKey%29%0A%09%09%09e.preventDefault%28%29%3B%0A%09%7D%3B%0A%7D%0A%0Athis.disabled%20%3D%20true%3B%0AsetTimeout%28function%28_this%29%20%7B%0A%09_this.undoCloseTabsList.init%28%29%3B%0A%7D%2C%200%2C%20this%29%3B%0A%0A//%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%0A//%20Styles%0A//%20Used%20icons%20from%20Undo%20Closed%20Tabs%20Button%20extension%0A%0A//%20Styles%20can%27t%20override%20hardcoded%20icon%0Aif%28%20//%20Remove%20icon%20only%20if%20nsIStyleSheetService%20works%20on-the-fly%20%28Firefox%203.0+%29%0A%09%21Components.ID%28%22%7B41d979dc-ea03-4235-86ff-1e3c090c5630%7D%22%29%0A%09%09.equals%28Components.interfaces.nsIStyleSheetService%29%0A%29%20%7B%0A%09let%20icon%20%3D%20this.icon%0A%09%09%7C%7C%20this.ownerDocument.getAnonymousElementByAttribute%28this%2C%20%22class%22%2C%20%22toolbarbutton-icon%22%29%3B%0A%09if%28icon%29%0A%09%09icon.src%20%3D%20%22%22%3B%0A%09else%0A%09%09this.image%20%3D%20%22%22%3B%0A%7D%0A%0Avar%20cssStr%20%3D%20%27%5C%0A@namespace%20url%28%22http%3A//www.mozilla.org/keymaster/gatekeeper/there.is.only.xul%22%29%3B%5Cn%5C%0A%09@-moz-document%20url%28%22%25windowURL%25%22%29%20%7B%5Cn%5C%0A%09%09%25button%25%20%7B%5Cn%5C%0A%09%09%09list-style-image%3A%20url%28%22data%3Aimage/png%3Bbase64%2CiVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAEEUlEQVRIS9XVbWxTVRgA4Pfce3tv27t2bbNuXbfCBuyzAZ2MEdkkLH5gJvEH8TOZEo0JFdgmbgjTgEHUGQXGMJEMmDJMiNvQjS9BJhH8MY3IfsB0rnTraCcbm13b2+/1fni2xAVuxOHAH57+adNz3uee9z3vuQj+44FmG79VksglAIoMgBhCSLpdnFkBkiQxl2OQgRdbJhjoKkQofM+ALklSGSNwf1iAjbXNZ3MdI+MB+7vPF989IEnoZwBVQhCWBgVhW13b+WX5KXpFR7fDe/ntZ8wYiONUiXLojlKEU4LGANgRDpZHBH7r9iPnilZaM4jKFTlQ/P5XvHV+6o5si7HzuWUL+hzngSstRfxf0DSwa9cHa3GgWgmQTv4UNMMggyWTMuYtYepOXCKfKMiGZ4tyQEMDjPrDcGVoDI780As3/AGhJIVs2vTk6pqkJAhOFn8KaG1tpV1u53h5+RpGr7s1/uTxCIgk6g/EiaqmM2i5NRseL7SCgwMg8Wo9A5CsBLjPADDki8CbbRdgQiI631n/2NOFANwUUF9frxPECVf1628gn893Sx55IIhxBavcffIi1fO7H15atRJiAoD8XBI4UmYCwOIkCdY3fyuyrGrHZ+UldXJAwoDn5hThQESYpNXXQpJuw4HTiuzM+fBAfu7UFIQ/0wN/nfydrEKwSCdARfMZftVSa6kcEPx+v0NeA7wlKowYXX+AT604+DWTmT4XcufhFsN6r9MJ/gAHiVotpBmNoNNoIctAw8Xf7FKMjx2TA7zX6/3p7860SBCKEGJSBrj4PIyozMkm0KhZsDv7hTUP5Xt+HfFpuvqGVBZTKizEuOePEYiL0V/kQJzjuG9u1zS8RDAhRFv6/FFr5YFTaopicJGRt932yDmJQLQ3JpY9+lEHVZCTB6PecTAmEMNyIIZr8MU/3U8iSSo5RGfZPZGFFftPaU0a9dgxW+mXBEGQtJJ5xbq1hUo3mdENzxjYyoq65UAUA5/MdAGKiFQHSGbB1WEPDZGIq3COYRQD1I/XPJttn39PKRlWYpUgfvraU2/JgXAwGHxvRkAUEd6JAteYJAUhioNLwaigLN1z8sNQLA5mQyK//YWHr8zRaV9EjY2NikDAuwkQ2oL7IIRH9UzATf9PPuBUS4gIKY92u/Zf5zhixaKsAa1BXzOhhrNoz96d21JNaavT0tO9xQ+W5GDg5X8BTE/lCSIBUcqW3kGX3XW1Jz7sdtVXrn31EGpo2Nm0bl1VHt7maTw7Eo1GL8wGwPcOiRSKMpIgUpzOAd2JjqOdNTW1B1HDx7ttlRs2mnCDHZ5NYPkalmXnut3uxe3tbZeqqzd/h/bt21tgs1WocYP13AtAr9cnDg4Omo8fb7leVbXFdUfvg7uB///An8idyhRIYoVPAAAAAElFTkSuQmCC%22%29%20%21important%3B%5Cn%5C%0A%09%09%7D%5Cn%5C%0A%09%09%25button%25%3Ahover%20%7B%5Cn%5C%0A%09%09%09list-style-image%3A%20url%28%22data%3Aimage/png%3Bbase64%2CiVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAECUlEQVRIS9XVe2xTVRgA8O/ce3tv310fa8P6AOoapwznYtXFzchQJNEYNTHEODSaYLK4jsEaGcQnEpAQu8r+WLJMMmOMIQXnNgeKYTJjfBGzMEGTztVubcGmD9q1t+263t7r2Qxka8DhwD88//SP2/P97vd95zsXwX+80ErjC4JAjE4BvWEN5BFCwvXirAjAwWkfgIVjwczK4Sc7QtlbBpwRBLG+ADVcDnbu+fjUHZMX4+mJA00NNw8IAvoZQKIEsLOp4pv7PaMP2jRKanjclzi/99kKDBSuVaobKhEuCYoCyKIZaMjOcW+89clIXe1qA9H80Hp4uqu/UGszvlNl1J/eVF/pjY9CurERcVcyugq4XAdf5gXowP2SL00XAUkzSGteSxuq7LIDw2Miu9UET9y7DhgSwHcpAhN/RuHrC34QeJ57wED17nryqQ6dDtj5jBYAj8dDB4L+WNNzz0uUStWS+PPHI4so5EtzRNuRL9Hday1QX22D6RkOSLxbShGgZAgwKSiYjsTgo2/GQCGTfbXP8egWO0BqAXC73WVFfi7gbN+Fkskkv1jggCAui2Ri1/BZ6pfpGGy+7x7IFnjA2f69rvziSDopBUY5Cd1ffMtXmfX7+rY2vFsKCBiILwbwfiJL0tIpVihz9J4UlWvL4TaTaWnwRZaMJkFOzMFnP5zjmhprG0uB4szMzGTpkcMImQFG7csUV7X2nmA0ZRow6w2Amw/BSARmZ3MgFotBi8srk0iAERHweygkVBoUg6UAl0gkzl7rTPMEIcogxuBPcVbHByckKrkKJIwYwtFw8cUN1bFfLyaU33uDEp1KDQatDkLRCNy+SnGhFCikUqlT1xsaTiCYDKLNE+n8ndt7Tkp5QKhcKkoMtTwyUgREx7LcY5tdg5TNtBoSbBos5ZJLpUAe9+DoP91PHEmKWUTbJpP59Y7uIYVBKY0NNm/8lCAIkqBE22re9lB6rR7FUwl45fH7x0qBWQx0L3cB8oiUpkmm0h9JiIRsNlBrUkcxQI14w7udx34kxIwE9wLxfW3P7CkFsizL7l8W4HnEk6RovvlksTiLgwvJXEG6sXP4YJ4rQoVGxe3d+vC41ax8AfX09IhS7OXXEBDteA4yeDmXAxY9n3/BhUnApvjoOX9vPJODhnXWKbVWsyMlhdOo8/1Dr1tMa7YYjRWpurp6KwZe+hfA1b/iAyAHmvZ4g0Ff0PtbLhzwH25pbulDne5DPa2OnXfhNAeLON1CofDdSgB875Akw2zCKZn8f0xKhz4fGH21veMIch9+b9uO7U4LHrAPVxK4dI9MJrMGAoHqgYHj405nxxnU1eWqaW1tV+ABO38rALVaXRYK+Q39/Z5wW9vuwA19D24G/v8DfwHJNM8naEZRUgAAAABJRU5ErkJggg%3D%3D%22%29%20%21important%3B%5Cn%5C%0A%09%09%7D%5Cn%5C%0A%09%09%25button%25%5Bdisabled%3D%22true%22%5D%20%7B%5Cn%5C%0A%09%09%09list-style-image%3A%20url%28%22data%3Aimage/png%3Bbase64%2CiVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAADCklEQVRIS9WVz0sbQRTHZ3Y32awxYkOIMaQQjBJ026zVVLCeCpX2H2jpqaceSjGnUpBcKj0IpVA81UtLT4VCoYdepJcapBYKGjfNbwNqTGJsbGKi5pdmd/s2tEVCjBrroQMLw8x77/Pem+/MYnTOA59zfHQmwPj4+AWCIG5OTk6+OyrRpgFOp7MTgn6pVCpdLS0t9MTExH49SFMACNaFMZ7v6enRRSKRiiRJnbCWbQgAI8LjWbyBMaFtdC7r67GLwWD4CQRnLBYL4XK5yoIgbKpUqkB7e9u3oSHrlMViz/2J8bcCnl/8TJCUmVJQW0cB0ls/W91u3gqDNBqNVTNoEcrlcmhnZwdtJDdEiqSEUql0zeFwLMj7VYDf728t7xdTV/oHFeBQrAdIJpPkzMwMA5ljnU5XNwfoAgI7tLKyUhJF0T42NuavApaWltolJEQBQGWz2Xw971gsRvM8r+nr68NKpbKhulOplBSNRldBYWwtgNze3o4d5b28vKxdW1vTQRWEQqFoCIEqCtC26VoAARV4GnkCxJRIJExms5mEgeLxuJDP5wmKokSNRkNotVosw/f29hDYLdQCMABcx91ukKYV2mAxGAykDBgZGflUKBQYCHoVMlebTCYMypLh8VoA2t3d/XAcQN4Ph8P2TCbTC1NxeHj4rbwGFYzOuma1jIphoCKUTqdjtQAJAK9PApBtoF3Xi8WimeO4N78Bt+fm5vRqtZqGivIHBwePawEiaPr5SQFVncPNBHmK8hza4giFQx0KSlGB4D/0en13LUAAgPM0gMO2cKhTcA40yNMN79Moy7IZ7PV6OyrC/iuMkZ2zDSgB8KBZADwXz4KhgIAkKQECe2SzDS5ij8c9beg03tK0tpUZhtHANb93BsAU+KvyhXwlHl+f7+cG7uPvPv7FZZazQv9eQi+Fcrm82SyApmk9nIkK/B8GAr6vNlv/U+wL+O6yvawR1PC+2cCH/QBAwlNyJxTyhViW+4gjEa+lu/sSA0ar/wIgCwu+rmAwmIN3K9rUD+c0ifz/gF/LJ4uAUJQHTwAAAABJRU5ErkJggg%3D%3D%22%29%20%21important%3B%5Cn%5C%0A%09%09%7D%5Cn%5C%0A%09%09toolbar%5Biconsize%3D%22small%22%5D%20%25button%25%20%7B%5Cn%5C%0A%09%09%09list-style-image%3A%20url%28%22data%3Aimage/png%3Bbase64%2CiVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAACPElEQVQ4T2NkIBL8//+fEQj+oytnJEY/UDPXzPOPTdINZQ+jG0LQgPvv/wvsvf9k54FzN432X39S9rQ3oR/ZUrgBvb29akxMf7mQJcWVNYTeCWvOfvrijVK9nymDRevqKwqsfxdYiLDNqUgP+whSCzZg4sS+dkYmxlx2NrYfMAM4efiYXonr8Z27/4q52NeGQZiLlYGd4Q/D9iuPGDafu/3/zZevvocrwraCDZgwoWd/QECwtbi4xD8QHxRS178xsPq2LmfKC/FlEBAUYfgDFORlZWCQ52FgUOP5zVCz9sjfiw/eKMENCAwMMeXl5XsMc8FPJhbOjv235A5fe8zoZWvLwMTIxPD45UsGPm5uBiVxQQZN7u8MnVtPXUN2gbGAgOAJpDBg/MrIKtCy/bLRsVtPmXi4uBj+/fn2+9vPvyycHJyMLgZaDAcvXPoFN8A/IMhIUEBoLUoIA+Ps4382qfotZ112nL3JVOyieyjdQYfXuGWtgbCgCOOnzx//IrvAgJ9fYDKWdMH4mYlduX/HOa0AHamD3Jyc5v5TtptzsrMzeBmrXWKcNGkS399/Pw8GBoTIA71QgSNhwaL7/9zjdzN6d10wdDdR/5XrbWbNOHvOjA18fHwmTo6ubECQQChlcnBzR5y9/yT4wcVTb1+/fW7DuGjR3EXR0QlfgMn16N+/fy8TMoCJiUkCiK0PHNqvduXSuTrGNWtWugcHh737+PHjHUKaYfL8/Pyip04dV7tw4dBhgnmBkKEUGwAAgK/XtUYSNDQAAAAASUVORK5CYII%3D%22%29%20%21important%3B%5Cn%5C%0A%09%09%7D%5Cn%5C%0A%09%09toolbar%5Biconsize%3D%22small%22%5D%20%25button%25%3Ahover%20%7B%5Cn%5C%0A%09%09%09list-style-image%3A%20url%28%22data%3Aimage/png%3Bbase64%2CiVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAACRElEQVQ4T2NkIBr8Z2RgYPyPrhwoSBj8//+fbfXt11phqqIXGRhRDSFoAFAzz8KLzzdvP3nZ+titFwWPe+OnIVsJN6BnSo88ww8GTmRJBRUV/jeSuvOOXL6nVeJuxBA3Z+cZWfY/M0x1BZc3+Pp+A6kFGzBxYm8T0GnFrKwsP2AGsHPyMH2RNebdfukxc6KLOYMAFzvDq3fvGC49fMFw+dGL/z9+/nQ7UBm+B2zAhIk9+3x9A2ylJKX/gfigkLr9jZHVt305Y4i9JQMbJy/Dn3//GbhZmRiEuVgYWP9+ZVh19MLfHz9/y0MMmNCz39cvwEJQQOgBzAU/mdg4m3dflTty7TGjkYYm2KmvP3xg4OLgYBDm42H48/09w/UnLy8hG2AuLCRyFCkMGL8ysAo0brtoeOzmEyZ2NjYGFsY/v7///sfCzMTCKCEiyvDo+dNfcAP8/AJNhYSEV6GEMCMj0BA2yaqNZ1x3nr/FlO+kfSTbSY/bqHmtAQ8PH+OPH9/+ohggKCjUhyVVMH5hYlfs3XFeO1BH8hAHB4d50NTt5pzs7AyuhioXGWfO7OD/9p35EDAQFcVExYuxJat///6BLWJiYvo/59jtjN5dF418zDV/ZbpZWDDOnTtzI7+AoLGDvSM3KytbFKF0ycHNHXnx/tPgW+dPvnn99qk948LF8+bFRMV/Aqa4Y9+/f79G0AAODjGgUywOHdivefHipUbGVetWOYUGhr778OEDPAoJGSIgICB87Ngh5bNnL54gmBcIGUaxAQAqY9puYCzN/wAAAABJRU5ErkJggg%3D%3D%22%29%20%21important%3B%5Cn%5C%0A%09%09%7D%5Cn%5C%0A%09%09toolbar%5Biconsize%3D%22small%22%5D%20%25button%25%5Bdisabled%3D%22true%22%5D%20%7B%5Cn%5C%0A%09%09%09list-style-image%3A%20url%28%22data%3Aimage/png%3Bbase64%2CiVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAB70lEQVQ4T2NkoBAwEqu/vLzcjpOT81pDQ8MbZD1EGVBZWZn579+/qUxMTBXt7e1dGAbcv3+f4/2n9z6M//7zoLvo7NlzXh8+fPQTFxdnfwEEvPy8R+RlpWd4evruBakFu+DCpfNLONg4/NjZ2X4jG3D16jWup0+fsRsZGTGysLAwvH79muH9+/cMQHMY2NjY8jMzMyfBDNivrKhs+f8/wy+YAb9+/WJcs2YNj66uLgMvLy+Kw75//85w6dKl74yMjNZwAxQVlEz//f13D1nlgwcPBG/evCmloqLCBFQMth1oMwMfHx/Dx48f/z99+vQssgHGDP8ZjqCHwd27d+UfP36szs7ODvLGO2BAcgNdwCEhIcH46NGjt8gGGP3/938VtmgFBrIB0N8mcnJyB1VVVbkOHjxgzMnJxfT169cnCAPklQyApk/AlS6ePXumJSQk9ACoxuHKlStmQPonUG0e4+XLl8X//v29V0lJWQoYKaWEEtaXL1/SgX43AQbJWhMT01DGq9ev7ODm4tKWEJdi+/PnTxwhA4CpMfz161e+79+/e/f7919Pxtu3b85RUlJ5+////8PAwLlPyAAODg5BoPONXr16YfDmzbtWxseP79vLyCgAY+j9Q0KaYfJAVwgCA1DpzZs3p4nKC/gMptgAAO1G2FJifkXnAAAAAElFTkSuQmCC%22%29%20%21important%3B%5Cn%5C%0A%09%09%7D%5Cn%5C%0A%09%7D%27%0A%09.replace%28/%25windowURL%25/g%2C%20window.location.href%29%0A%09.replace%28/%25button%25/g%2C%20%22%23%22%20+%20this.id%29%3B%0Avar%20cssURI%20%3D%20this.cssURI%20%3D%20Components.classes%5B%22@mozilla.org/network/io-service%3B1%22%5D%0A%09.getService%28Components.interfaces.nsIIOService%29%0A%09.newURI%28%22data%3Atext/css%2C%22%20+%20encodeURIComponent%28cssStr%29%2C%20null%2C%20null%29%3B%0Avar%20sss%20%3D%20this.sss%20%3D%20Components.classes%5B%22@mozilla.org/content/style-sheet-service%3B1%22%5D%0A%09.getService%28Components.interfaces.nsIStyleSheetService%29%3B%0Aif%28%21sss.sheetRegistered%28cssURI%2C%20sss.USER_SHEET%29%29%0A%09sss.loadAndRegisterSheet%28cssURI%2C%20sss.USER_SHEET%29%3B%0A%0A%0Athis.onDestroy%20%3D%20function%28reason%29%20%7B%0A%09this.undoCloseTabsList.destroy%28%29%3B%0A%09if%28reason%20%3D%3D%20%22destructor%22%29%20//%20May%20happens%20before%20%22unload%22%0A%09%09this.undoCloseTabsList.updUIGlobal%28%29%3B%0A%09if%28reason%20%3D%3D%20%22update%22%20%7C%7C%20reason%20%3D%3D%20%22delete%22%29%20%7B%0A%09%09let%20sss%20%3D%20this.sss%3B%0A%09%09let%20cssURI%20%3D%20this.cssURI%3B%0A%09%09if%28sss.sheetRegistered%28cssURI%2C%20sss.USER_SHEET%29%29%0A%09%09%09sss.unregisterSheet%28cssURI%2C%20sss.USER_SHEET%29%3B%0A%09%7D%0A%7D%3B%0Aif%28this.undoCloseTabsList.options.useMenu%29%20%7B%0A%09this.type%20%3D%20%22menu%22%3B%0A%09this.orient%20%3D%20%22horizontal%22%3B%0A%7D%5D%5D%3E%3C/initcode%3E%0A%20%20%3Ccode%3E%3C%21%5BCDATA%5Bif%28%21event.target%29%20//%20Button%27s%20hotkey%20pressed%0A%09this.undoCloseTabsList.drawUndoList%28%29%20%26%26%20this.undoCloseTabsList.openMenu%28%29%3B%5D%5D%3E%3C/code%3E%0A%20%20%3Caccelkey%3E%3C%21%5BCDATA%5B%5D%5D%3E%3C/accelkey%3E%0A%20%20%3Chelp%3E%3C%21%5BCDATA%5B%5D%5D%3E%3C/help%3E%0A%20%20%3Cattributes/%3E%0A%3C/custombutton%3E |
Alex_one > 31-03-2024 16:16:48 |
VORON пишет
Нет, тоже не работает. Так же значок неактивный. |
Jurgens > 31-03-2024 16:30:33 |
Alex_one пишет
Подтверждаю. |
Alex_one > 31-03-2024 16:33:59 |
Jurgens пишет
|
vending_machine > 31-03-2024 16:34:51 |
Alex_one пишет
при закрытом Firefox, папку startupCache |
Jurgens > 31-03-2024 16:39:13 |
Alex_one пишет
Как по мне - вполне приемлемо, да и количество вкладок можно сделать побольше. |
Alex_one > 31-03-2024 16:43:21 |
vending_machine пишет
Само собой, но для этого использую скрипт. скрытый текст |
ifln > 31-03-2024 20:30:04 |
Alex_one пишет
У меня предыдущая версия работает. Но там я что-то редактировал. скрытый текст Выделить код Код:// http://infocatcher.ucoz.net/js/cb/undoCloseTabs.js // https://forum.mozilla-russia.org/viewtopic.php?id=56267 // https://github.com/Infocatcher/Custom_Buttons/tree/master/Undo_Close_Tabs // Undo Close Tabs button for Custom Buttons // (code for "initialization" section) // (c) Infocatcher 2009-2015, 2017-2020 // version 0.3.3.2 - 2020-03-14 var options = { menuTemplate: [ "closedWindows", "separator", "restoreClosedWindows", "clearClosedWindows", "separator", "closedTabs", "separator", "restoreClosedTabs", "clearClosedTabs", "separator", "clearAll", "separator", "restoreLastSession", "separator", "buttonMenu" ], showInTabContextMenu: false, /* menuTemplateTabContext: [ // like menuTemplate "closedTabs", "separator", "restoreClosedTabs", "clearClosedTabs" ], */ windowItemTemplate: "(%count) %title", windowSelectedTabPrefix: "*", buttonTipTemplate: ["header", "title", "url", "closedAt"], itemTipTemplate: ["title", "url", "closedAt"], hideRestoreAllForSingleEntry: false, allowDeleteEntries: true, accesskeys: { // Empty string ("") to disable or string with possible values ("0123...", "abcd...") closedTabs: "", closedWindows: "" }, accesskeySeparator: " ", // <accesskey><separator><label> openMenuOnMouseover: false, useMenu: false, rightClickToUndoCloseTab: false // Useful with "useMenu: true" }; function _localize(sid) { var strings = { en: { restoreTab: "Restore the most recently closed tab", restoreAllTabs: "Restore all tabs", restoreAllTabsAccesskey: "t", clearTabsHistory: "Clear history of closed tabs", clearTabsHistoryAccesskey: "b", restoreAllWindows: "Restore all windows", restoreAllWindowsAccesskey: "w", clearWindowsHistory: "Clear history of closed windows", clearWindowsHistoryAccesskey: "d", clearAllHistory: "Clear all history", clearAllHistoryAccesskey: "C", restoreLastSession: "Restore last session", restoreLastSessionAccesskey: "s", deleteUndoEntry: "Delete", buttonMenu: "Button menu", buttonMenuAccesskey: "m", tabContextMenu: "Recently Closed Tabs", tabContextMenuAccesskey: "y", itemTip: "%ago ago, %date", day: "d" }, ru: { restoreTab: "Восстановить последнюю закрытую вкладку", restoreAllTabs: "Восстановить все вкладки", restoreAllTabsAccesskey: "л", clearTabsHistory: "Очистить историю закрытых вкладок", clearTabsHistoryAccesskey: "д", restoreAllWindows: "Восстановить все окна", restoreAllWindowsAccesskey: "о", clearWindowsHistory: "Очистить историю закрытых окон", clearWindowsHistoryAccesskey: "н", clearAllHistory: "Очистить всю историю", clearAllHistoryAccesskey: "ч", restoreLastSession: "Восстановить последнюю сессию", restoreLastSessionAccesskey: "с", deleteUndoEntry: "Удалить", buttonMenu: "Меню кнопки", buttonMenuAccesskey: "М", tabContextMenu: "Недавно закрытые вкладки", tabContextMenuAccesskey: "о", itemTip: "%ago назад, %date", day: "д" } }; var locale = (function() { if("Services" in window && "locale" in Services) { var locales = Services.locale.requestedLocales // Firefox 64+ || Services.locale.getRequestedLocales && Services.locale.getRequestedLocales(); if(locales) return locales[0]; } var prefs = "Services" in window && Services.prefs || Components.classes["@mozilla.org/preferences-service;1"] .getService(Components.interfaces.nsIPrefBranch); function pref(name, type) { return prefs.getPrefType(name) != prefs.PREF_INVALID ? prefs["get" + type + "Pref"](name) : undefined; } if(!pref("intl.locale.matchOS", "Bool")) { // Also see https://bugzilla.mozilla.org/show_bug.cgi?id=1414390 var locale = pref("general.useragent.locale", "Char"); if(locale && locale.substr(0, 9) != "chrome://") return locale; } return Components.classes["@mozilla.org/chrome/chrome-registry;1"] .getService(Components.interfaces.nsIXULChromeRegistry) .getSelectedLocale("global"); })().match(/^[a-z]*/)[0]; _localize = function(sid) { return strings[locale] && strings[locale][sid] || strings.en[sid] || sid; }; return _localize.apply(this, arguments); } var JSON = "JSON" in window //? window.JSON ? { parse: function(arg) { return typeof arg == "string" ? (JSON = window.JSON).parse(arg) : (this.parse = function(obj) { return obj; }) && arg; } } : { parse: function(s) { return Components.utils.evalInSandbox("(" + s + ")", new Components.utils.Sandbox("about:blank")); } }; this.onclick = function(e) { if(e.target != this) return; if(e.button == 1 || e.button == 0 && (e.ctrlKey || e.shiftKey || e.altKey || e.metaKey)) this.undoCloseTabsList.clearAllLists(); else if( e.button == 0 || e.button == 2 && !e.ctrlKey && !e.shiftKey && !e.altKey && !e.metaKey && this.undoCloseTabsList.options.rightClickToUndoCloseTab ) { if( e.button == 0 && !this.undoCloseTabsList.options.useMenu || e.button == 2 && this.undoCloseTabsList.options.rightClickToUndoCloseTab ) { if(this.undoCloseTabsList.closedTabCount) this.undoCloseTabsList.undoCloseTab(); else this.undoCloseTabsList.drawUndoList() && this.undoCloseTabsList.showMenu(e); } // Allow use "command" section only from hotkey: e.preventDefault(); e.stopPropagation(); } }; if(!this.hasOwnProperty("defaultContextId")) this.defaultContextId = this.getAttribute("context") || "custombuttons-contextpopup"; this.onmousedown = function(e) { if(e.target != this) return; if(this.undoCloseTabsList.options.useMenu) { if(e.button == 0) this.undoCloseTabsList.drawUndoList(); } else if(e.button == 2) { var showCbMenu = e.ctrlKey || e.shiftKey || e.altKey || e.metaKey || !this.undoCloseTabsList.drawUndoList(); this.setAttribute( "context", showCbMenu ? this.defaultContextId : this.undoCloseTabsList.mpId ); } }; this.onmouseover = function(e) { if(e.target != this) return; if(!this.disabled) this.undoCloseTabsList.updUI(); this.undoCloseTabsList.options.useMenu && Array.prototype.some.call( this.parentNode.getElementsByTagName("*"), function(node) { if( node != this && node.namespaceURI == xulns // See https://github.com/Infocatcher/Custom_Buttons/issues/28 //&& node.boxObject //&& node.boxObject instanceof Components.interfaces.nsIMenuBoxObject && "open" in node && node.open && node.getElementsByTagName("menupopup").length && this.undoCloseTabsList.drawUndoList() ) { node.open = false; this.open = true; return true; } return false; }, this ); if( this.undoCloseTabsList.options.openMenuOnMouseover && this.undoCloseTabsList.drawUndoList() ) this.undoCloseTabsList.openMenu(); }; this.undoCloseTabsList = { button: this, options: options, mpId: this.id + "-context", cmId: this.id + "-contextSub", tcmId: this.id + "-tabContextMenu", tipId: this.id + "-tooltip", errPrefix: "[Custom Buttons :: Undo Close Tabs List]: ", get mp() { var btn = this.button; var mp = btn.getElementsByTagName("menupopup"); mp = mp.length && mp[0]; mp && mp.parentNode.removeChild(mp); mp = this.createElement("menupopup", { id: this.mpId, onclick: "this.parentNode.undoCloseTabsList.checkForMiddleClick(event);", onpopupshowing: "if(event.target == this) document.popupNode = this.parentNode;", onpopuphidden: "if(event.target == this) document.popupNode = null;" }); if(this.cm) mp.setAttribute("context", this.cmId); var tb = btn.parentNode; if( this.options.useMenu && tb.getAttribute("orient") == "vertical" ) { // https://addons.mozilla.org/firefox/addon/vertical-toolbar/ var isRight = tb.parentNode.getAttribute("placement") == "right"; mp.setAttribute("position", isRight ? "start_before" : "end_before"); } delete this.mp; return this.mp = btn.appendChild(mp); }, get useCentextMenu() { delete this.useCentextMenu; return this.useCentextMenu = this.options.allowDeleteEntries && ("forgetClosedTab" in this.ss || "forgetClosedWindow" in this.ss); }, get cm() { delete this.cm; if(!this.useCentextMenu) return this.cm = null; var cm = document.getElementById(this.cmId); cm && cm.parentNode.removeChild(cm); cm = this.createElement("menupopup", { id: this.cmId, onpopupshowing: "return this.undoCloseTabsList.canDeleteUndoEntry(this.triggerNode || document.popupNode);" }); var mi = this.createElement("menuitem", { oncommand: "this.parentNode.undoCloseTabsList.deleteUndoEntry(this.parentNode.triggerNode || document.popupNode);", label: _localize("deleteUndoEntry"), closemenu: "single" }); cm.appendChild(mi); cm.undoCloseTabsList = this; return this.cm = document.getElementById("mainPopupSet").appendChild(cm); }, get cbMenu() { var cbPopup = document.getElementById(this.button.defaultContextId); if(!cbPopup) { Components.utils.reportError(this.errPrefix + "cb menu not found"); return this.cbMenu = null; } cbPopup = cbPopup.cloneNode(true); var id = "-" + this.button.id.match(/\d*$/)[0] + "-cloned"; cbPopup.id += id; Array.prototype.slice.call(cbPopup.getElementsByAttribute("id", "*")).forEach(function(node) { node.id += id; }); var menu = this.createElement("menu", { label: _localize("buttonMenu"), accesskey: _localize("buttonMenuAccesskey") }); menu.appendChild(cbPopup); cbPopup.setAttribute( "onpopupshowing", '\ var btn = document.popupNode = this.parentNode.parentNode.parentNode\n\ .undoCloseTabsList.button;\n\ custombutton.setContextMenuVisibility(btn);' ); delete this.cbMenu; return this.cbMenu = menu; }, get ss() { delete this.ss; return this.ss = "nsISessionStore" in Components.interfaces ? ( Components.classes["@mozilla.org/browser/sessionstore;1"] || Components.classes["@mozilla.org/suite/sessionstore;1"] ).getService(Components.interfaces.nsISessionStore) : SessionStore; // Firefox 61+ https://bugzilla.mozilla.org/show_bug.cgi?id=1450559 }, get appInfo() { delete this.appInfo; return this.appInfo = Components.classes["@mozilla.org/xre/app-info;1"] .getService(Components.interfaces.nsIXULAppInfo); }, get appVersion() { delete this.appVersion; return this.appVersion = parseFloat(this.appInfo.version); }, get appName() { delete this.appName; return this.appName = this.appInfo.name; }, init: function() { window.addEventListener("TabClose", this, false); window.addEventListener("SSTabRestoring", this, false); window.addEventListener("unload", this, false); if(this.appName == "SeaMonkey") // No SSTab* events in SeaMonkey window.addEventListener("TabOpen", this, false); setTimeout(function(_this) { _this.mp.addEventListener("DOMMenuItemActive", _this, false); _this.mp.addEventListener("DOMMenuItemInactive", _this, false); _this.initTooltip(); }, 50, this); this.addPbExitObserver(true); this.updUIGlobal(); if(this.options.showInTabContextMenu) setTimeout(function(_this) { _this.initTabContext(); }, 100, this); }, initTabContext: function() { var origMi = this.tabContextUndoClose; if(!origMi) { LOG("Can't find \"Undo Close Tab\" item in tab context menu"); return; } var menu = document.getElementById(this.tcmId); menu && menu.parentNode.removeChild(menu); // For SeaMonkey menu = this.createElement("menu", { id: this.tcmId, label: _localize("tabContextMenu"), accesskey: _localize("tabContextMenuAccesskey"), tooltip: this.tipId, popupsinherittooltip: "true" }); menu.undoCloseTabsList = this; menu.onclick = function(e) { if(e.target != this) return; if(e.button == 1 || e.button == 0 && (e.ctrlKey || e.shiftKey || e.altKey || e.metaKey)) { if(this.undoCloseTabsList.closedTabCount) { this.undoCloseTabsList.undoCloseTab(); closeMenus(this); } } }; var origMp = this.mp; var mp = origMp.cloneNode(true); mp.id = this.button.id + "-tabContext"; var _this = this; function drawUndoList() { var ok = false; var opts = _this.options; var origTemplate = opts.menuTemplate; opts.menuTemplate = opts.menuTemplateTabContext || origTemplate; _this.mp = mp; try { ok = _this.drawUndoList(); } catch(e) { Components.utils.reportError(e); } opts.menuTemplate = origTemplate; _this.mp = origMp; return ok; } function updMenu() { if(drawUndoList()) menu.removeAttribute("disabled"); else menu.setAttribute("disabled", "true"); } mp._updatePopup = function(e) { if(e.target != this) return; document.popupNode = _this.button; drawUndoList(); }; mp.setAttribute("onpopupshowing", "this._updatePopup(event);"); mp.onclick = function(e) { _this.checkForMiddleClick(e, updMenu); }; menu.appendChild(mp); addEventListener("popupshown", function(e) { if(e.target == e.currentTarget) setTimeout(updMenu, 0); // Pseudo async }, false, origMi.parentNode); addEventListener("DOMMenuItemActive", this, false, mp); addEventListener("DOMMenuItemInactive", this, false, mp); origMi.parentNode.insertBefore(menu, origMi.nextSibling); origMi.setAttribute("hidden", "true"); }, initTooltip: function() { var tip = document.getElementById(this.tipId); tip && tip.parentNode.removeChild(tip); tip = this.tip = this.createElement("tooltip", { id: this.tipId, orient: "vertical", onpopupshowing: "return this.undoCloseTabsList.updTooltip(this, document.tooltipNode);", onpopuphiding: "this.cancelUpdateTimer();" }); tip.undoCloseTabsList = this; tip._updateTimer = 0; tip.initUpdateTimer = function(fn, context) { if(this._updateTimer) clearInterval(this._updateTimer); this._updateTimer = setInterval(function() { fn.call(context); }, 1000); }; tip.cancelUpdateTimer = function() { if(this._updateTimer) { clearInterval(this._updateTimer); this._updateTimer = 0; } }; var btn = this.button; btn.removeAttribute("tooltiptext"); btn.setAttribute("tooltip", this.tipId); btn.setAttribute("popupsinherittooltip", "true"); document.getElementById("mainPopupSet").appendChild(tip); if(this.appVersion >= 61 && "getAnonymousElementByAttribute" in document) { var label = document.getAnonymousElementByAttribute(tip, "class", "tooltip-label"); label && label.remove(); } }, _hasPbExitObserver: false, addPbExitObserver: function(add) { if(add == this._hasPbExitObserver || !("Services" in window)) return; this._hasPbExitObserver = add; if(add) Services.obs.addObserver(this, "last-pb-context-exited", false); else Services.obs.removeObserver(this, "last-pb-context-exited"); }, destroy: function() { window.removeEventListener("TabClose", this, false); window.removeEventListener("SSTabRestoring", this, false); window.removeEventListener("unload", this, false); if(this.appName == "SeaMonkey") window.removeEventListener("TabOpen", this, false); this.mp.removeEventListener("DOMMenuItemActive", this, false); this.mp.removeEventListener("DOMMenuItemInactive", this, false); this.addPbExitObserver(false); var menu = document.getElementById(this.tcmId); if(menu) { menu.parentNode.removeChild(menu); this.tabContextUndoClose.removeAttribute("hidden"); } var tip = this.tip; tip && tip.parentNode && tip.parentNode.removeChild(tip); }, handleEvent: function(e) { switch(e.type) { case "TabClose": case "SSTabRestoring": case "TabOpen": setTimeout(function(_this) { _this.updUI(); }, 0, this); break; case "DOMMenuItemActive": case "DOMMenuItemInactive": if(!("XULBrowserWindow" in window)) break; XULBrowserWindow.setOverLink( e.type == "DOMMenuItemActive" ? (e.target.getAttribute("cb_urlDecoded") || "") .replace(/ \n/g, ", ") : "", null ); break; case "unload": this.updUIGlobal(); this.destroy(); } }, observe: function(subject, topic, data) { if(topic == "last-pb-context-exited") { setTimeout(function(_this) { _this.updUI(); }, 25, this); } }, createElement: function(name, attrs) { var node = document.createElementNS(xulns, name); if(attrs) for(var attrName in attrs) if(attrs.hasOwnProperty(attrName)) node.setAttribute(attrName, attrs[attrName]); return node; }, get tabContextUndoClose() { return document.getElementById("context_undoCloseTab") || document.getElementById("tabContextUndoCloseTab") // Firefox 2.0 || document.getAnonymousElementByAttribute(gBrowser, "tbattr", "tabbrowser-undoclosetab"); // SeaMonkey }, get closedWindowCount() { if(!("getClosedWindowCount" in this.ss)) { delete this.closedWindowCount; return this.closedWindowCount = 0; } this.__defineGetter__("closedWindowCount", function() { return this.ss.getClosedWindowCount(); }); return this.closedWindowCount; }, get closedTabCount() { return this.ss.getClosedTabCountForWindow(window); }, undoCloseTab: function(i) { if("undoCloseTab" in window) // Firefox 2.0+ undoCloseTab(i); else // SeaMonkey gBrowser.undoCloseTab(i); }, clearUndoTabsList: function() { var closedTabCount = this.closedTabCount; if(!closedTabCount) return; if("forgetClosedTab" in this.ss) // Gecko 1.9.2+ while(closedTabCount--) this.ss.forgetClosedTab(window, 0); else { // Doesn't work in SeaMonkey const pName = "browser.sessionstore.max_tabs_undo"; let val = cbu.getPrefs(pName); cbu.setPrefs(pName, 0); cbu.setPrefs(pName, val); } this.updUIGlobal(); }, clearUndoWindowsList: function() { var closedWindowCount = this.closedWindowCount; if(!closedWindowCount) return; if("forgetClosedWindow" in this.ss) // Gecko 1.9.2+ while(closedWindowCount--) this.ss.forgetClosedWindow(0); else this.ss.setWindowState(window, '{"windows":[{}],"_closedWindows":[]}', false); this.updUIGlobal(); }, clearAllLists: function() { this.clearUndoTabsList(); this.clearUndoWindowsList(); }, canDeleteUndoEntry: function(mi) { switch(mi.getAttribute("cb_type")) { case "tab": return "forgetClosedTab" in this.ss; case "window": return "forgetClosedWindow" in this.ss; } return false; }, deleteUndoEntry: function(mi) { var i = +mi.getAttribute("cb_index"); if(mi.getAttribute("cb_type") == "window") { this.ss.forgetClosedWindow(i); this.updUIGlobal(); } else { this.ss.forgetClosedTab(window, i); this.updUI(); } this.drawUndoList(); }, showMenu: function(e, isContext, mp) { var btn = this.button; document.popupNode = btn.ownerDocument.popupNode = btn; if(!mp) mp = this.mp; if("openPopupAtScreen" in mp) mp.openPopupAtScreen(e.screenX, e.screenY, isContext); else mp.showPopup(btn, e.screenX, e.screenY, isContext ? "context" : "popup", null, null); }, openMenu: function() { var mp = this.mp; if("openPopup" in mp) mp.openPopup(this.button, "after_start"); else mp.showPopup(this.button, -1, -1, "popup", "bottomleft", "topleft"); }, drawUndoList: function() { var mp = this.mp; var wc = this.closedWindowCount; var tc = this.closedTabCount; var ss = this.ss; var canRestoreLastSession = "restoreLastSession" in ss && ss.canRestoreLastSession if(!wc && !tc && !canRestoreLastSession) { mp.textContent = ""; mp.hidePopup(); return false; } this._undoWindowItems = wc && JSON.parse(ss.getClosedWindowData()); this._undoTabItems = tc && JSON.parse(ss.getClosedTabDataForWindow(window)); var df = document.createDocumentFragment(); this.options.menuTemplate.forEach(function(sid, indx, arr) { switch(sid) { case "closedWindows": wc && this.addUndoWindowsList(df); break; case "restoreClosedWindows": wc > this.options.hideRestoreAllForSingleEntry && df.appendChild(this.createElement("menuitem", { label: _localize("restoreAllWindows"), accesskey: _localize("restoreAllWindowsAccesskey"), oncommand: "for(var i = 0; i < " + this._undoWindowItems.length + "; ++i) undoCloseWindow();" })); break; case "clearClosedWindows": wc && df.appendChild(this.createElement("menuitem", { label: _localize("clearWindowsHistory"), accesskey: _localize("clearWindowsHistoryAccesskey"), oncommand: "this.parentNode.parentNode.undoCloseTabsList.clearUndoWindowsList();" })); break; case "closedTabs": tc && this.addUndoTabsList(df); break; case "restoreClosedTabs": tc > this.options.hideRestoreAllForSingleEntry && df.appendChild(this.createElement("menuitem", { label: _localize("restoreAllTabs"), accesskey: _localize("restoreAllTabsAccesskey"), oncommand: "for(var i = 0; i < " + this._undoTabItems.length + "; ++i) this.parentNode.parentNode.undoCloseTabsList.undoCloseTab();" })); break; case "clearClosedTabs": tc && df.appendChild(this.createElement("menuitem", { label: _localize("clearTabsHistory"), accesskey: _localize("clearTabsHistoryAccesskey"), oncommand: "this.parentNode.parentNode.undoCloseTabsList.clearUndoTabsList();" })); break; case "clearAll": ( wc && tc || wc && arr.indexOf("clearClosedWindows") == -1 || tc && arr.indexOf("clearClosedTabs") == -1 ) && df.appendChild(this.createElement("menuitem", { label: _localize("clearAllHistory"), accesskey: _localize("clearAllHistoryAccesskey"), oncommand: "this.parentNode.parentNode.undoCloseTabsList.clearAllLists();" })); break; case "restoreLastSession": // Gecko 2.0+ canRestoreLastSession && df.appendChild(this.createElement("menuitem", { label: _localize("restoreLastSession"), accesskey: _localize("restoreLastSessionAccesskey"), oncommand: "this.parentNode.parentNode.undoCloseTabsList.ss.restoreLastSession();" })); break; case "buttonMenu": let cbMenu = this.cbMenu; if(cbMenu) df.appendChild(cbMenu); break; case "separator": if(df.hasChildNodes() && df.lastChild.localName != "menuseparator") df.appendChild(document.createElementNS(xulns, "menuseparator")); break; default: Components.utils.reportError(this.errPrefix + 'Invalid template entry: "' + sid + '"'); } }, this); while(df.hasChildNodes() && df.lastChild.localName == "menuseparator") df.removeChild(df.lastChild); this._undoWindowItems = this._undoTabItems = null; mp.textContent = ""; if(!df.hasChildNodes()) { mp.hidePopup(); return false; } mp.appendChild(df); return true; }, addUndoWindowsList: function(undoPopup) { // Based on code from chrome://browser/content/browser.js // Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.3a1pre) Gecko/20090824 Minefield/3.7a1pre var keys = this.options.accesskeys.closedWindows; this._undoWindowItems.forEach(function(undoItem, i) { var tabs = undoItem.tabs; var [key, keyPrefix] = this.getKey(keys, i); var title = undoItem.title; var selectedTab = tabs[undoItem.selected - 1]; var urls = []; tabs.forEach(function(tab) { if(!tab.entries || !tab.entries.length) // Can be [] for about:blank return; var url = this.convertURI(tab.entries[tab.index - 1].url, 120); var selectedPrefix = tab == selectedTab && tabs.length > 1 ? this.options.windowSelectedTabPrefix : ""; urls.push(selectedPrefix + url); }, this); var url = urls.join(" \n"); var mi = this.createElement("menuitem", { label: keyPrefix + this.options.windowItemTemplate .replace("%title", title) .replace("%count", tabs.length), accesskey: key, "class": "menuitem-iconic bookmark-item menuitem-with-favicon", oncommand: "undoCloseWindow(" + i + ");", cb_url: url, cb_urlDecoded: this.convertURI(url), cb_closedAt: undoItem.closedAt || 0, cb_index: i, cb_type: "window" }); if(this.cm) mi.setAttribute("context", this.cmId); var icon = selectedTab.image || selectedTab.attributes && selectedTab.attributes.image; if(icon) mi.setAttribute("image", this.cachedIcon(icon)); if(i == 0) mi.setAttribute("key", "key_undoCloseWindow"); undoPopup.appendChild(mi); }, this); }, addUndoTabsList: function(undoPopup) { // Based on code from chrome://browser/content/browser.js // Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.3a1pre) Gecko/20090824 Minefield/3.7a1pre var keys = this.options.accesskeys.closedTabs; this._undoTabItems.forEach(function(undoItem, i) { var state = undoItem.state; var [key, keyPrefix] = this.getKey(keys, i); var title = undoItem.title; var url = state && state.entries && state.entries[state.index - 1].url || ""; var mi = this.createElement("menuitem", { label: keyPrefix + title, accesskey: key, class: "menuitem-iconic bookmark-item menuitem-with-favicon", oncommand: "this.parentNode.parentNode.undoCloseTabsList.undoCloseTab(" + i + ");", cb_url: url, cb_urlDecoded: this.convertURI(url), cb_closedAt: undoItem.closedAt || 0, cb_index: i, cb_type: "tab" }); if( state && "attributes" in state && "privateTab-isPrivate" in state.attributes ) // https://addons.mozilla.org/addon/private-tab/ mi.setAttribute("privateTab-isPrivate", "true"); if(this.cm) mi.setAttribute("context", this.cmId); var image = undoItem.image // Firefox || state && state.attributes && state.attributes.image // SeaMonkey || state && state.xultab && /(?:^| )image=(\S+)/.test(state.xultab) && decodeURI(RegExp.$1); // Only Firefox 2.0 ? if(image) mi.setAttribute("image", this.cachedIcon(image)); if(i == 0) mi.setAttribute("key", "key_undoCloseTab"); undoPopup.appendChild(mi); }, this); }, getKey: function(keys, i) { var key = keys && keys.charAt(i % keys.length); var keyPrefix = keys && (key + this.options.accesskeySeparator); return [key, keyPrefix]; }, checkForMiddleClick: function(e, upd) { var mi = e.target; if( "doCommand" in mi && e.button == 1 && mi.parentNode == e.currentTarget ) { mi.doCommand(); if(upd) upd(); else this.drawUndoList(); } }, crop: function(s, crop) { if(crop == undefined) crop = 500; if(s.length <= crop) return s; var start = Math.round(crop*0.6); return s.substr(0, start) + "…" + s.substr(start - crop); }, convertURI: function(uri, crop) { if(!uri || uri.indexOf("\n") != -1) return uri; uri = this.losslessDecodeURI(uri); return this.crop(uri, crop); }, losslessDecodeURI: function(uri) { if(uri) try { return this._losslessDecodeURI(uri); } catch(e) { Components.utils.reportError(e); } return uri; }, get _losslessDecodeURI() { var ldu; if("losslessDecodeURI" in window) ldu = losslessDecodeURI; else if("UrlbarInput" in window) // Firefox 75+ ldu = Components.utils.import("resource:///modules/UrlbarInput.jsm", {}).losslessDecodeURI; delete this._losslessDecodeURI; return this._losslessDecodeURI = ldu ? function(uri) { return ldu(makeURI(uri)); } : decodeURI; }, cachedIcon: function(src) { src = src.replace(/[&#]-moz-resolution=\d+,\d+$/, ""); // Firefox 22+ if( !/^https?:/.test(src) // IDN, see https://bugzilla.mozilla.org/show_bug.cgi?id=311045 || /^https?:\/\/[^.:\/]+\.[^a-z0-9-]+(?:\/|$)/.test(src) || this.appName == "SeaMonkey" && this.appVersion <= 2 || this.appName == "Firefox" && this.appVersion <= 3.5 ) return src; return "moz-anno:favicon:" + src; // https://bugzilla.mozilla.org/show_bug.cgi?id=467828 }, updUI: function() { var tabsCount = this.closedTabCount; var dis = !tabsCount && !this.closedWindowCount; if( dis && this.options.useMenu && this.options.menuTemplate.indexOf("restoreLastSession") != -1 && "restoreLastSession" in this.ss && this.ss.canRestoreLastSession ) dis = false; this.button.disabled = dis; }, updTooltip: function(tip, tn) { var template, header, title, url, closedAt; if(tn == this.button) { template = this.options.buttonTipTemplate; header = _localize("restoreTab"); let undoTabItems = JSON.parse(this.ss.getClosedTabDataForWindow(window)); if(undoTabItems.length) { let lastItem = undoTabItems[0]; title = lastItem.title; url = lastItem.state && lastItem.state.entries && lastItem.state.entries[lastItem.state.index - 1].url; closedAt = lastItem.closedAt || 0; } } else if(tn.hasAttribute("cb_index")) { template = this.options.itemTipTemplate; title = tn.getAttribute("label"); url = tn.getAttribute("cb_url"); closedAt = +tn.getAttribute("cb_closedAt"); } else { return false; } var tipData = this.getTooltipData(template, header, title, url, closedAt); tip.textContent = ""; tip.appendChild(tipData); if(closedAt && template.indexOf("closedAt") != -1) { tip.initUpdateTimer(function() { var tipData = this.getTooltipData(template, header, title, url, closedAt); if(tipData.textContent != tip.textContent) { tip.textContent = ""; tip.appendChild(tipData); } }, this); } return tip.hasChildNodes(); }, getTooltipData: function(template, header, title, url, closedAt) { var df = document.createDocumentFragment(); var hasHeader = header && template.indexOf("header") != -1; function item(key, val) { var lbl = document.createElementNS(xulns, "label"); lbl.className = "cb-" + key + " tooltip-label"; lbl.textContent = val; lbl.setAttribute("maxwidth", "450"); // Trick to restore right border for long lines if(key == "closedAt" || hasHeader && key != "header") lbl.style.color = "grayText"; return df.appendChild(lbl); } template.forEach(function(key) { switch(key) { case "header": if(header) item(key, header); break; case "title": if(title && title != url) item(key, title); break; case "url": if(url) item(key, this.convertURI(url)); break; case "closedAt": if(!closedAt) break; let dt = Math.round(Math.max(0, Date.now() - closedAt)/1000); let days = Math.floor(dt/24/3600); dt -= days*24*3600; let d = new Date((dt + new Date(dt).getTimezoneOffset()*60)*1000); let m = d.getMinutes(); let ts = d.getHours() + ":" + (m > 9 ? m : "0" + m); if(days) ts = days + _localize("day") + " " + ts; let tsTip = _localize("itemTip") .replace("%ago", ts) .replace("%date", new Date(closedAt).toLocaleString()); item(key, tsTip); } }, this); return df; }, get wm() { delete this.wm; return this.wm = Components.classes["@mozilla.org/appshell/window-mediator;1"] .getService(Components.interfaces.nsIWindowMediator); }, updUIGlobal: function() { var isSeaMonkey = this.appName == "SeaMonkey"; var ws = this.wm.getEnumerator(isSeaMonkey ? null : "navigator:browser"); const id = this.button.id; while(ws.hasMoreElements()) { let win = ws.getNext(); if(isSeaMonkey && !this.isBrowserWindow(win)) continue; let btn = win.document.getElementById(id); if(btn && "undoCloseTabsList" in btn) { let ucl = btn.undoCloseTabsList; ucl.ensureSessionsInitialized(ucl.updUI, ucl); } } }, isBrowserWindow: function(win) { var loc = window.location.href; return loc == "chrome://browser/content/browser.xul" || loc == "chrome://navigator/content/navigator.xul"; }, ensureSessionsInitialized: function(callback, context) { var _this = this; var stopTime = Date.now() + 3e3; (function ensureInitialized() { try { _this.ss.getClosedTabCountForWindow(window); callback.call(context); return; } catch(e) { if(Date.now() > stopTime) { Components.utils.reportError( _this.errPrefix + "Can't initialize: nsISessionStore.getClosedTabCountForWindow() failed" ); Components.utils.reportError(e); return; } } setTimeout(ensureInitialized, 50); })(); } }; if(!this.undoCloseTabsList.options.useMenu && this.undoCloseTabsList.useCentextMenu) { this.oncontextmenu = function(e) { if( e.target != this || e.ctrlKey || e.shiftKey || e.altKey || e.metaKey || !this.undoCloseTabsList.mp.hasChildNodes() ) return; e.preventDefault(); this.undoCloseTabsList.showMenu(e); // Show menu without "context" flag }; } if(this.undoCloseTabsList.options.rightClickToUndoCloseTab) { this.oncontextmenu = function(e) { if(e.target == this && !e.ctrlKey && !e.shiftKey && !e.altKey && !e.metaKey) e.preventDefault(); }; } this.disabled = true; setTimeout(function(_this) { _this.undoCloseTabsList.init(); }, 0, this); //=================== // Styles // Used icons from Undo Closed Tabs Button extension // Styles can't override hardcoded icon if( // Remove icon only if nsIStyleSheetService works on-the-fly (Firefox 3.0+) !Components.ID("{41d979dc-ea03-4235-86ff-1e3c090c5630}") .equals(Components.interfaces.nsIStyleSheetService) ) { let icon = this.icon || this.ownerDocument.getAnonymousElementByAttribute(this, "class", "toolbarbutton-icon"); if(icon) icon.removeAttribute("src"); else this.image = ""; } var cssStr = '\ @namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");\n\ @-moz-document url("%windowURL%") {\n\ %button% {\n\ list-style-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAEEUlEQVRIS9XVbWxTVRgA4Pfce3tv27t2bbNuXbfCBuyzAZ2MEdkkLH5gJvEH8TOZEo0JFdgmbgjTgEHUGQXGMJEMmDJMiNvQjS9BJhH8MY3IfsB0rnTraCcbm13b2+/1fni2xAVuxOHAH57+adNz3uee9z3vuQj+44FmG79VksglAIoMgBhCSLpdnFkBkiQxl2OQgRdbJhjoKkQofM+ALklSGSNwf1iAjbXNZ3MdI+MB+7vPF989IEnoZwBVQhCWBgVhW13b+WX5KXpFR7fDe/ntZ8wYiONUiXLojlKEU4LGANgRDpZHBH7r9iPnilZaM4jKFTlQ/P5XvHV+6o5si7HzuWUL+hzngSstRfxf0DSwa9cHa3GgWgmQTv4UNMMggyWTMuYtYepOXCKfKMiGZ4tyQEMDjPrDcGVoDI780As3/AGhJIVs2vTk6pqkJAhOFn8KaG1tpV1u53h5+RpGr7s1/uTxCIgk6g/EiaqmM2i5NRseL7SCgwMg8Wo9A5CsBLjPADDki8CbbRdgQiI631n/2NOFANwUUF9frxPECVf1628gn893Sx55IIhxBavcffIi1fO7H15atRJiAoD8XBI4UmYCwOIkCdY3fyuyrGrHZ+UldXJAwoDn5hThQESYpNXXQpJuw4HTiuzM+fBAfu7UFIQ/0wN/nfydrEKwSCdARfMZftVSa6kcEPx+v0NeA7wlKowYXX+AT604+DWTmT4XcufhFsN6r9MJ/gAHiVotpBmNoNNoIctAw8Xf7FKMjx2TA7zX6/3p7860SBCKEGJSBrj4PIyozMkm0KhZsDv7hTUP5Xt+HfFpuvqGVBZTKizEuOePEYiL0V/kQJzjuG9u1zS8RDAhRFv6/FFr5YFTaopicJGRt932yDmJQLQ3JpY9+lEHVZCTB6PecTAmEMNyIIZr8MU/3U8iSSo5RGfZPZGFFftPaU0a9dgxW+mXBEGQtJJ5xbq1hUo3mdENzxjYyoq65UAUA5/MdAGKiFQHSGbB1WEPDZGIq3COYRQD1I/XPJttn39PKRlWYpUgfvraU2/JgXAwGHxvRkAUEd6JAteYJAUhioNLwaigLN1z8sNQLA5mQyK//YWHr8zRaV9EjY2NikDAuwkQ2oL7IIRH9UzATf9PPuBUS4gIKY92u/Zf5zhixaKsAa1BXzOhhrNoz96d21JNaavT0tO9xQ+W5GDg5X8BTE/lCSIBUcqW3kGX3XW1Jz7sdtVXrn31EGpo2Nm0bl1VHt7maTw7Eo1GL8wGwPcOiRSKMpIgUpzOAd2JjqOdNTW1B1HDx7ttlRs2mnCDHZ5NYPkalmXnut3uxe3tbZeqqzd/h/bt21tgs1WocYP13AtAr9cnDg4Omo8fb7leVbXFdUfvg7uB///An8idyhRIYoVPAAAAAElFTkSuQmCC") !important;\n\ }\n\ %button%:hover {\n\ list-style-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAECUlEQVRIS9XVe2xTVRgA8O/ce3tv310fa8P6AOoapwznYtXFzchQJNEYNTHEODSaYLK4jsEaGcQnEpAQu8r+WLJMMmOMIQXnNgeKYTJjfBGzMEGTztVubcGmD9q1t+263t7r2Qxka8DhwD88//SP2/P97vd95zsXwX+80ErjC4JAjE4BvWEN5BFCwvXirAjAwWkfgIVjwczK4Sc7QtlbBpwRBLG+ADVcDnbu+fjUHZMX4+mJA00NNw8IAvoZQKIEsLOp4pv7PaMP2jRKanjclzi/99kKDBSuVaobKhEuCYoCyKIZaMjOcW+89clIXe1qA9H80Hp4uqu/UGszvlNl1J/eVF/pjY9CurERcVcyugq4XAdf5gXowP2SL00XAUkzSGteSxuq7LIDw2Miu9UET9y7DhgSwHcpAhN/RuHrC34QeJ57wED17nryqQ6dDtj5jBYAj8dDB4L+WNNzz0uUStWS+PPHI4so5EtzRNuRL9Hday1QX22D6RkOSLxbShGgZAgwKSiYjsTgo2/GQCGTfbXP8egWO0BqAXC73WVFfi7gbN+Fkskkv1jggCAui2Ri1/BZ6pfpGGy+7x7IFnjA2f69rvziSDopBUY5Cd1ffMtXmfX7+rY2vFsKCBiILwbwfiJL0tIpVihz9J4UlWvL4TaTaWnwRZaMJkFOzMFnP5zjmhprG0uB4szMzGTpkcMImQFG7csUV7X2nmA0ZRow6w2Amw/BSARmZ3MgFotBi8srk0iAERHweygkVBoUg6UAl0gkzl7rTPMEIcogxuBPcVbHByckKrkKJIwYwtFw8cUN1bFfLyaU33uDEp1KDQatDkLRCNy+SnGhFCikUqlT1xsaTiCYDKLNE+n8ndt7Tkp5QKhcKkoMtTwyUgREx7LcY5tdg5TNtBoSbBos5ZJLpUAe9+DoP91PHEmKWUTbJpP59Y7uIYVBKY0NNm/8lCAIkqBE22re9lB6rR7FUwl45fH7x0qBWQx0L3cB8oiUpkmm0h9JiIRsNlBrUkcxQI14w7udx34kxIwE9wLxfW3P7CkFsizL7l8W4HnEk6RovvlksTiLgwvJXEG6sXP4YJ4rQoVGxe3d+vC41ax8AfX09IhS7OXXEBDteA4yeDmXAxY9n3/BhUnApvjoOX9vPJODhnXWKbVWsyMlhdOo8/1Dr1tMa7YYjRWpurp6KwZe+hfA1b/iAyAHmvZ4g0Ff0PtbLhzwH25pbulDne5DPa2OnXfhNAeLON1CofDdSgB875Akw2zCKZn8f0xKhz4fGH21veMIch9+b9uO7U4LHrAPVxK4dI9MJrMGAoHqgYHj405nxxnU1eWqaW1tV+ABO38rALVaXRYK+Q39/Z5wW9vuwA19D24G/v8DfwHJNM8naEZRUgAAAABJRU5ErkJggg==") !important;\n\ }\n\ %button%[disabled="true"] {\n\ list-style-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAADCklEQVRIS9WVz0sbQRTHZ3Y32awxYkOIMaQQjBJ026zVVLCeCpX2H2jpqaceSjGnUpBcKj0IpVA81UtLT4VCoYdepJcapBYKGjfNbwNqTGJsbGKi5pdmd/s2tEVCjBrroQMLw8x77/Pem+/MYnTOA59zfHQmwPj4+AWCIG5OTk6+OyrRpgFOp7MTgn6pVCpdLS0t9MTExH49SFMACNaFMZ7v6enRRSKRiiRJnbCWbQgAI8LjWbyBMaFtdC7r67GLwWD4CQRnLBYL4XK5yoIgbKpUqkB7e9u3oSHrlMViz/2J8bcCnl/8TJCUmVJQW0cB0ls/W91u3gqDNBqNVTNoEcrlcmhnZwdtJDdEiqSEUql0zeFwLMj7VYDf728t7xdTV/oHFeBQrAdIJpPkzMwMA5ljnU5XNwfoAgI7tLKyUhJF0T42NuavApaWltolJEQBQGWz2Xw971gsRvM8r+nr68NKpbKhulOplBSNRldBYWwtgNze3o4d5b28vKxdW1vTQRWEQqFoCIEqCtC26VoAARV4GnkCxJRIJExms5mEgeLxuJDP5wmKokSNRkNotVosw/f29hDYLdQCMABcx91ukKYV2mAxGAykDBgZGflUKBQYCHoVMlebTCYMypLh8VoA2t3d/XAcQN4Ph8P2TCbTC1NxeHj4rbwGFYzOuma1jIphoCKUTqdjtQAJAK9PApBtoF3Xi8WimeO4N78Bt+fm5vRqtZqGivIHBwePawEiaPr5SQFVncPNBHmK8hza4giFQx0KSlGB4D/0en13LUAAgPM0gMO2cKhTcA40yNMN79Moy7IZ7PV6OyrC/iuMkZ2zDSgB8KBZADwXz4KhgIAkKQECe2SzDS5ij8c9beg03tK0tpUZhtHANb93BsAU+KvyhXwlHl+f7+cG7uPvPv7FZZazQv9eQi+Fcrm82SyApmk9nIkK/B8GAr6vNlv/U+wL+O6yvawR1PC+2cCH/QBAwlNyJxTyhViW+4gjEa+lu/sSA0ar/wIgCwu+rmAwmIN3K9rUD+c0ifz/gF/LJ4uAUJQHTwAAAABJRU5ErkJggg==") !important;\n\ }\n\ toolbar[iconsize="small"] %button% {\n\ list-style-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAACPElEQVQ4T2NkIBL8//+fEQj+oytnJEY/UDPXzPOPTdINZQ+jG0LQgPvv/wvsvf9k54FzN432X39S9rQ3oR/ZUrgBvb29akxMf7mQJcWVNYTeCWvOfvrijVK9nymDRevqKwqsfxdYiLDNqUgP+whSCzZg4sS+dkYmxlx2NrYfMAM4efiYXonr8Z27/4q52NeGQZiLlYGd4Q/D9iuPGDafu/3/zZevvocrwraCDZgwoWd/QECwtbi4xD8QHxRS178xsPq2LmfKC/FlEBAUYfgDFORlZWCQ52FgUOP5zVCz9sjfiw/eKMENCAwMMeXl5XsMc8FPJhbOjv235A5fe8zoZWvLwMTIxPD45UsGPm5uBiVxQQZN7u8MnVtPXUN2gbGAgOAJpDBg/MrIKtCy/bLRsVtPmXi4uBj+/fn2+9vPvyycHJyMLgZaDAcvXPoFN8A/IMhIUEBoLUoIA+Ps4382qfotZ112nL3JVOyieyjdQYfXuGWtgbCgCOOnzx//IrvAgJ9fYDKWdMH4mYlduX/HOa0AHamD3Jyc5v5TtptzsrMzeBmrXWKcNGkS399/Pw8GBoTIA71QgSNhwaL7/9zjdzN6d10wdDdR/5XrbWbNOHvOjA18fHwmTo6ubECQQChlcnBzR5y9/yT4wcVTb1+/fW7DuGjR3EXR0QlfgMn16N+/fy8TMoCJiUkCiK0PHNqvduXSuTrGNWtWugcHh737+PHjHUKaYfL8/Pyip04dV7tw4dBhgnmBkKEUGwAAgK/XtUYSNDQAAAAASUVORK5CYII=") !important;\n\ }\n\ toolbar[iconsize="small"] %button%:hover {\n\ list-style-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAACRElEQVQ4T2NkIBr8Z2RgYPyPrhwoSBj8//+fbfXt11phqqIXGRhRDSFoAFAzz8KLzzdvP3nZ+titFwWPe+OnIVsJN6BnSo88ww8GTmRJBRUV/jeSuvOOXL6nVeJuxBA3Z+cZWfY/M0x1BZc3+Pp+A6kFGzBxYm8T0GnFrKwsP2AGsHPyMH2RNebdfukxc6KLOYMAFzvDq3fvGC49fMFw+dGL/z9+/nQ7UBm+B2zAhIk9+3x9A2ylJKX/gfigkLr9jZHVt305Y4i9JQMbJy/Dn3//GbhZmRiEuVgYWP9+ZVh19MLfHz9/y0MMmNCz39cvwEJQQOgBzAU/mdg4m3dflTty7TGjkYYm2KmvP3xg4OLgYBDm42H48/09w/UnLy8hG2AuLCRyFCkMGL8ysAo0brtoeOzmEyZ2NjYGFsY/v7///sfCzMTCKCEiyvDo+dNfcAP8/AJNhYSEV6GEMCMj0BA2yaqNZ1x3nr/FlO+kfSTbSY/bqHmtAQ8PH+OPH9/+ohggKCjUhyVVMH5hYlfs3XFeO1BH8hAHB4d50NTt5pzs7AyuhioXGWfO7OD/9p35EDAQFcVExYuxJat///6BLWJiYvo/59jtjN5dF418zDV/ZbpZWDDOnTtzI7+AoLGDvSM3KytbFKF0ycHNHXnx/tPgW+dPvnn99qk948LF8+bFRMV/Aqa4Y9+/f79G0AAODjGgUywOHdivefHipUbGVetWOYUGhr778OEDPAoJGSIgICB87Ngh5bNnL54gmBcIGUaxAQAqY9puYCzN/wAAAABJRU5ErkJggg==") !important;\n\ }\n\ toolbar[iconsize="small"] %button%[disabled="true"] {\n\ list-style-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAB70lEQVQ4T2NkoBAwEqu/vLzcjpOT81pDQ8MbZD1EGVBZWZn579+/qUxMTBXt7e1dGAbcv3+f4/2n9z6M//7zoLvo7NlzXh8+fPQTFxdnfwEEvPy8R+RlpWd4evruBakFu+DCpfNLONg4/NjZ2X4jG3D16jWup0+fsRsZGTGysLAwvH79muH9+/cMQHMY2NjY8jMzMyfBDNivrKhs+f8/wy+YAb9+/WJcs2YNj66uLgMvLy+Kw75//85w6dKl74yMjNZwAxQVlEz//f13D1nlgwcPBG/evCmloqLCBFQMth1oMwMfHx/Dx48f/z99+vQssgHGDP8ZjqCHwd27d+UfP36szs7ODvLGO2BAcgNdwCEhIcH46NGjt8gGGP3/938VtmgFBrIB0N8mcnJyB1VVVbkOHjxgzMnJxfT169cnCAPklQyApk/AlS6ePXumJSQk9ACoxuHKlStmQPonUG0e4+XLl8X//v29V0lJWQoYKaWEEtaXL1/SgX43AQbJWhMT01DGq9ev7ODm4tKWEJdi+/PnTxwhA4CpMfz161e+79+/e/f7919Pxtu3b85RUlJ5+////8PAwLlPyAAODg5BoPONXr16YfDmzbtWxseP79vLyCgAY+j9Q0KaYfJAVwgCA1DpzZs3p4nKC/gMptgAAO1G2FJifkXnAAAAAElFTkSuQmCC") !important;\n\ }\n\ }' .replace(/%windowURL%/g, window.location.href) .replace(/%button%/g, "#" + this.id); var cssURI = this.cssURI = Components.classes["@mozilla.org/network/io-service;1"] .getService(Components.interfaces.nsIIOService) .newURI("data:text/css," + encodeURIComponent(cssStr), null, null); var sss = this.sss = Components.classes["@mozilla.org/content/style-sheet-service;1"] .getService(Components.interfaces.nsIStyleSheetService); if(!sss.sheetRegistered(cssURI, sss.USER_SHEET)) sss.loadAndRegisterSheet(cssURI, sss.USER_SHEET); this.onDestroy = function(reason) { this.undoCloseTabsList.destroy(); if(reason == "destructor") // May happens before "unload" this.undoCloseTabsList.updUIGlobal(); if(reason == "update" || reason == "delete") { let sss = this.sss; let cssURI = this.cssURI; if(sss.sheetRegistered(cssURI, sss.USER_SHEET)) sss.unregisterSheet(cssURI, sss.USER_SHEET); } }; if(this.undoCloseTabsList.options.useMenu) { this.type = "menu"; this.orient = "horizontal"; } |
kokoss > 31-03-2024 20:36:36 |
Alex_one пишет
Этот способ не всегда срабатывает, а способ с удалением папки startupCache всегда! |
Alex_one > 01-04-2024 12:21:11 |
ifln пишет
Да, Ваша версия завелась kokoss пишет
Понял, буду знать. Ребят, всем большое спасибо за помощь! |