MozillaZine

User:Dickvl

From MozillaZine Knowledge Base

Contents

Bookmarklets

Bookmarklets can be found here: User:Dickvl/Bookmarklets
See also Wikipedia: Bookmarklet

Navigator Object

Here is a bookmarklet to display the content of the Navigator object (plugins, mimeTypes)

javascript:/* dickvl@kb.mozillazine.org */
(function(){
var b='<br>',i,L,O,p,pN,pT=('Navigator properties:').bold()+b+b,oT=('Navigator objects:').bold()+b+b,fT=('Navigator functions:').bold()+b+b;
for(pN in navigator){
if(typeof navigator[pN]=='object'){
O=navigator[pN];L=(O.length)?O.length:0;oT+=(pN+': ').bold()+L.toString().bold()+b;
for(i=0;i<L;i++){M=O[i];oT+=('['+(i+1)+'] ').bold();
for(p in M){if(typeof M[p]!='function'&&typeof M[p]!='object'&&p!='length'){oT+=(p+': ').bold()+M[p]+(' | ').bold()}}
if(M.enabledPlugin){oT+=('Plugin: ').bold()+M.enabledPlugin.name}
oT+=b}
oT+=b}
else if(typeof navigator[pN]!='function'){pT+=(pN+': ').bold()+navigator[pN]+b}
else if(typeof navigator[pN]=='function'){if(/Enabled/.test(pN)){fT+=(pN+': ').bold()+navigator[pN]()+b}}}
with(document.open()){write(pT+b+oT+b+fT);close();}
})();

Code

Code for userChrome.css and userContent.css can be found here User:Dickvl/Code

Double Underlined pop-ups

You can add this code to userContent.css to hide some ads and some IntelliTXT type pop-ups (double underlined links) [1].

/* google_ads_frame, yahoo iframe*/
IFRAME[src*='googlesyndication'],
IFRAME[name='google_ads_frame'] {display:none!important}
IFRAME[title='Ads by Yahoo!'] {display:none!important}

/* intelliTXT and others */
#iTt,#adbrite_inline_div,#AdvertBanner,#amzn-popup-div,
#konaLayers,#lwPreview,#menuModule,#tf_AdDiv,#tooltipBox,
#IL_BUBBLE,#IL_FORM_CONT,#snap_com_shot_main
 {display:none!important} 

/* get.lingospot.com */
.lingo_info_box *,.lingo_spot *,.lingo_reset *{display:none!important}

Error Console

The Code examples to run in the "Tools -> Error Console" have been moved to the User:Dickvl/JavaScript_Error_Console page.

Extensions

Private Browsing

Private Browsing disable (pbdisable) 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 code doesn't hide "Tools -> Options -> Privacy" to start PB mode automatically and you need to add code to userChrome.css to do that. The code in userChrome.css also hides the menu entries if the extension is disabled or not installed. Current Firefox versions still process code in userChrome.css if started in Safe_mode. It is possible to clear the cache via "Tools -> Options -> Advanced -> Network" and to clear history in the Library and History sidebar. See also [2]

For more information about the Private Browsing disable extension please visit: User:Dickvl/Private_Browsing_disable

Keysdisable

I use this code on Linux to disable some shortcuts that I want to use in Prefbar or that are otherwise dangerous (Ctr+Q to Quit Firefox is too close to Ctrl+W).

if(E=window.document.getElementById('key_closeWindow')){E.removeAttribute('key');E.removeAttribute('modifiers');E.removeAttribute('command');}
if(E=window.document.getElementById('key_quitApplication')){E.removeAttribute('key');E.removeAttribute('modifiers');E.removeAttribute('command');}
if(E=window.document.getElementById('key_privatebrowsing')){E.removeAttribute('key');E.removeAttribute('modifiers');E.removeAttribute('command');}
if(E=window.document.getElementById('key_openDownloads')){E.removeAttribute('key');E.removeAttribute('modifiers');E.removeAttribute('command');}
if(E=window.document.getElementById('key_undoCloseWindow')){E.removeAttribute('key');E.removeAttribute('modifiers');E.removeAttribute('command');}
if(E=window.document.getElementById('manBookmarkKb')){E.removeAttribute('key');E.removeAttribute('modifiers');E.removeAttribute('command');}

You can use the DOM Inspector to find the ID of a menu entry if you want to disable other menu entries.
You can modify the file keysdisable.xul in the keysdisable.jar (zip) archive in the keysdisable.xpi (zip) archive to make the changes.

Copy and paste the full DATA code in the location bar and press the Enter key. Save the file as keysdisable.xpi. Updated maxVersion to 6.* (Apr 13, 2011)

data:application/octet-stream;base64,
UEsDBBQAAAAIAIWYPzw1ZoQaSwAAAIIAAAAPABUAY2hyb21lLm1hbmlmZXN0VVQJAAMaxmVLGsZl
S1V4BADoA2QAS87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AAAAAEADtQYkCAABjaHJvbWUvY29udGVudC9VVAUAA8fFZUtVeAAAUEsBAhcDFAAAAAgAwqIk
PahmAbmIAQAA4QUAAB4ADQAAAAAAAQAAAO2BywIAAGNocm9tZS9jb250ZW50L2tleXNkaXNhYmxl
Lnh1bFVUBQADTI6CTFV4AABQSwECFwMUAAAACAC3mD88XNW0nYMAAACjAAAAHgANAAAAAAABAAAA
7YGkBAAAY2hyb21lL2NvbnRlbnQva2V5c2Rpc2FibGUuY3NzVVQFAAN5xmVLVXgAAFBLBQYAAAAA
BgAGANkBAAB4BQAAAAA=

Restart Firefox

This extension adds a Restart Firefox item to the File menu and the App menu. It displays that menu entry in the language of the installed locale (&addon.restartNow.label), so should work with all locales. All open tabs and windows should be restored if session restore is working properly.
Copy and paste the full DATA code in the location bar and press the Enter key. Save the file as restarter-1.2-fx.xpi (updated Jul 2, 2013) - works with Firefox 3.0 and later)

data:application/octet-stream;base64,
UEsDBAoAAAAAAMl4OzUAAAAAAAAAAAAAAAAHABUAY2hyb21lL1VUCQADWoUaRVqFGkVVeAQAPjP/
/1BLAwQKAAAAAADJeDs1AAAAAAAAAAAAAAAADwAVAGNocm9tZS9jb250ZW50L1VUCQADWoUaRVqF
GkVVeAQAPjP//1BLAwQUAAAACAD8COw8ZbXNK8ECAADJBQAAHAAVAGNocm9tZS9jb250ZW50L3Jl
c3RhcnRlci54dWxVVAkAA8xOOkzMTjpMVXgEAOgDZACNVN9P2zAQfkfifzgsMVFpdQbbw6AtjAGT
+jBgtC8IVZObXKnBsT3boXQ//vedk7RNGWzLS5K783fffXe+7tFjruABnZdG99guf8OODjc3ulun
FyfD68szMORTYg43mxsA3a2z82F/eA3bMHZCZ6fDUxhcD4Znn4GlU2dyPEiS0iP1baJMKhRW/zwL
GYPDJyD4GFDHzP5ZpNx8F9b6BdAquvHZAN5ecOqUf2vgZBpREFW2KEhmPebQB+ECOhZP1A8Jov3B
NOSqx6YhWCIym8347C037jbZ3d/fTx6j948za+HEXSolyj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FBLBQYAAAAABgAGAOEBAAAqCQAAAAA=

TabVisited

In Firefox 3.6 and above it is no longer possible to use the selected attribute to style unvisited and visited tabs with code in userChrome.css. In Firefox 3.6 and above only the selected tab gets a selected="true" attribute. In previous Firefox 3 and 3.5 versions the visited tabs get a selected="false" attribute, but that attribute was removed to fix buggy behavior [3], [4].

For more information about the TabVisited extension please visit: User:Dickvl/TabVisited

In Firefox 9+ versions you will have an unread attribute that you can use to style tabs that haven't been visited during the current session.
See: tab - MDN

Quote: This attribute is set to true if the tab is unread; that is, either it has not yet been selected during the current session, or has changed since the last time it was selected.
This attribute is not present if the tab is not unread.

.tabbrowser-tab[unread="true"] .tab-text {}
.tabbrowser-tab:not([unread="true"]) .tab-text {}
.tabbrowser-tab[selected="true"] .tab-text {}

/* not busy: background image */
.tabbrowser-tab:not([busy])[unread="true"] {background-image:-moz-linear-gradient(rgba(153,221,6,0.8) 1px,rgba(153,221,6,0.7) 3px,rgba(153,221,6,0.5) 32%),-moz-linear-gradient(-moz-dialog,-moz-dialog)!important}

.tabbrowser-tab:not([busy]):not([unread]) {background-image:-moz-linear-gradient(rgba(255,204,204,0.8) 1px,rgba(255,204,204,0.7) 3px,rgba(255,204,204,0.5) 32%), -moz-linear-gradient(-moz-dialog,-moz-dialog)!important}

.tabbrowser-tab:not([busy])[selected="true"] {background-image:-moz-linear-gradient(rgba(255,255,9,0.8) 1px,rgba(255,255,9,0.6) 3px,rgba(255,255,9,0.4) 32%),-moz-linear-gradient(-moz-dialog,-moz-dialog)!important}

/* busy */
.tabbrowser-tab[busy] {background-image:-moz-linear-gradient(rgba(0,6,204,0.8) 1px, rgba(0,6,204,0.7) 3px, rgba(0,6,204,0.7) 32%),-moz-linear-gradient(-moz-dialog,-moz-dialog)!important}
.tabbrowser-tab[busy] .tab-text {color:rgb(255,255,0)!important}

.tabbrowser-tab[busy][selected="true"] {background-image:-moz-linear-gradient(rgba(0,204,255,0.8) 1px,rgba(0,204,255,0.7) 3px,rgba(0,204,255,0.6) 32%),-moz-linear-gradient(-moz-dialog,-moz-dialog)!important}
.tabbrowser-tab[busy][selected="true"] .tab-text {color:rgb(0,0,255)!important}

See also: