User:Dickvl/Private Browsing disable: Difference between revisions
(→Extension code for pbdisable: (compatibility update)) |
(→Extension code for pbdisable: updated extension code to 1.5) |
||
Line 30: | Line 30: | ||
==Extension code for pbdisable== | ==Extension code for pbdisable== | ||
Copy and paste the full DATA code in the location bar and press the Enter key. Save the file as '''pbdisable-1. | Copy and paste the full DATA code in the location bar and press the Enter key. Save the file as '''pbdisable-1.5-fx.xpi''' (updated Jul 24, 2011)<br> | ||
You can install the extension via "File > Open File" or by dragging the file in a Firefox window.<br> | You can install the extension via "File > Open File" or by dragging the file in a Firefox window.<br> | ||
You can move the extensions folder (pbdisable@mozillazine.org) from the extensions folder in the [[Profile_folder_-_Firefox|Profile Folder]] to the ''%AppData%\Mozilla\extensions\{ec8030f7-c20a-464f-9b0e-13a3a9e97384}'' folder or to the '''extensions''' folder in the Firefox program folder to make the extension work in all Firefox profiles. If you do that then you can't uninstall, but you can disable the extension. You can also drop the XPI file in that folder and the extension will be installed on the next start of Firefox [https://developer.mozilla.org/en/Installing_extensions].<br><!-- http://ehsanakhgari.org/blog/2008-11-08/prepare-your-add-private-browsing --> | You can move the extensions folder (pbdisable@mozillazine.org) from the extensions folder in the [[Profile_folder_-_Firefox|Profile Folder]] to the ''%AppData%\Mozilla\extensions\{ec8030f7-c20a-464f-9b0e-13a3a9e97384}'' folder or to the '''extensions''' folder in the Firefox program folder to make the extension work in all Firefox profiles. If you do that then you can't uninstall, but you can disable the extension. You can also drop the XPI file in that folder and the extension will be installed on the next start of Firefox. You may have to rename the extension to '''pbdisable@mozillazine.org.xpi''' to make that work [https://developer.mozilla.org/en/Installing_extensions].<br><!-- http://ehsanakhgari.org/blog/2008-11-08/prepare-your-add-private-browsing --> | ||
<pre>data:application/octet-stream;base64, | <pre>data:application/octet-stream;base64, | ||
UEsDBBQAAAAIAHuYPzw3xI8ySQAAAHwAAAAPABUAY2hyb21lLm1hbmlmZXN0VVQJAAMJxmVLCcZl | UEsDBBQAAAAIAHuYPzw3xI8ySQAAAHwAAA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 | ||
ZW50L1VUCQADx8VlS8fFZUtVeAQA6ANkAFBLAwQUAAAACAAnbPg+EPYaNuYDAACYCQAAHAAcAGNo | |||
cm9tZS9jb250ZW50L3BiZGlzYWJsZS54dWxVVAkAA/ | cm9tZS9jb250ZW50L3BiZGlzYWJsZS54dWxVVAkAA/oCLE76AixOdXgLAAEE6QMAAARkAAAAlVbf | ||
/ | c9s2DH627/w/sHroyXe21L468dIk82259dYszp5yuRwtwTZritRIyo7T+n8fQEqe7NZNpwf9AAng | ||
Az4A4vnFcyHZGowVWo2j98m76OKXXrfXPdcolHzLRD6OylkuLJ9JGNbSiKGasuNo6Vw5StPNZpMU | |||
+kVIyRNtFukKtgW3Dky64A5WACW+uiUYSIRNtJLb5LmSUfBkMyNKx9y2hHHk4Nmln/maByltOX/z | |||
cP3r5f3lQ6+bpswthWVzIYHhs+TGMT1HIbDbK1ajZGgDFEXEhijLVmv5YTVrAL4IBQSSfN8asUaA | |||
V0ZvrFCLjwIxKzBJabTTBIiN2Zdet/MklHCQj9icSwsDkmg7YqqSchCWjyz9txOXSZmhpFKZQ1Bx | |||
n0x2xJzFFExSG+8zA64y6owW2wuIwZkKWnJtUXati1IrUM4mmeTWgn2IPrRJ0DMLBvka0kNkcPY+ | |||
eiQbnWQBbhpkccuKUEjYnGdgE2VvPtXa9cb+gfuE53mzwQcxYFEZMjCc1SkYZlxlIIdr7SAahHy8 | |||
buWfSrghL0spMk7JamsyvDZC5XpDmpM1om4YiyOpeY6bg5mWym5A9yVXuQSv0iIC+sQumbUb4bIl | |||
iyEh1vdixjJugQXjI588C+5eFKArF7cY9VWClzPb5rWz5oaVs5+iqs5dk7o9Uz9L1lH1HXDWoVKL | |||
EUjCK6enDlsGa+rrV8KWIBp3jclZQH61RfMF5ukjNkizXh4anijqr3wfbqdzehPG7WloQHRk011c | |||
gnHxD8w3Krvw3CELyA7S9WW36wzYu7CBVnehw+pSbzeZrWafIXNYEboU2YDl3PEat+88krLx+JW6 | |||
bSKtrSV/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lDHxl7bv0/R+lWjgciwn8mDFqcUtiJx7IUS7de | |||
MhBUMdOiKf3Et3Q0D43jyTXek84DS3zes/zR9Jvib1BLAQIXAxQAAAAIAHuYPzw3xI8ySQAAAHwA | |||
AAAPAA0AAAAAAAEAAADtgQAAAABjaHJvbWUubWFuaWZlc3RVVAUAAwnGZUtVeAAAUEsBAh4DFAAA | |||
AAgAm1n4PtB1kGZ5AQAA/QIAAAsAGAAAAAAAAQAAAO2BiwAAAGluc3RhbGwucmRmVVQFAAMV4itO | |||
dXgLAAEE6QMAAARkAAAAUEsBAhcDCgAAAAAADaV2OwAAAAAAAAAAAAAAAAcADQAAAAAAAAAQAO1B | |||
SQIAAGNocm9tZS9VVAUAA6mTCUtVeAAAUEsBAhcDCgAAAAAAWJg/PAAAAAAAAAAAAAAAAA8ADQAA | |||
AAAAAAAQAO1BgwIAAGNocm9tZS9jb250ZW50L1VUBQADx8VlS1V4AABQSwECHgMUAAAACAAnbPg+ | |||
EPYaNuYDAACYCQAAHAAYAAAAAAABAAAA7YHFAgAAY2hyb21lL2NvbnRlbnQvcGJkaXNhYmxlLnh1 | |||
bFVUBQAD+gIsTnV4CwABBOkDAAAEZAAAAFBLAQIeAxQAAAAIAIRZ+D4KBi4CdwEAAOwCAAAcABgA | |||
AAAAAAEAAADtgQEHAABjaHJvbWUvY29udGVudC9wYmRpc2FibGUuY3NzVVQFAAPn4StOdXgLAAEE | |||
6QMAAARkAAAAUEsFBgAAAAAGAAYA6wEAAM4IAAAAAA== | |||
</pre> | </pre> | ||
Revision as of 12:57, 24 July 2011
Here is a simple extension to disable the "Tools -> Start Private Browsing" menu entry and the "Tools > Clear Recent History" menu entry in Firefox 3.5/6.
The extension hides these menu entries and also disables their shortcut keys and should prevent Firefox from entering Private Browsing mode. The CSS code (chrome://pbdisable/content/pbdisable.css) in the extension also hides "Tools -> Options -> Privacy -> Automatically start Firefox in a private browsing session" and the History setting. You can copy that code to userChrome.css if you want these entries hidden if the extension is disabled. Current Firefox versions still process code in userChrome.css if started in Safe_mode. Keep in mind that removing or disabling "Private Browsing" will not make it impossible to delete private data like visited websites (history) or cache. It is possible to clear the cache via "Tools -> Options -> Advanced -> Network" and to clear history in the Library and History sidebar. See also [1]
Private Browsing toggle test
You can copy and paste this code in the "Tools > Error Console" to test if it is possible to toggle Private Browsing mode before and after you have installed the extension. It should not be possible, but what Firefox shows can be deceiving as it looks a bit buggy to me. You can check if new history is still kept.
var pbs = Components.classes["@mozilla.org/privatebrowsing;1"].getService(Components.interfaces.nsIPrivateBrowsingService); var oldPM = pbs.privateBrowsingEnabled; var newPM; pbs.privateBrowsingEnabled = !pbs.privateBrowsingEnabled; void(alert('PB is '+((newPM=pbs.privateBrowsingEnabled)?'on':'off')+((oldPM==newPM)?' (failed)':'')));
Lock prefs with mozilla.cfg
You can lock some history prefs and reset pref browser.privatebrowsing.autostart to false with this version of the file mozilla.cfg.
Copy and paste the full DATA code in the location bar and press the Enter key. Save the file as mozilla.cfg (updated Feb 23, 2010) and copy the file to the Firefox program folder.
data:application/octet-stream;base64, PDwaF31/cnM1L29/fISAcn87fX92g26Bcm9/fISAdnt0O26CgXyAgW5/gS85LXNueYByNkgaF3l8 cHhdf3JzNS9vf3yEgHJ/O3V2gIF8f4ZscoV9dn9ybHFuhoAvOS0+RT02SBoXeXxweF1/cnM1L29/ fISAcn87dXaAgXx/hmxyhX12f3JscW6GgGx6dnsvLTlGPTZIGhd5fHB4XX9yczUvfXlucHKAO3V2 gIF8f4Y7cntub3lycS85LYF/gnI2SBoXeXxweF1/cnM1L31/doNucIY7cHlybn9ce2B1goFxfIR7 O3V2gIF8f4YvOS1zbnmAcjZIGhd5fHB4XX9yczUvfX92g25whjtwfXE7dXaAgXx/hi85LXNueYBy NkgaF3l8cHhdf3JzNS99f3aDbnCGO4Bue3aBdodyO4Bue3aBdodyXHtgdYKBcXyEey85LXNueYBy NkgaFw==
You need to create a file local-settings.js with this line:
pref("general.config.filename", "mozilla.cfg");
Copy the file local-settings.js to the grefprefs folder or the defaults\pref folder in the Firefox program folder.
Prefs that are locked show as italic with Status is Locked on the about:config page and can't be changed.
For full instructions, see Locking_preferences
Extension code for pbdisable
Copy and paste the full DATA code in the location bar and press the Enter key. Save the file as pbdisable-1.5-fx.xpi (updated Jul 24, 2011)
You can install the extension via "File > Open File" or by dragging the file in a Firefox window.
You can move the extensions folder (pbdisable@mozillazine.org) from the extensions folder in the Profile Folder to the %AppData%\Mozilla\extensions\{ec8030f7-c20a-464f-9b0e-13a3a9e97384} folder or to the extensions folder in the Firefox program folder to make the extension work in all Firefox profiles. If you do that then you can't uninstall, but you can disable the extension. You can also drop the XPI file in that folder and the extension will be installed on the next start of Firefox. You may have to rename the extension to pbdisable@mozillazine.org.xpi to make that work [2].
data:application/octet-stream;base64, UEsDBBQAAAAIAHuYPzw3xI8ySQAAAHwAAAAPABUAY2hyb21lLm1hbmlmZXN0VVQJAAMJxmVLCcZl S1V4BADoA2QAS87PK0nNK+EsSErJLE5MyknlTM4oys9N1U+GSOjzcvFy5ZelFuUkVkKlrPT1k4ry y4tTi+CKoHy9itIchCK4kXBlcBGQQl4uAFBLAwQUAAAACACbWfg+0HWQZnkBAAD9AgAACwAcAGlu c3RhbGwucmRmVVQJAAMV4itOFeIrTnV4CwABBOkDAAAEZAAAAG2Sy07DMBBF95X4B5PukBznUWgT peGhqisWCAn2bjJpLWI7sp22FPHvBCemAbFz7j13PDNOdnvkNdqD0kyKpRf6gXebX0wuJtnzao06 T+iltzOmSQk5HA7+Ifal2pIwSRISRCSKsCorrN+FoUcs9NTrMynwXzEuT6yuqc1GQTAjwL+DU6+7 C2Ur0IVijelaQHQjW7P0WiXSIZQyoQ2ta8ypYBVoY0MoA56yMm82JdN0U8PdgJ+YgO97MtIDjhWU Q/70gAbc2lZzwLCEPPSvrem+nV+euxzVQdidNOpUDqJFeieVKVpjy4xjrlShgBqp8pIVb/vaYk5y yE5yaOgWXp4f82GRlVQt1/5/c45pV8G8N5BH1rZHq19ijNZMQSWPCOM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xBTRGJWWbEZOrFs2w8wiMMk4Ki2tkJZMiM Kexb+ljFdnN2GtSI7kTW2z5vaAvHmaWDJtlBoQlDHxl7bv0/R+lWjgciwn8mDFqcUtiJx7IUS7de MhBUMdOiKf3Et3Q0D43jyTXek84DS3zes/zR9Jvib1BLAQIXAxQAAAAIAHuYPzw3xI8ySQAAAHwA AAAPAA0AAAAAAAEAAADtgQAAAABjaHJvbWUubWFuaWZlc3RVVAUAAwnGZUtVeAAAUEsBAh4DFAAA AAgAm1n4PtB1kGZ5AQAA/QIAAAsAGAAAAAAAAQAAAO2BiwAAAGluc3RhbGwucmRmVVQFAAMV4itO dXgLAAEE6QMAAARkAAAAUEsBAhcDCgAAAAAADaV2OwAAAAAAAAAAAAAAAAcADQAAAAAAAAAQAO1B SQIAAGNocm9tZS9VVAUAA6mTCUtVeAAAUEsBAhcDCgAAAAAAWJg/PAAAAAAAAAAAAAAAAA8ADQAA AAAAAAAQAO1BgwIAAGNocm9tZS9jb250ZW50L1VUBQADx8VlS1V4AABQSwECHgMUAAAACAAnbPg+ EPYaNuYDAACYCQAAHAAYAAAAAAABAAAA7YHFAgAAY2hyb21lL2NvbnRlbnQvcGJkaXNhYmxlLnh1 bFVUBQAD+gIsTnV4CwABBOkDAAAEZAAAAFBLAQIeAxQAAAAIAIRZ+D4KBi4CdwEAAOwCAAAcABgA AAAAAAEAAADtgQEHAABjaHJvbWUvY29udGVudC9wYmRpc2FibGUuY3NzVVQFAAPn4StOdXgLAAEE 6QMAAARkAAAAUEsFBgAAAAAGAAYA6wEAAM4IAAAAAA==
Byte Shift JavaScript
You can use this JavaScript program to encode mozila.cfg.txt to mozilla.cfg and decode mozila.cfg to mozilla.cfg.txt.
/* * Paste this file into Firefox's JavaScript console and click the Evaluate button to run the script - dickvl@kb.mozillazine.org * use a byte shift of 13 to encode the file mozilla.cfg.txt to mozilla.cfg * use a byte shift of -13 to decode mozilla.cfg to mozilla.cfg.txt */ (function(){ var Cc = Components.classes; var Ci = Components.interfaces; var fp = Cc["@mozilla.org/filepicker;1"].createInstance(Ci.nsIFilePicker); var stream = Cc["@mozilla.org/network/file-input-stream;1"].createInstance(Ci.nsIFileInputStream); var streamIO = Cc["@mozilla.org/scriptableinputstream;1"].createInstance(Ci.nsIScriptableInputStream); var input,output='',i,s,sV=13; fp.init(window, "", fp.modeOpen); fp.appendFilter("", "*.txt; *.cfg"); if (fp.show() == fp.returnCancel) return; stream.init(fp.file, 0x01, 0444, null); streamIO.init(stream); input = streamIO.read(stream.available()); streamIO.close(); stream.close(); if((s=prompt('Byte Shift value (13 to encode and -13 to decode):','13'))!=null){ sV=parseInt(s,10); for(i=0;i<input.length;i++){output+=String.fromCharCode(input.charCodeAt(i)+sV)} fp.init(window,"",Ci.nsIFilePicker.modeSave); fp.defaultString="mozilla.cfg"; if (fp.show() == fp.returnCancel) return; var stream=Cc["@mozilla.org/network/file-output-stream;1"].createInstance(Ci.nsIFileOutputStream); stream.init(fp.file,0x04|0x08,0644,0); stream.write(output,output.length); stream.close(); } })();