Extensions :  K-Meleon Forum
All about K-Meleon extensions. 
LinkToggle (to select parts of link name) UPDATE! May15
Posted by: siria
Date: April 09, 2011 06:49AM

UPDATE: v2 / 2011-05-15
Macro works in KM 1.5.4 or newer.

UPDATE: v3 / 2015-03-22
Additional command for KM75 or newer: Copy Link Name
Additional command for KM1.6: Copy Link Name > URL bar
(In other KM-versions same functions as version2)

UPDATE: v4 / 2015-03-29
Should now also work with bookmarklet- and javascript-links.

=====

This macro allows to select parts of a link name, after toggling off the "link function".
The link is usually toggled on again automatically shortly after.


Right-click on a link to temporarily disable it with "LINK TOGGLE":


("Open Here" and "Copy" have nothing to do with toggling, just a little bonus, you can hide those lines if you prefer. There are descriptions inside the macro file "LinkToggle.kmm", just open it with a text editor, and add or remove a comment sign # at the chosen "setmenu" lines.)

The AUTOMATIC RESTORE is done if you toggle a link, select some text, right-click and use one of those 4 commands:


"Restore + Copy" copies selected text into the clipboard.
(For keyboard fans: CTRL+C also restores automatically, but only 1x, afterwards it's without "restore" again.)

"Restore + Search" sends the selected text to your current search engine or dictionary website.
(Same as hitting the search button/globe after selecting some text. Or use the "Web Search" in the same menu to choose another search engine etc. Plus automatic link restore.)

"Restore + Go To" opens selected text as URL.
(Same as hitting the "Go" button after selecting some text, or same as clicking on "Open As URL" in the same menu. Plus automatic link restore.)

After use, the menu block above is deleted again:


The link RESTORE usually happens automatically, otherwise use this, near "Reload" menu:
(That line gets created only if LinkToggle was used in this session, and stays visible until browser is closed)


Note: on FRAMES pages restoring works in active frame only.
But of course reloading a page always restores everything too.

----------------------------

Alternative Toggle:

On a few websites "LinkToggle" doesn't work. In such cases right-click on the link and use "Text Cursor (select in links)" Now if you click inside a page, that produces a visible cursor which you can move with the arrow keys even inside a link, then click Shift+Arrow to select some text.
Catch is: This special pref also changes the Home + End keys, and PageUp+Down keys, that's why this macro is coded to RESET it automatically as soon as possible: at first use of Ctrl+C or at next page load.
If you do NOT want to reset it automatically, use the permanent setting in the "View" menu.
(Code: uses a hidden Mozilla pref: "browse with caret")

----------------------------

INSTALLATION:
Save the attached kmm-file into one of your K-Meleon macros folders
Close browser (and loader if used) and restart K-Meleon.

"Un-Installation": Remove "LinkToggle.kmm" from macros folder.
Or hit F2>Macro Extension to temporarily disable single macros.



Edited 13 time(s). Last edit at 03/30/2015 02:50AM by siria.

Attachments: LinkToggle_menu1.png (12 KB)   linktoggle.kmm (8.5 KB)  
Options: ReplyQuote
Re: LinkToggle (to select parts of link name)
Posted by: siria
Date: April 09, 2011 09:15PM

Updated code, see above...

(Edit2: no change, only restored old images)



Edited 4 time(s). Last edit at 03/01/2014 05:28AM by siria.

Attachments: LinkToggle_menu2.png (6.4 KB)   LinkToggle_menu3.png (11.5 KB)  
Options: ReplyQuote
Re: LinkToggle (to select parts of link name)
Posted by: morfana
Date: April 12, 2011 05:20PM

It works great in win 7.Good job.

Options: ReplyQuote
Re: LinkToggle (to select parts of link name) UPDATE! May15
Posted by: siria
Date: May 16, 2011 03:42AM

Major update to Version-2, see first post!
Greatly recommended to update, if anyone has it installed.
With the first version I wasn't very happy yet, but this one is now really nice smiling smiley

Thanks morfana! smiling smiley



Edited 1 time(s). Last edit at 05/16/2011 03:48AM by siria.

Attachments: LinkToggle_menu4.png (7.4 KB)  
Options: ReplyQuote
Re: LinkToggle (to select parts of link name) UPDATE! May15
Posted by: WJ
Date: January 13, 2012 11:16PM

Download link not working, alas.

Options: ReplyQuote
Re: LinkToggle (to select parts of link name) UPDATE! May15
Posted by: WJ
Date: January 13, 2012 11:47PM

Ah, ne'er mind. The site's back online.

Options: ReplyQuote
Re: LinkToggle (to select parts of link name) UPDATE! May15
Posted by: siria
Date: March 23, 2015 12:31AM

UPDATE version-3: (2015-03-22)
Additional command for KM75 or newer: Copy Link Name
Additional command for KM1.6: Copy Link Name > URL bar
(In other KM-versions macro v3 has the same functions as v2)

. .

Why this new command not for all KM versions? Because the macro needs the injectJS-return function to get link names, which doesn't work in KM1.5 or KM74. And in KM1.6 there's a prob with the clipboard-format, as a workaround the macro copies the name into the URL bar.
If you're still using KM1.5.4 or KM74, I still recommand to update this macro, just in case some day you'll update to a new KM-version and plan to copy your old macros over.

Download-Link is in first post above.



Edited 1 time(s). Last edit at 03/23/2015 12:32AM by siria.

Attachments: LinkToggle_menu75.png (4 KB)   LinkToggle_menu16.png (3.3 KB)  
Options: ReplyQuote
Re: LinkToggle (to select parts of link name) UPDATE! May15
Posted by: siria
Date: March 29, 2015 05:32AM

Need a tester with KM75RC cool smiley

Have found a prob in KM1.6, bookmarklet-links containing special characters (like > { }) are not identified by the native KM JS_handlLink-macro and therefore not toggled.

But perhaps it works in KM75 ??
Here's a test page, has a few example bookmarklets on the right side, e.g. "List All Links":
subsimple.com/bookmarklets

In case 75 doesn't toggle those links either, please try if the KM1.6 workaround helps there too?
By adding this at the bottom of the kmm-file:

JS_hndlLink{
$JS_doit="for(var j=0,a=getElementsByTagName('a');j<a.length;j++)with(a[j])if(urlencode(href)==urlencode(\"".urlencode($LinkURL)."\")){".$JS_doitLink."}";
&JS_hndlDoc;
}


Options: ReplyQuote
Re: LinkToggle (to select parts of link name) UPDATE! May15
Posted by: rodocop
Date: March 29, 2015 07:04AM

Had tested.

It also doesn't work for some links in RC.

And yes - the solution works here too.


Try K-Meleon-1.6db+NS by dugbug // KM-16-S2014 by Fred // 1.6beta2.6 by JamesD

K-Meleon Twin+ Download for modern browsers =//= Download for old ones =//= Discuss it!!!

Latest Release KM74.0 Latest beta KM75beta3 Latest Candidate KM75 RC


Options: ReplyQuote
Re: LinkToggle (to select parts of link name) UPDATE! May15
Posted by: rodocop
Date: March 29, 2015 07:06AM

Great tool, siria!


Try K-Meleon-1.6db+NS by dugbug // KM-16-S2014 by Fred // 1.6beta2.6 by JamesD

K-Meleon Twin+ Download for modern browsers =//= Download for old ones =//= Discuss it!!!

Latest Release KM74.0 Latest beta KM75beta3 Latest Candidate KM75 RC


Options: ReplyQuote
Re: LinkToggle (to select parts of link name) UPDATE! May15
Posted by: siria
Date: March 30, 2015 02:51AM

Thanks for helping smiling smiley
New version-4 is now uploaded above.

Options: ReplyQuote


K-Meleon forum is powered by Phorum.