Find: ^.*?console\.(warn|info|log|error|exception).*?$
Replace with: ``
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var me = Services.wm.getMostRecentWindow(null); | |
| var tokenDB = Cc['@mozilla.org/security/pk11tokendb;1'].getService(Ci.nsIPK11TokenDB); | |
| var master_password = tokenDB.getInternalKeyToken(); | |
| var master_password_authenticated; | |
| try { | |
| master_password_authenticated = Components.isSuccessCode(token.login(false)); //login argument is false meaning that if the user had previously entered their master password it will not prompt them now AND if they had not entered it before and it is still valid for the session it will NOT prompt. IF you set it to true then regardless if the user entered it in before or not it will force them to enter it again | |
| } catch (ex) { | |
| master_password_authenticated = false; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function _getEditableNode(aNode) { | |
| while (aNode) { | |
| if (aNode instanceof Ci.nsIDOMNSEditableElement) | |
| return aNode.editor ? aNode : null; | |
| aNode = aNode.parentNode; | |
| } | |
| return null; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var DOMWin = win.QueryInterface(Ci.nsIInterfaceRequestor) | |
| .getInterface(Ci.nsIWebNavigation) | |
| .QueryInterface(Ci.nsIDocShellTreeItem) | |
| .rootTreeItem | |
| .QueryInterface(Ci.nsIInterfaceRequestor) | |
| .getInterface(Ci.nsIDOMWindow); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /*run this first*/ | |
| var win = Services.wm.getMostRecentWindow('navigator:browser'); | |
| var panel = win.document.createElement('panel'); | |
| var screen = Services.appShell.hiddenDOMWindow.screen; | |
| var props = { | |
| noautohide: true, | |
| noautofocus: false, | |
| level: 'top', | |
| style: 'padding:15px; margin:0; width:' + screen.width + 'px; height:' + screen.height + 'px; background-color:steelblue;' | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function example() { | |
| var hotkeyLabelJson = | |
| ['ul', {class: 'apple cf',id:'apple-qwerty'}, | |
| ['li', {class:'apple'}, | |
| ['a',{class:'nthotkey-apple-key apple-key'}, | |
| [span, {}, | |
| 1 | |
| ] | |
| ] | |
| ], |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function findAddonMgr() { | |
| //future: i plan to allow argument to this function so it searches just the CURRENT firefox window for addon manager, but for right now its global | |
| //searches for addon manager tab in ALL FIREFOX WINDOWS and when found it returns the an object holding browser window (domWindow) and contentWindow (the window is the equivlent of gBrowser.contentWindow from scratchpad) | |
| var windows = wm.getEnumerator('navigator:browser'); //gets all windows with gBrowser | |
| while (windows.hasMoreElements()) { | |
| var domWindow = windows.getNext(); | |
| if (domWindow.gBrowser) { | |
| if (domWindow.gBrowser.tabContainer) { | |
| var browsers = domWindow.gBrowser.tabContainer.tabbrowser.browsers; //each tab is a browser | |
| for (var i=0; i<browsers.length; i++) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const {classes: Cc, Constructor: CC, interfaces: Ci, utils: Cu, results: Cr, manager: Cm} = Components; |