Page Title Eraser
Date: December 01, 2008 09:01PM

I was wondering if there was a K-Meleon port of this: https://addons.mozilla.org/firefox/addon/2363

Thanks for any help.

Re: Page Title Eraser
Posted by: desga2
Date: December 02, 2008 01:37AM

I think can be possible simulate this Firefox extension with a macro and javascript.

K-Meleon in Spanish

Re: Page Title Eraser
Posted by: JamesD
Date: December 02, 2008 02:49AM

I can get the page titles and info in urlbar to "Private" but I don't think there is a variable for the tab title.

PrivateTitle.kmm

#  K-Meleon Macros (http://kmeleon.sourceforge.net/wiki/index.php?id=MacroLanguage)
#
# ---------- PrivateTitle.kmm
# ---------- K-Meleon Macro Language to halt display of page titles ---------------
# ----------  also halts display of info URLBAR.    HAS NO EFFECT ON TABS
#
# Dependencies			: main.kmm
# Resources			: 
# Preferences			: k-meleon_PrivateTitle_use
# Version			: 0.1   2008-12-01
# --------------------------------------------------------------------------------

_PrivateTitle_Set_On{
# checkmark value for the on menu;
menuchecked=getpref( BOOL , "k-meleon_PrivateTitle_use" )==true;
# set the userpref k-meleon_PrivateTitle_use to true;
setpref( BOOL , "k-meleon_PrivateTitle_use", true );
}

_PrivateTitle_Set_Off{
# checkmark value for the off menu;
menuchecked=getpref( BOOL , "k-meleon_PrivateTitle_use" )==false;
# set the userpref k-meleon PrivateTitle_use to false;
setpref( BOOL , "k-meleon_PrivateTitle_use", false );
}   

_PrivateTitle_TitleBlank{
$_PrivateTitle_Use = getpref( BOOL , "k-meleon_PrivateTitle_use" );
$_PrivateTitle_Use ==true ? &_PrivateTitle_TitleWrite: 0;
}

_PrivateTitle_TitleWrite{
$TITLE = "Private" ;
$URLBAR = "Private" ;
}

_PrivateTitle_ModMenu{
$_PrivateTitle_Popm = "Private Title";
setmenu("&Tools",popup,$_PrivateTitle_Popm,Misc);
&_PrivateTitle_ModMenuP;
}
_PrivateTitle_ModMenuP{
setmenu($_PrivateTitle_Popm,macro,"ON" ,_PrivateTitle_Set_On,0);
setmenu($_PrivateTitle_Popm,macro,"OFF",_PrivateTitle_Set_Off,1);
setmenu($_PrivateTitle_Popm,separator,2);
rebuildmenu($_PrivateTitle_Popm);
}

$OnLoad=$OnLoad."_PrivateTitle_TitleBlank;";
$OnInit=$OnInit."_PrivateTitle_ModMenu;";
$macroModules=$macroModules."PrivateTitle;";



Edited 1 time(s). Last edit at 12/02/2008 03:42AM by JamesD.

Re: Page Title Eraser
Posted by: desga2
Date: December 02, 2008 03:14AM

@ JamesD:
Your code have an error in line 27:
} <= Delete this bracket
_PrivateTitle_TitleBlank{
$_PrivateTitle_Use = getpref( BOOL , "k-meleon_PrivateTitle_use" );
$_PrivateTitle_Use ==true ? &_PrivateTitle_TitleWrite: 0;
}

Problem fixed with JavaScript:
#  K-Meleon Macros (http://kmeleon.sourceforge.net/wiki/index.php?id=MacroLanguage)
#
# ---------- PrivateTitle.kmm
# ---------- K-Meleon Macro Language to halt display of page titles ---------------
# ----------  also halts display of info URLBAR. Now with effect in tabs titles.
#
# Dependencies			: main.kmm
# Resources			: 
# Preferences			: k-meleon_PrivateTitle_use
# Version			: 0.1   2008-12-01
# --------------------------------------------------------------------------------

_PrivateTitle_Set_On{
# checkmark value for the on menu;
menuchecked=getpref( BOOL , "k-meleon_PrivateTitle_use" )==true;
# set the userpref k-meleon_PrivateTitle_use to true;
setpref( BOOL , "k-meleon_PrivateTitle_use", true );
}

_PrivateTitle_Set_Off{
# checkmark value for the off menu;
menuchecked=getpref( BOOL , "k-meleon_PrivateTitle_use" )==false;
# set the userpref k-meleon PrivateTitle_use to false;
setpref( BOOL , "k-meleon_PrivateTitle_use", false );
}   

_PrivateTitle_TitleBlank{
$_PrivateTitle_Use = getpref( BOOL , "k-meleon_PrivateTitle_use" );
$_PrivateTitle_Use ==true ? &_PrivateTitle_TitleWrite: 0;
}

_PrivateTitle_TitleWrite{
$TITLE = "Private" ;
$URLBAR = "Private" ;
$_JS_private="document.title='Private';";
injectJS($_JS_private);
}

_PrivateTitle_ModMenu{
$_PrivateTitle_Popm = "Private Title";
setmenu("&Tools",popup,$_PrivateTitle_Popm,Misc);
&_PrivateTitle_ModMenuP;
}

_PrivateTitle_ModMenuP{
setmenu($_PrivateTitle_Popm,macro,"ON" ,_PrivateTitle_Set_On,0);
setmenu($_PrivateTitle_Popm,macro,"OFF",_PrivateTitle_Set_Off,1);
setmenu($_PrivateTitle_Popm,separator,2);
rebuildmenu($_PrivateTitle_Popm);
}

$OnLoad=$OnLoad."_PrivateTitle_TitleBlank;";
$OnInit=$OnInit."_PrivateTitle_ModMenu;";
$macroModules=$macroModules."PrivateTitle;";

K-Meleon in Spanish



Edited 3 time(s). Last edit at 12/02/2008 03:32AM by desga2.

Re: Page Title Eraser
Posted by: JamesD
Date: December 02, 2008 03:49AM

Quote
desga2
Your code have an error in line 27:

} <= Delete this bracket

Thanks, I edited the post.

I tried the javacript. I still see the old title on tabs. We need a special global variable called $TABTITLE or $TABCAPTION that is not read only.

Re: Page Title Eraser
Posted by: OP
Date: December 02, 2008 08:55PM

Awesome, thanks guys.

Re: Page Title Eraser
Posted by: desga2
Date: December 02, 2008 11:16PM

@ JamesD:
My code version with JavaScript work fine to me, tabs included.
You need enable JavaScript and disable NoScript extension if you have it installed.

K-Meleon in Spanish



Edited 1 time(s). Last edit at 12/02/2008 11:16PM by desga2.

Re: Page Title Eraser
Posted by: JamesD
Date: December 03, 2008 03:16AM

@ desga2

Not working on tabs for me. I just checked and Javascript is enabled. I do not have noscript. Is there anything else that would prevent the injected JS from working?

You are seeing the text on the tab change to "Private"? I only see the window bar at the top, the URL bar and the taskbar change to private. I have put back in your code for Javascript. Here is the current version which now include Acel Key to toggle on and off.

#  K-Meleon Macros (http://kmeleon.sourceforge.net/wiki/index.php?id=MacroLanguage)
#
# ---------- PrivateTitle.kmm
# ---------- K-Meleon Macro Language to halt display of page titles ---------------
# ----------  also halts display of info in the URLBAR.    HAS NO EFFECT ON TABS!
#
# Dependencies			: main.kmm
# Resources				: 
# Preferences			: k-meleon_PrivateTitle_use
# Version				: 0.2   2008-12-02
# --------------------------------------------------------------------------------

PrivateTitle_ToggleUse{
getpref( BOOL , "k-meleon_PrivateTitle_use" )==true ? &_PrivateTitle_Set_Off : &_PrivateTitle_Set_On ;
rebuildmenu($_PrivateTitle_Popm);
}

# - - - - PRIVATE - - - -

_PrivateTitle_Set_On{
# checkmark value for the on menu;
menuchecked=getpref( BOOL , "k-meleon_PrivateTitle_use" )==true;
# set the userpref k-meleon_PrivateTitle_use to true;
setpref( BOOL , "k-meleon_PrivateTitle_use", true );
}

_PrivateTitle_Set_Off{
# checkmark value for the off menu;
menuchecked=getpref( BOOL , "k-meleon_PrivateTitle_use" )==false;
# set the userpref k-meleon PrivateTitle_use to false;
setpref( BOOL , "k-meleon_PrivateTitle_use", false );
}   

_PrivateTitle_TitleBlank{
$_PrivateTitle_Use = getpref( BOOL , "k-meleon_PrivateTitle_use" );
$_PrivateTitle_Use ==true ? &_PrivateTitle_TitleWrite: 0;
}

_PrivateTitle_TitleWrite{
$TITLE = "Private" ;
$URLBAR = "Private" ;
$_JS_private="document.title='Private';";
injectJS($_JS_private);
}

_PrivateTitle_SetAccels{
setaccel("CTRL SHIFT p", "macros(PrivateTitle_ToggleUse)");
}
_PrivateTitle_ModMenu{
$_PrivateTitle_Popm = "Private Title";
setmenu("&Tools",popup,$_PrivateTitle_Popm,Misc);
&_PrivateTitle_ModMenuP;
}
_PrivateTitle_ModMenuP{
setmenu($_PrivateTitle_Popm,macro,"ON" ,_PrivateTitle_Set_On,0);
setmenu($_PrivateTitle_Popm,macro,"OFF",_PrivateTitle_Set_Off,1);
setmenu($_PrivateTitle_Popm,separator,2);
rebuildmenu($_PrivateTitle_Popm);
}

$OnLoad=$OnLoad."_PrivateTitle_TitleBlank;";
$OnInit=$OnInit."_PrivateTitle_ModMenu;";
$OnInit=$OnInit."_PrivateTitle_SetAccels;";
$macroModules=$macroModules."PrivateTitle;";



Re: Page Title Eraser
Posted by: JamesD
Date: December 03, 2008 03:41AM

Found problem. It is the use of tab loading title and maybe tab loading icon. I had tab loading title checked. When unchecked, it works for tabs too.

Will have make macro check for these and fix to false while private is in use. I will get back with an updated version soon.

Re: Page Title Eraser
Posted by: JamesD
Date: December 03, 2008 04:24AM

Now PrivateTitle.kmm is fully functional including tabs. Tabs ability due to great JS code from desga2. Many thanks for that.

PrivateTitle.kmm

#  K-Meleon Macros (http://kmeleon.sourceforge.net/wiki/index.php?id=MacroLanguage)
#
# ---------- PrivateTitle.kmm
# ---------- K-Meleon Macro Language to halt display of page titles ---------------
# ----------  also halts display of info in the URLBAR.    
#
# Dependencies			: main.kmm
# Resources			: 
# Preferences			: k-meleon_PrivateTitle_use
#				: kmeleon.tabs.useLoadingTitle
#				: k-meleon_PrivateTitle_Loading
# Version			: 0.4   2008-12-02
# --------------------------------------------------------------------------------

PrivateTitle_ToggleUse{
getpref( BOOL , "k-meleon_PrivateTitle_use" )==true ? &_PrivateTitle_Set_Off : &_PrivateTitle_Set_On ;
rebuildmenu($_PrivateTitle_Popm);
}

# - - - - PRIVATE - - - -

_PrivateTitle_Set_On{
# checkmark value for the on menu;
menuchecked=getpref( BOOL , "k-meleon_PrivateTitle_use" )==true;
# set the userpref k-meleon_PrivateTitle_use to true;
setpref( BOOL , "k-meleon_PrivateTitle_use", true );
# check on tabs loading title
getpref( BOOL , "kmeleon.tabs.useLoadingTitle" )==true ? &_PrivateTitle_Loading_Yes : 0 ;
}

_PrivateTitle_Set_Off{
# checkmark value for the off menu;
menuchecked=getpref( BOOL , "k-meleon_PrivateTitle_use" )==false;
# set the userpref k-meleon PrivateTitle_use to false;
setpref( BOOL , "k-meleon_PrivateTitle_use", false );
getpref( BOOL , "kmeleon.tabs.useLoadingTitle" )==true ? &_PrivateTitle_Loading_ReDo : 0 ;
}   

_PrivateTitle_Loading_Yes{
setpref( BOOL , "kmeleon.tabs.useLoadingTitle", false );
setpref( BOOL , "k-meleon_PrivateTitle_Loading", true );
}

_PrivateTitle_Loading_ReDo{
setpref( BOOL , "kmeleon.tabs.useLoadingTitle", true );
delpref( "k-meleon_PrivateTitle_Loading" );
}

_PrivateTitle_TitleBlank{
$_PrivateTitle_Use = getpref( BOOL , "k-meleon_PrivateTitle_use" );
$_PrivateTitle_Use ==true ? &_PrivateTitle_TitleWrite: 0;
}

_PrivateTitle_TitleWrite{
$TITLE = "Private" ;
$URLBAR = "Private" ;
$_JS_private="document.title='Private';";
injectJS($_JS_private);
}

_PrivateTitle_SetAccels{
setaccel("CTRL SHIFT p", "macros(PrivateTitle_ToggleUse)");
}
_PrivateTitle_ModMenu{
$_PrivateTitle_Popm = "Private Title";
setmenu("&Tools",popup,$_PrivateTitle_Popm,Misc);
&_PrivateTitle_ModMenuP;
}
_PrivateTitle_ModMenuP{
setmenu($_PrivateTitle_Popm,macro,"ON" ,_PrivateTitle_Set_On,0);
setmenu($_PrivateTitle_Popm,macro,"OFF",_PrivateTitle_Set_Off,1);
setmenu($_PrivateTitle_Popm,separator,2);
rebuildmenu($_PrivateTitle_Popm);
}

$OnLoad=$OnLoad."_PrivateTitle_TitleBlank;";
$OnInit=$OnInit."_PrivateTitle_ModMenu;";
$OnInit=$OnInit."_PrivateTitle_SetAccels;";
$macroModules=$macroModules."PrivateTitle;";



Re: Page Title Eraser
Posted by: desga2
Date: December 04, 2008 12:59AM

Quote
JamesD
Tabs ability due to great JS code from desga2. Many thanks for that.
grinning smileygrinning smileygrinning smiley "Great"? I only included a simple code line of basic JavaScript. smiling smiley

I added a little modification to your code for custom title for replacements from menu:

PrivateTitle.kmm
#  K-Meleon Macros (http://kmeleon.sourceforge.net/wiki/index.php?id=MacroLanguage)
#
# ---------- PrivateTitle.kmm
# ---------- K-Meleon Macro Language to halt display of page titles -------------------------------
# ----------  also halts display of info in the URLBAR.
#
# Dependencies	: main.kmm
# Resources		: -
# Preferences	: k-meleon_PrivateTitle_use
#				  kmeleon.tabs.useLoadingTitle
#				  k-meleon_PrivateTitle_custom
# Version		: 0.5   2008-12-03
# Authors		: JamesD and desga2
# -------------------------------------------------------------------------------------------------

PrivateTitle_ToggleUse{
getpref(BOOL, "k-meleon_PrivateTitle_use")==true?&_PrivateTitle_Set_Off:&_PrivateTitle_Set_On;
rebuildmenu($_PrivateTitle_Popm);
}

# - - - - PRIVATE - - - -

_PrivateTitle_Set_On{
# checkmark value for the on menu:
menuchecked=getpref(BOOL, "k-meleon_PrivateTitle_use")==true;
# set the userpref k-meleon_PrivateTitle_use to true:
setpref(BOOL, "k-meleon_PrivateTitle_use", true);
# check on tabs loading title:
getpref(BOOL, "kmeleon.tabs.useLoadingTitle")==true?&_PrivateTitle_Loading_Yes:0;
}

_PrivateTitle_Set_Off{
# checkmark value for the off menu:
menuchecked=getpref(BOOL, "k-meleon_PrivateTitle_use")==false;
# set the userpref k-meleon PrivateTitle_use to false:
setpref(BOOL, "k-meleon_PrivateTitle_use", false);
getpref(BOOL, "kmeleon.tabs.useLoadingTitle")==true?&_PrivateTitle_Loading_ReDo:0;
}

_PrivateTitle_Loading_Yes{
setpref(BOOL, "kmeleon.tabs.useLoadingTitle", false);
}

_PrivateTitle_Loading_ReDo{
setpref(BOOL, "kmeleon.tabs.useLoadingTitle", true);
}

_PrivateTitle_TitleBlank{
$_PrivateTitle_Use=getpref(BOOL, "k-meleon_PrivateTitle_use");
$_PrivateTitle_Use==true?&_PrivateTitle_TitleWrite:0;
}

_PrivateTitle_TitleWrite{
$_PrivateCustomT=getpref(STRING, "k-meleon_PrivateTitle_custom");
$_PrivateCustomT==""?$_PrivateCustomT="Private":0;
$TITLE=$_PrivateCustomT;
$URLBAR=$_PrivateCustomT;
$_JS_private="document.title='".$_PrivateCustomT."';";
injectJS($_JS_private);
}

_PrivateTitle_CustomT{
$_PrivateCustomT=getpref(STRING, "k-meleon_PrivateTitle_custom");
$_PrivateCustomT==""?$_PrivateCustomT="Private":0;
$_PrivTcustom=prompt("Enter the title to use for title replacements. Type a space for no title.", "Custom Private Title", $_PrivateCustomT);
$_PrivTcustom==""?0 : setpref(STRING, "k-meleon_PrivateTitle_custom", $_PrivTcustom);
}

_PrivateTitle_SetAccels{
setaccel("CTRL SHIFT p", "macros(PrivateTitle_ToggleUse)");
}

_PrivateTitle_ModMenu{
$_PrivateTitle_Popm="Private Title";
setmenu("&Tools", popup, $_PrivateTitle_Popm, Misc);
&_PrivateTitle_ModMenuP;
}

_PrivateTitle_ModMenuP{
setmenu($_PrivateTitle_Popm, macro, "ON", _PrivateTitle_Set_On, 0);
setmenu($_PrivateTitle_Popm, macro, "OFF", _PrivateTitle_Set_Off, 1);
setmenu($_PrivateTitle_Popm, separator, 2);
setmenu($_PrivateTitle_Popm, macro, "Custom title ...", _PrivateTitle_CustomT, 3);
rebuildmenu($_PrivateTitle_Popm);
}

$OnLoad=$OnLoad."_PrivateTitle_TitleBlank;";
$OnInit=$OnInit."_PrivateTitle_ModMenu;";
$OnInit=$OnInit."_PrivateTitle_SetAccels;";
$macroModules=$macroModules."PrivateTitle;";

K-Meleon in Spanish



Edited 4 time(s). Last edit at 12/04/2008 01:05AM by desga2.

Re: Page Title Eraser
Posted by: JamesD
Date: December 04, 2008 04:50AM

@ desga2

Your Javascript importance is relative. It might be routine to you, but since I have never used any, it is great to me. You got tabs included where I could not. The custom title is a good addition also.

Small change so that if loading title checked prior to use of PrivateTitle, then loading title is checked after use.

PrivateTitle.kmm

#  K-Meleon Macros (http://kmeleon.sourceforge.net/wiki/index.php?id=MacroLanguage)
#
# ---------- PrivateTitle.kmm
# ---------- K-Meleon Macro Language to halt display of page titles -------------------------------
# ----------  also halts display of info in the URLBAR.
#
# Dependencies	        : main.kmm
# Resources		: -
# Preferences	        : k-meleon_PrivateTitle_use
#			: k-meleon_PrivateTitle_Loading
#			: kmeleon.tabs.useLoadingTitle
#			: k-meleon_PrivateTitle_custom
# Version		: 0.6   2008-12-03
# Authors		: JamesD and desga2
# -------------------------------------------------------------------------------------------------

PrivateTitle_ToggleUse{
getpref(BOOL, "k-meleon_PrivateTitle_use")==true?&_PrivateTitle_Set_Off:&_PrivateTitle_Set_On;
rebuildmenu($_PrivateTitle_Popm);
}

# - - - - PRIVATE - - - -

_PrivateTitle_Set_On{
# checkmark value for the on menu:
menuchecked=getpref(BOOL, "k-meleon_PrivateTitle_use")==true;
# set the userpref k-meleon_PrivateTitle_use to true:
setpref(BOOL, "k-meleon_PrivateTitle_use", true);
# check on tabs loading title:
getpref(BOOL, "kmeleon.tabs.useLoadingTitle")==true?&_PrivateTitle_Loading_Yes:0;
}

_PrivateTitle_Set_Off{
# checkmark value for the off menu:
menuchecked=getpref(BOOL, "k-meleon_PrivateTitle_use")==false;
# set the userpref k-meleon PrivateTitle_use to false:
setpref(BOOL, "k-meleon_PrivateTitle_use", false);
getpref(BOOL, "k-meleon_PrivateTitle_Loading")==true?&_PrivateTitle_Loading_ReDo:0;
}

_PrivateTitle_Loading_Yes{
setpref(BOOL, "kmeleon.tabs.useLoadingTitle", false);
setpref( BOOL , "k-meleon_PrivateTitle_Loading", true );
}

_PrivateTitle_Loading_ReDo{
setpref(BOOL, "kmeleon.tabs.useLoadingTitle", true);
delpref( "k-meleon_PrivateTitle_Loading" );
}

_PrivateTitle_TitleBlank{
$_PrivateTitle_Use=getpref(BOOL, "k-meleon_PrivateTitle_use");
$_PrivateTitle_Use==true?&_PrivateTitle_TitleWrite:0;
}

_PrivateTitle_TitleWrite{
$_PrivateCustomT=getpref(STRING, "k-meleon_PrivateTitle_custom");
$_PrivateCustomT==""?$_PrivateCustomT="Private":0;
$TITLE=$_PrivateCustomT;
$URLBAR=$_PrivateCustomT;
$_JS_private="document.title='".$_PrivateCustomT."';";
injectJS($_JS_private);
}

_PrivateTitle_CustomT{
$_PrivateCustomT=getpref(STRING, "k-meleon_PrivateTitle_custom");
$_PrivateCustomT==""?$_PrivateCustomT="Private":0;
$_PrivTcustom=prompt("Enter the title to use for title replacements. Type a space for no title.", "Custom Private Title", $_PrivateCustomT);
$_PrivTcustom==""?0 : setpref(STRING, "k-meleon_PrivateTitle_custom", $_PrivTcustom);
}

_PrivateTitle_SetAccels{
setaccel("CTRL SHIFT p", "macros(PrivateTitle_ToggleUse)");
}

_PrivateTitle_ModMenu{
$_PrivateTitle_Popm="Private Title";
setmenu("&Tools", popup, $_PrivateTitle_Popm, Misc);
&_PrivateTitle_ModMenuP;
}

_PrivateTitle_ModMenuP{
setmenu($_PrivateTitle_Popm, macro, "ON", _PrivateTitle_Set_On, 0);
setmenu($_PrivateTitle_Popm, macro, "OFF", _PrivateTitle_Set_Off, 1);
setmenu($_PrivateTitle_Popm, separator, 2);
setmenu($_PrivateTitle_Popm, macro, "Custom title ...", _PrivateTitle_CustomT, 3);
rebuildmenu($_PrivateTitle_Popm);
}

$OnLoad=$OnLoad."_PrivateTitle_TitleBlank;";
$OnInit=$OnInit."_PrivateTitle_ModMenu;";
$OnInit=$OnInit."_PrivateTitle_SetAccels;";
$macroModules=$macroModules."PrivateTitle;";


Re: Page Title Eraser
Posted by: desga2
Date: December 04, 2008 06:00AM

smiling smiley All right!, now I think that you must add this good macro to the MacroLybrary.

K-Meleon in Spanish

Re: Page Title Eraser
Posted by: JamesD
Date: December 04, 2008 07:45AM

@ desga2

That is on my "to do" list for tomorrow.

Re: Page Title Eraser
Posted by: JamesD
Date: December 04, 2008 08:54PM

PrivateTitle.kmm is now in the MacroLibrary. http://kmeleon.sourceforge.net/wiki/KmmPrivateTitle

K-Meleon forum is powered by Phorum.