Created
January 4, 2015 13:46
-
-
Save codefisher/085232320f85c47a560e 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
function createResource(resourceName, uriPath) { | |
let resource = Services.io.getProtocolHandler("resource").QueryInterface(Ci.nsIResProtocolHandler); | |
var fileuri = Services.io.newURI(uriPath, null, null); | |
resource.setSubstitution(resourceName, fileuri); | |
} | |
// in startup() | |
createResource('toolbar-buttons', 'chrome://toolbar-buttons/content/resources/'); | |
// in shutdown() | |
let resource = Services.io.getProtocolHandler("resource").QueryInterface(Ci.nsIResProtocolHandler); | |
resource.setSubstitution("toolbar-buttons", null); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment