Created
November 8, 2018 22:26
-
-
Save brendandahl/f3be854af7af882e605ea6673ea6b0ce to your computer and use it in GitHub Desktop.
chrome url to file path
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 toFile(url) { var chromeRegistry = Cc["@mozilla.org/chrome/chrome-registry;1"].getService(Ci.nsIChromeRegistry); return chromeRegistry.convertChromeURL(Services.io.newURI(url)).QueryInterface(Ci.nsIFileURL).file.path; } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment