Skip to content

Commit

Permalink
Beautify data URI of frame script
Browse files Browse the repository at this point in the history
  • Loading branch information
Infocatcher committed Jul 28, 2015
1 parent 06f61de commit 8f5f1cb
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions bootstrap.js
Original file line number Diff line number Diff line change
Expand Up @@ -3389,14 +3389,13 @@ var privateTab = {
//~ todo: find way to use only one frame script
// Also there is no way to unload frame script: https://bugzilla.mozilla.org/show_bug.cgi?id=1051238
_log("toggleTabPrivate(): getTabPrivacyContext() failed, will use frame script");
var data = '\
var data = this.trimMultilineString('\
var isPrivate = ' + isPrivate + ';\n\
var privacyContext = docShell.QueryInterface(Components.interfaces.nsILoadContext);\n\
if(isPrivate === undefined)\n\
isPrivate = !privacyContext.usePrivateBrowsing;\n\
privacyContext.usePrivateBrowsing = isPrivate;\n\
sendAsyncMessage("PrivateTab:PrivateChanged", { isPrivate: isPrivate });\n\
';
sendAsyncMessage("PrivateTab:PrivateChanged", { isPrivate: isPrivate });');
var feedback = function(msg) {
mm.removeMessageListener("PrivateTab:PrivateChanged", feedback);
var isPrivate = msg.data.isPrivate;
Expand Down

0 comments on commit 8f5f1cb

Please sign in to comment.