Quote
siria
Something completely different, what I could imagine much easier is to manipulate not the mouse settings but the page source itself:
Have a little macro running after every page load that checks the current URL and if matching your conditions, it injects a little script that adds a "_blank" target to all links on the current page...
Then the page itself tells the browser "On clicking open this link in a new page". Still to consider some special probs and no idea about js-links, but for "normal" links that should work.
(Others any opionions? or macros..? :cool
Quote
JamesD
This works, but I find it a bit 'different' and won't use it after this test. Put the following in your Accelerators file.
LButton = ID_OPEN_LINK_IN_NEW_TAB
If you do this, then you will need some method to simulate the normal method. i.e. you won't be able to post in the forum and other things that require the same tab.
# K-Meleon Macros (http://kmeleon.sourceforge.net/wiki/index.php?id=MacroLanguage2) # # ---------- KMLClick.kmm # ---------- K-Meleon Macro Language External Listbox demonstrater --------------- # # Dependencies : - main.kmm # Reference : - http://kmeleonbrowser.org/forum/read.php?4,137550,137595#msg-137595 # Preferences : - "kmeleon.plugins.macros.kmlclick.diverted" # Version : - 0.3 2016_02_11 # -------------------------------------------------------------------------------- _KMLClick_Toggle { menuchecked = getpref(BOOL, "kmeleon.plugins.macros.kmlclick.diverted"); togglepref(BOOL, "kmeleon.plugins.macros.kmlclick.diverted", true, false); getpref(BOOL,"kmeleon.plugins.macros.kmlclick.diverted") ? $__img = 0 : $__img = 1; #alert( getpref(BOOL,"kmeleon.plugins.macros.kmlclick.diverted"), "Diverted img ".$__img, INFO); setcmdicon( "macros(_KMLClick_Toggle)", "check.png[".$__img.",32.32]" ); statusbar("Left Click changed ".$__img); } KMLClick_Click { if ($LinkURL != "" ) { getpref(BOOL,"kmeleon.plugins.macros.kmlclick.diverted") ? opentab( $LinkURL ): open( $LinkURL ); } } _KMLClick_BuildMenu { # add another option to Tools menu setmenu("&Tools", macro, "Left click diverted", _KMLClick_Toggle, "Misc"); } _KMLClick_BuildButton { $_KMLClick_TTip = "Left mouse click diverted" ; addtoolbar("KMLClick") ; addbutton("KMLClick", "macros(_KMLClick_Toggle)", "Left click diverted", $_KMLClick_TTip); getpref(BOOL,"kmeleon.plugins.macros.kmlclick.diverted") ? $__img = 0 : $__img = 1; setcmdicon( "macros(_KMLClick_Toggle)", "check.png[".$__img.",32,32]" ); } _KMLClick_SetAccels{ setaccel("LButton", "macros(KMLClick_Click)"); } ## - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - $OnInit=$OnInit."_KMLClick_BuildMenu;_KMLClick_SetAccels;"; $OnSetup=$OnSetup."_KMLClick_BuildButton;"; $macroModules=$macroModules."KMLClick;";
# K-Meleon Macros (http://kmeleon.sourceforge.net/wiki/index.php?id=MacroLanguage2) # # ---------- KMLClick.kmm # ---------- K-Meleon Macro Language External Listbox demonstrater --------------- # # Dependencies : - main.kmm # Reference : - http://kmeleonbrowser.org/forum/read.php?4,137550,137595#msg-137595 # Preferences : - "kmeleon.plugins.macros.kmlclick.diverted" # Version : - 0.3 2016_02_11 # -------------------------------------------------------------------------------- _KMLClick_Toggle { menuchecked = getpref(BOOL, "kmeleon.plugins.macros.kmlclick.diverted"); togglepref(BOOL, "kmeleon.plugins.macros.kmlclick.diverted"); $_KMLClick_status = getpref(BOOL,"kmeleon.plugins.macros.kmlclick.diverted"); if($_KMLClick_status == "true"){ setaccel("LButton", "macros(KMLClick_Click)"); $__img = 1; }else{ setaccel("LButton", ""); $__img = 0; } setcmdicon( "macros(_KMLClick_Toggle)", "check.png[".$__img.",32.32]" ); statusbar("Left Click changed ".$__img); } KMLClick_Click { if(($LinkURL != "" ) and (index($LinkURL,"javascript") == -1) and (index($LinkURL,"#") != length($LinkURL)-1)){ opentab($LinkURL); }else{ open($LinkURL); } } _KMLClick_BuildMenu { # add another option to Tools menu setmenu("&Tools", macro, "Left click diverted", _KMLClick_Toggle, "Misc"); } _KMLClick_BuildButton { $_KMLClick_TTip = "Left mouse click diverted" ; addtoolbar("KMLClick") ; addbutton("KMLClick", "macros(_KMLClick_Toggle)", "Left click diverted", $_KMLClick_TTip); getpref(BOOL,"kmeleon.plugins.macros.kmlclick.diverted") ? $__img = 0 : $__img = 1; setcmdicon( "macros(_KMLClick_Toggle)", "check.png[".$__img.",32,32]" ); } _KMLClick_SetAccels{ setaccel("LButton", "macros(KMLClick_Click)"); } ## - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - $OnInit=$OnInit."_KMLClick_BuildMenu;_KMLClick_SetAccels;"; $OnSetup=$OnSetup."_KMLClick_BuildButton;"; $macroModules=$macroModules."KMLClick;";
# K-Meleon Macros (http://kmeleon.sourceforge.net/wiki/index.php?id=MacroLanguage2) # # ---------- KMLClick.kmm # ---------- K-Meleon Macro Language to switch between -- # ---------- left button to open in new tab or normal ---- # # Dependencies : - main.kmm # Reference : - http://kmeleonbrowser.org/forum/read.php?4,137550,137595#msg-137595 # Preferences : - "kmeleon.plugins.macros.kmlclick.diverted" # Version : - 0.4 2016_02_12 JamesD's coding of JohnHell's idea # -------------------------------------------------------------------------------- _KMLClick_Toggle { menuchecked = getpref(BOOL, "kmeleon.plugins.macros.kmlclick.diverted"); togglepref(BOOL, "kmeleon.plugins.macros.kmlclick.diverted"); $_KMLClick_status = getpref(BOOL,"kmeleon.plugins.macros.kmlclick.diverted"); if($_KMLClick_status == "true"){ setaccel("LButton", "macros(KMLClick_Click)"); $__img = 0; }else{ setaccel("LButton", ""); $__img = 1; } setcmdicon( "macros(_KMLClick_Toggle)", "check.png[".$__img.",32,32]" ); statusbar("Left Click changed ".$__img); } KMLClick_Click { if(($LinkURL != "" ) and (index($LinkURL,"javascript") == -1)){ opentab($LinkURL); } } _KMLClick_BuildMenu { # add another option to Tools menu setmenu("&Tools", macro, "Left click diverted", _KMLClick_Toggle, "Misc"); } _KMLClick_BuildButton { $_KMLClick_TTip = "Left mouse click diverted" ; addtoolbar("KMLClick") ; addbutton("KMLClick", "macros(_KMLClick_Toggle)", "Left click diverted", $_KMLClick_TTip); setcmdicon( "macros(_KMLClick_Toggle)", "check.png[1,32,32]" ); } _KMLClick_InitPref { setpref(BOOL,"kmeleon.plugins.macros.kmlclick.diverted", false); } ## - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - $OnInit=$OnInit."_KMLClick_BuildMenu;_KMLClick_InitPref;"; $OnSetup=$OnSetup."_KMLClick_BuildButton;"; $macroModules=$macroModules."KMLClick;";