Created
September 13, 2015 18:06
-
-
Save myrdd/0378963d425c220035e3 to your computer and use it in GitHub Desktop.
This file contains 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
/** | |
* This function will be called before an add-on wraps | |
* a `gBrowser` function. A reference to the original | |
* function will be saved in `gBrowser.originalFunctions`. | |
*/ | |
function beforeWrap(gBrowser, fnName) { | |
// Ensure that `gBrowser.originalFunctions` exists. | |
if (!gBrowser.hasOwnProperty("originalFunctions")) { | |
gBrowser.originalFunctions = {}; | |
} | |
// Remember the original function, but do not overwrite an | |
// already existing reference. | |
if (!gBrowser.originalFunctions.hasOwnProperty(fnName)) { | |
gBrowser.originalFunctions[fnName] = gBrowser[fnName]; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment