Skip to content

Instantly share code, notes, and snippets.

@autonome
Created May 10, 2011 16:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save autonome/964812 to your computer and use it in GitHub Desktop.
Save autonome/964812 to your computer and use it in GitHub Desktop.
jetpack btoa
const { Cc, Ci } = require("chrome");
function base64encode(str) {
var wm = Cc["@mozilla.org/appshell/window-mediator;1"].
getService(Ci.nsIWindowMediator);
return wm.getMostRecentWindow("navigator:browser").btoa(str);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment