Extensions :  K-Meleon Web Browser Forum
All about K-Meleon extensions. 
Plugins and or extension like >>
Posted by: dodobird
Date: September 21, 2009 07:39PM

I would like to have some plugins or extensions like Firefox's "spell checker", "redirect cleaner" and "download them all" for K-Meleon, are there any?

Thanks.

Options: ReplyQuote
Re: Plugins and or extension like >>
Posted by: JujuLand
Date: September 21, 2009 08:16PM

- Spellchecker exists
- DownloadThemall doesn't exists, but I think there are some extensions which perhaps do this (JamesD or disrupted ?)
- RedirectCleaner ?? I don't know it.

As disrupted says, Firefox extensions aren't all adaptable for K-Meleon, and a few only can be used.

If too much extensions are missing for you, and you can do without it, just keep Firefox.

We are some guys here to try to improve and extend the K-Meleon capabilities, and we can't do all the guys want.

If you're able, why don't help ?

A+



Mozilla/5.0 (x11; U; Linux x86_64; fr-FR; rv:38.0) Gecko/20100101 Ubuntu/12.04 K-Meleon/76.0


Web: http://jujuland.pagesperso-orange.fr/
Mail : alain [dot] aupeix [at] wanadoo [dot] fr



Ubuntu 12.04 - Gramps 3.4.9 - Harbour 3.2.0 - Hwgui 2.20-3 - K-Meleon 76.0 rc



Options: ReplyQuote
Re: Plugins and or extension like >>
Posted by: disrupted
Date: September 21, 2009 09:33PM

all available extensions can be downloaded there:
http://kmext.sourceforge.net

spellcheck is under enhancements, it comes with a us dictionary..you might need some help setting it up for the first time..check this thread:
http://kmeleonbrowser.org/forum/read.php?1,87356,87417

downloadthemall is a available under network extensions..it's limited in functions and mostly works as a download manager where you can pause and resume your downloads for another session..it does not work as in firefox as in extracting all links and queuing them

the clean redirect addon can be made in kmeleon with a macro..the xpi is not needed, jamesd or desga can make it. he wants to remove site referers like on software sites and open the target link directly..shouldn't be hard as usually they have this string within (?url=) so a search in the link url for this and extraction of any string that follows should make it work

Options: ReplyQuote
Re: Plugins and or extension like >>
Posted by: disrupted
Date: September 21, 2009 10:13PM

the clean redirect is there:
https://addons.mozilla.org/en-US/firefox/addon/13246

here's how it workssad smileyfrom the addon page)

Examples:
http:// www.example.com?url=http:// www.mozilla.org -> http:// www.mozilla.org
javascript:windowOpen('http://www.mozilla.org','800','600'winking smiley -> http:// www.mozilla.org

http:// www.example.com?http:// www.mozilla.org -> http:// www.mozilla.org
http:// www.example.com?url=http://www.mozilla.org -> http:// www.mozilla.org
http:// www.example.com?param1=value1&url=http:// www.mozilla.org&param3=value3 -> http:// www.mozilla.org

http:// www.example.com?param1=value1*http:// www.mozilla.org -> http://  www.mozilla.org
http:// www.example.com?param1=value1:http:// www.mozilla.org -> http:// www.mozilla.org

http:// www.example.com?www.mozilla.org -> http:// www.mozilla.org
http:// www.example.com?url=www.mozilla.org -> http:// www.mozilla.org
http:// www.example.com?param1=value1&url=www.mozilla.org&param3=value3 -> http:// www.mozilla.org

http:// www.example.com?http:// www.example.net*http:// www.mozilla.org -> http:// www.mozilla.org

basically removes the referers to open a link directly.. very common with software sites.. i think for ad revenues etc doesn;t sound too hard for a macro.

i'd try to fiddle with it but not really in the mood.. i think a dev has gone AWOL

Options: ReplyQuote
Re: Plugins and or extension like >>
Posted by: JamesD
Date: September 21, 2009 11:04PM

I will give this a try, but first I need more information. In the following line from the example, which is the url that we wish to use?
"http:// www.example.com?url=http:// www.mozilla.org -> http:// www.mozilla.org"
Is it 'example.com', first 'mozilla.org', or second 'mozilla.org'?

I also need a site, URL, which has code in this manner so that I will be able to test. I looked at several free software sites, but I did not see code with the '?url=' in a link.

Options: ReplyQuote
Re: Plugins and or extension like >>
Posted by: dodobird
Date: September 21, 2009 11:41PM

Thanks for the info folks, disrupted: I have no idea how to do whatever it is your attempting to explane to me with your post, but thanks.

FF is a good browser, but I find K-Meleon faster and all I have access to is a 49.2bps dialup connection, so a small amount of time adds up to a lot faster to me, also I have been having crash's with FF when closing a window for no know reason and about:crashs dosent show anything, plus I get page scrolling pause's for 10 to 30 sec with no aparent reason. Often I have 10 or 15 pages open and when closing one FF just close's out and I have to start all over again, thank God for the page restore feature or I would go balistic.

K-Meleon to me is way faster, no pauses, but haven't found a "open page restore" anyplace, but if I could get the spell check and the redirect cleaner I'd be good to go.

Thanks for the info and links, will be looking into them.

Options: ReplyQuote
Re: Plugins and or extension like >>
Posted by: JamesD
Date: September 21, 2009 11:48PM

@ dodobird

I have code all ready to go if I can get answers to previous post.

Can you explain what you mean by "open page restore"?

Options: ReplyQuote
Re: Plugins and or extension like >>
Posted by: dodobird
Date: September 22, 2009 12:02AM

Re: "open page restore"

Firefox will offer to restore your open pages or tabs when ever there is a crash, you can select to "restore" the pages you had open at the time of the crash when you restart FF, or you can use the other option to just open with a single new page, as if you had just started FF new. The "restore" option is only show if in the event of a crash and FF closes with no warning so that you can have all your opened pages "restored".

Options: ReplyQuote
Re: Plugins and or extension like >>
Posted by: dodobird
Date: September 22, 2009 12:17AM

Quote
disrupted

downloadthemall is a available under network extensions..it's limited in functions and mostly works as a download manager where you can pause and resume your downloads for another session..it does not work as in firefox as in extracting all links and queuing them

After this is unzipped what do you need to do to "install it"
I guess what I need to know is where do you place the folders that you get after unpacking the kmdta-limited.7z file, Re: chrome, defaults and macros folders or content?

As my user name , I'm a dodobird with this kind of stuff, thanks.



Edited 1 time(s). Last edit at 09/22/2009 12:29AM by dodobird.

Options: ReplyQuote
Re: Plugins and or extension like >>
Posted by: mslayer
Date: September 22, 2009 12:30AM

Quote
JamesD
I will give this a try, but first I need more information. In the following line from the example, which is the url that we wish to use?
"http:// www.example.com?url=http:// www.mozilla.org -> http:// www.mozilla.org"
Is it 'example.com', first 'mozilla.org', or second 'mozilla.org'?

I also need a site, URL, which has code in this manner so that I will be able to test. I looked at several free software sites, but I did not see code with the '?url=' in a link.
http:// www.mozilla.org is the result from the original link: http:// www.example.com?url=http:// www.mozilla.org, so the macro will remove the first site, and leave the one you have interest. I think that it would work when searching for images in Google too. You know, when clicking a thumbnail image, Google shows them in a 'frame', but I'm not sure about all this.
@dodobird
About the files inside a 7zip package: they are in order, each one inside a folder, you just need to open the 7zip file, and then uncompress the file to your KM folder.

Options: ReplyQuote
Re: Plugins and or extension like >>
Posted by: disrupted
Date: September 22, 2009 12:37AM

kmeleon has a sessions plugin that automatically prompts to restore the previous session in the unlikely event of a crash. also you can manually restore a session by clicking on the session menu>restore previous..you can also setup custom sessions- with your favourite sites for example etc.

to install an extension, extract the 7z file into your kmeleon's folder.. the files will automatically go to their proper folders in kmeleon i.e. a file in chrome will go to the chrome folder inside kmeleon.. if a folder doesn't exist, it will be created.

some extensions require component files so they have to be registered..please see the help/faq page on the kmext page:
http://kmext.sourceforge.net/help.htm
there are also a KEIH and KEITH helpers which automate the extraction of the files into kmeleon's folder

welcome to kmeleon and hope you'll find everything you need

james, here's an example at programurl:
http://www.programurl.com/universal-explorer.htm

if you hover on the author's homepage, in the statusbar it shows a direct link to his homepage which is actually bogus ..the actual link has a referer, copy link url and paste in addressbar and you'l get the real link with the referer.. snapfiles also has a similar thing

e.g. htt p://www.programurl.com/siteclick.php?a=0&b=1&url=/siteclick.php?a=0&b=1&url=htt p://www.spadixbd.com/

most sites follow a similar routine..the idea is find if it contains a 'url=' in the link href.. remove everything from the href and extract only the string after url=

Options: ReplyQuote
Re: Plugins and or extension like >>
Posted by: dodobird
Date: September 22, 2009 12:55AM

Quote
disrupted
kmeleon has a sessions plugin that automatically prompts to restore the previous session in the unlikely event of a crash. also you can manually restore a session by clicking on the session menu>restore previous..you can also setup custom sessions- with your favourite sites for example etc.=

Thanks didn't know about that, but that is what I was talking about.


Quote
to install an extension, extract the 7z file into your kmeleon's folder.. [quote=the files will automatically go to their proper folders in kmeleon i.e. a file in chrome will go to the chrome folder inside kmeleon.. if a folder doesn't exist, it will be created.=[/quote

Thanks will attempt that.

Quote
some extensions require component files so they have to be registered..please see the help/faq page on the kmext page:
[url=http://kmext.sourceforge.net/help.htm

http://kmext.sourceforge.net/help.htm[/url]
there are also a KEIH and KEITH helpers which automate the extraction of the files into kmeleon's folder=

OK ???

Quote
welcome to kmeleon and hope you'll find everything you need=[/quote

Thanks, very helpful so far.

Quote
james, here's an example at programurl:
[url

http://www.programurl.com/universal-explorer.htm[/url]

if you hover on the author's homepage, in the statusbar it shows a direct link to his homepage which is actually bogus ..the actual link has a referer, copy link url and paste in addressbar and you'l get the real link with the referer.. snapfiles also has a similar thing

e.g. htt p://www.programurl.com/siteclick.php?a=0&b=1&url=/siteclick.php?a=0&b=1&url=htt p://www.spadixbd.com/

most sites follow a similar routine..the idea is find if it contains a 'url=' in the link href.. remove everything from the href and extract only the string after url=

You can also find what I'm talking about here, Warning not safe for work.

h**p://888chan.org/p/res/151740.html

this link: h**p://anonym.to/?h**p://w&w.1024chan.org

change ** to tt and & with w

When copy this link you get the anonym.com

I want to copy and not get that but just the direct link.



Edited 1 time(s). Last edit at 09/22/2009 12:57AM by dodobird.


Options: ReplyQuote
Re: Plugins and or extension like >>
Posted by: JamesD
Date: September 22, 2009 02:28AM

Guys, I am getting confused. I have the program written to show me the $LinkURL variable from a highlighted link. I don't see the string "?url=" in the $LinkURL from this page. http://www.programurl.com/universal-explorer.htm

What I see is "h**p://w**.programurl.com/siteclick.php?a=0&b=1&url=/siteclick.php?a=0&b=1&url=http://w**.spadixbd.com/".
I replaced the tt and ww with **. The title for the link is Program Homepage. Did I select the right link? "&url=" shows up more than once in this link.



The program so far looks like this.

OpenClean.kmm

#  K-Meleon Macros (http://kmeleon.sourceforge.net/wiki/index.php?id=MacroLanguage)
# File name: OpenClean.kmm
# ---------- Open link without redirects ----
#
# Dependencies        : main.kmm 
# Resources           : - 
# Preferences         : - 
# Version             : 0.1 2009-09-21
# Author              : JamesD 
# -------------------------------------------

_OpenCleanlink {
alert($LinkURL, "The highlighted link", INFO);
setclipboard($LinkURL);
#$_OpenCleanPos = index("?url=",$LinkURL);
#$_OpenCleanURL = substr( $LinkURL, $_OpenCleanPos +5 );
#alert($_OpenCleanURL, "$_OpenCleanURL DEBUG", INFO);

}

_OpenClean_BuildMenu {
setmenu(LinkSave,macro, "Open Without Redirects",_OpenCleanlink,-1);
}

$OnInit=$OnInit."_OpenClean_BuildMenu;";
$macroModules=$macroModules."OpenClean;";



Edited 1 time(s). Last edit at 09/22/2009 02:29AM by JamesD.

Options: ReplyQuote
Re: Plugins and or extension like >>
Posted by: mslayer
Date: September 22, 2009 05:34PM

I think that you want http://w**.spadixbd.com/ as a result, removing all the rest of the link. That would be anything after &url=. But I'm not sure enough. Maybe locating the last "http://";, and then from that position extract the string?

Options: ReplyQuote
Re: Plugins and or extension like >>
Posted by: mslayer
Date: September 22, 2009 05:36PM

Sorry for the double-post, I was saying locate the last h t t p:// (without spaces)

Options: ReplyQuote
Re: Plugins and or extension like >>
Posted by: disrupted
Date: September 22, 2009 05:41PM

the variables are so many..it's very hard to cover them all in a macro, no wonder that guy used javascript to extract out the links and yet..he did not cover them all.. i tested his extension in ff and it doesn't work with many redirects.

i tried the macro approach but it wasn;t good enough so i turned to autoit which is much more versatile than js or macro language with these conditions.. it works much better than firefox's extension and have been tested on many sites.

dodobird, download cleanredirect autoit adaptation from this link:
http://kmext.sourceforge.net/files/cleanredirect.7z

extract in k-meleon's root folder
i.e. the cleanredirect.kmm goes in k-meleon\macros folder
cleanredirect.exe goes in k-meleon\tools folder
(cleanredirect.au3 is the source and you can delete it if you want)

restart kmeleon, right click on a link with a referer and select clean redirect
(if you click on a link without a referer, clean redirect will just open it normally in a new tab)


you can test the extension at this page:
http://kmext.sourceforge.net/tests/cleanredirect-tests.htm

sources
# K-Meleon Macros (http://kmeleon.sourceforge.net/wiki/index.php?id=MacroLanguage)

# ---------- cleanredirect -------------------

$_tool_path=getfolder(RootFolder)."\\Tools";

clndirect{
menugrayed=(hostname($LinkURL)=="");
id(ID_COPY_LINK_LOCATION);
exec($_tool_path."\\cleanredirect.exe ");
}

clndirect_BuildMenu{
setmenu(LinkSave,macro,"Clean Redirect",clndirect,7);
}

$OnInit=$OnInit."clndirect_BuildMenu;";
# --------------------------------------------------------------------
$macroModules=$macroModules."cleanredirect;";


; AutoIt Version: (atleast)3.0
; Language: Gibberish
; Platform: Win9x/NT
; Author: yanni
;

#NoTrayIcon
#include <String.au3>

$chkurl=ClipGet()
$getkmbinary1=stringtrimright(@scriptdir, 5)
$getkmbinary=($getkmbinary1 & "k-meleon.exe")

$getpos=StringInStr($chkurl, "http" , "", -1)
$getpos2=StringInStr($chkurl, "www" , "", -1)
;;Msgbox(0,$getpos2, $getpos2)

if $getpos2>9 then
;Msgbox(0,"www test", "www test")
$stripout=StringTrimLeft($chkurl, $getpos2-1)
$cleanup1=StringReplace($stripout, "&param1=value1", "" )
$cleanup2=StringReplace($cleanup1, "&param2=value2", "" )
$cleanup3=StringReplace($cleanup2, "&param3=value3", "" )
$cleanup4=StringReplace($cleanup3, "&param4=value4", "" )
$cleanup5=StringReplace($cleanup4, "&param5=value5", "" )
$cleanup6=StringReplace($cleanup5, "&param6=value6", "" )
$cleanup7=StringReplace($cleanup6, "&param7=value7", "" )
$cleanup8=StringReplace($cleanup7, "&param8=value8", "" )
$cleanup9=StringReplace($cleanup8, "&param9=value9", "" )
$cleanup10=StringReplace($cleanup9, "http%3a", "http:" )
$cleanup11=StringReplace($cleanup10, "https%3a", "https:" )
$jscleanpos=StringInStr($cleanup11, "','" , "", 1)
$jsclean=StringMid($cleanup11, 1, $jscleanpos-1)
$ultraclean=StringInStr($jsclean, "%" , "", 1)
$thredirect=StringMid($jsclean, 1, $ultraclean-1)
;;Msgbox(0,$ultraclean, $ultraclean)
;Msgbox(0,$thredirect, $thredirect)
$open=($getkmbinary & " " & $thredirect)
run($open)
elseif $getpos2<9 then
;Msgbox(0,$getpos, $getpos)
;Msgbox(0,"http test", "http test")
$stripout=StringTrimLeft($chkurl, $getpos-1)
;Msgbox(0,$stripout, $stripout)
$cleanup1=StringReplace($stripout, "&param1=value1", "" )
$cleanup2=StringReplace($cleanup1, "&param2=value2", "" )
$cleanup3=StringReplace($cleanup2, "&param3=value3", "" )
$cleanup4=StringReplace($cleanup3, "&param4=value4", "" )
$cleanup5=StringReplace($cleanup4, "&param5=value5", "" )
$cleanup6=StringReplace($cleanup5, "&param6=value6", "" )
$cleanup7=StringReplace($cleanup6, "&param7=value7", "" )
$cleanup8=StringReplace($cleanup7, "&param8=value8", "" )
$cleanup9=StringReplace($cleanup8, "&param9=value9", "" )
;Msgbox(0,$cleanup9, $cleanup9)
$cleanup10=StringReplace($cleanup9, "http%3a", "http:" )
;Msgbox(0,$cleanup10, $cleanup10)
$cleanup11=StringReplace($cleanup10, "https%3a", "https:" )
$jscleanpos=StringInStr($cleanup11, "','" , "", 1)
$jsclean=StringMid($cleanup11, 1, $jscleanpos-1)
$ultraclean=StringInStr($jsclean, "%" , "", 1)
$thredirect=StringMid($jsclean, 1, $ultraclean-1)
;;Msgbox(0,$ultraclean, $ultraclean)
;Msgbox(0,$thredirect, $thredirect)
$open=($getkmbinary & " " & $thredirect)
run($open)
else
;Msgbox(0,"www first", "www first")
$stripout=StringTrimLeft($chkurl, $getpos2-1)
$cleanup1=StringReplace($stripout, "&param1=value1", "" )
$cleanup2=StringReplace($cleanup1, "&param2=value2", "" )
$cleanup3=StringReplace($cleanup2, "&param3=value3", "" )
$cleanup4=StringReplace($cleanup3, "&param4=value4", "" )
$cleanup5=StringReplace($cleanup4, "&param5=value5", "" )
$cleanup6=StringReplace($cleanup5, "&param6=value6", "" )
$cleanup7=StringReplace($cleanup6, "&param7=value7", "" )
$cleanup8=StringReplace($cleanup7, "&param8=value8", "" )
$cleanup9=StringReplace($cleanup8, "&param9=value9", "" )
$cleanup10=StringReplace($cleanup9, "http%3a", "http:" )
$cleanup11=StringReplace($cleanup10, "https%3a", "https:" )
$jscleanpos=StringInStr($cleanup11, "','" , "", 1)
$jsclean=StringMid($cleanup11, 1, $jscleanpos-1)
$ultraclean=StringInStr($jsclean, "%" , "", 1)
$thredirect=StringMid($jsclean, 1, $ultraclean-1)
;;Msgbox(0,$ultraclean, $ultraclean)
;Msgbox(0,$thredirect, $thredirect)
$open=($getkmbinary & " " & $thredirect)
run($open)
endif



Options: ReplyQuote
Re: Plugins and or extension like >>
Posted by: JamesD
Date: September 22, 2009 05:53PM

@ disrupted

If you have this working, then I am not going any further with my macro. I could not see how to run without user intervention (right click) and I saw no way to tell if a link was going to have redirect.

Thanks for your good work.

Options: ReplyQuote
Re: Plugins and or extension like >>
Posted by: disrupted
Date: September 22, 2009 08:50PM

thanks james, i persoanlly prefer macro solutions to keep everything within kmeleon but sometimes it's much easier and less coding to work outside

the extension seems to be working fine..on various links i've tested, it didn;t fail once..we just have to wait for dodobird for feedback

Options: ReplyQuote
Re: Plugins and or extension like >>
Posted by: mslayer
Date: September 22, 2009 10:36PM

Quote
JamesD
Guys, I am getting confused. I have the program written to show me the $LinkURL variable from a highlighted link. I don't see the string "?url=" in the $LinkURL from this page. http://www.programurl.com/universal-explorer.htm

What I see is "h**p://w**.programurl.com/siteclick.php?a=0&b=1&url=/siteclick.php?a=0&b=1&url=http://w**.spadixbd.com/".
I replaced the tt and ww with **. The title for the link is Program Homepage. Did I select the right link? "&url=" shows up more than once in this link.



The program so far looks like this.

OpenClean.kmm

#  K-Meleon Macros (http://kmeleon.sourceforge.net/wiki/index.php?id=MacroLanguage)
# File name: OpenClean.kmm
# ---------- Open link without redirects ----
#
# Dependencies        : main.kmm 
# Resources           : - 
# Preferences         : - 
# Version             : 0.1 2009-09-21
# Author              : JamesD 
# -------------------------------------------

_OpenCleanlink {
alert($LinkURL, "The highlighted link", INFO);
setclipboard($LinkURL);
#$_OpenCleanPos = index("?url=",$LinkURL);
#$_OpenCleanURL = substr( $LinkURL, $_OpenCleanPos +5 );
#alert($_OpenCleanURL, "$_OpenCleanURL DEBUG", INFO);

}

_OpenClean_BuildMenu {
setmenu(LinkSave,macro, "Open Without Redirects",_OpenCleanlink,-1);
}

$OnInit=$OnInit."_OpenClean_BuildMenu;";
$macroModules=$macroModules."OpenClean;";
Hey James, the index() parameters in your code are reversed, I'm trying to fix the code right now, I'm using this: $_OpenCleanPos = index( $LinkURL,"www." );
But I need a while loop to find the right-most instance of "www."
This is what I'm trying to do:
	$_OpenCleanURL=$LinkURL;
	while($_OpenCleanPos!=-1){
		$_OpenCleanPos = index( $_OpenCleanURL,"www." );
		$_OpenCleanPos!=-1?$_OpenCleanURL = substr( $_OpenCleanURL, $_OpenCleanPos ):0;
	}
I don't know how to use the while constructor,sad smiley the idea is to find "www." in the string, and then loop and try to find it again. Finally use the last Position of the "www." string, from there extract the link.

Options: ReplyQuote
Re: Plugins and or extension like >>
Posted by: disrupted
Date: September 22, 2009 11:19PM

slayer, it's too much trouble in macro.. i tried the same thing but the variables are too much for the macro to parse correctly.. it might not contain a www at all for the target link like in this e.g

http ://www.example.com/?url=http ://mozilla.org

the target link is directed with http and not with a www, autoit works better because it can search from the right and doesn't need to look for 2 matches.. when it's searching from the right..the first instance is what it needs and when it doesn't find the target instance of www and finds the referer www (searching from the right) it can tell that this match of www doesn't belong to the target link but to the referer because it's at the neginning of the string..or in that case it's at the end of the string(searching from the right) so it ignores it and searches for the first instance of http(searching from the right) which any target link will naturally have if it doesn't have a www prefix.

another problem that might face the macro is when the target link is contained inside the string and not at the end like in that example:
htt p://www.google.co.uk/url?q=registry%2Bcleaner&url=/aclk%3Fsa%3Dl%26ai%3DCm4FtsOK4SuW9LYKrsAbqquHUCJynl4MBgtrC4AvAt_UECAAQASgDULbHwYH-_____wFguwagAZzQt_8DyAEBqgQcT9ACNH1fa5qKu_vdB0Gu-OfYXXSteH5KBP1FEQ%26sig%3DAGiWqtx15Z2mKB8ZSCMjv4iNCx7MgVvhXw%26q%3Dhtt p://www.pctools.com/registry-mechanic/download%253Fref%253Dgoogle&rct=j&ei=sOK4SqOzKsqHsAbip93ABQ&usg=AFQjCNHdjgm1LNmK5zxeHGGWL6fbshpL1w

the only way i think it can be extracted with the macro is to know the exact position where the target string starts and the exact character where it ends.. i'm not sure if there is any other way
even the js based frefox extension had problems with such strings and most of them weren't extracted correctly, again the autoit string function is utilised easily to be intelligent in detecting unconventional characters(always where the target link ends) and precisely extract the proper link without any additions.. this is very important because any string containing even one wrong character at the end will not open the desired website and end in a 404 error page. i think even if you were able to find a way with the macro, it will probably conflict with other strings..meaning if you have to get the target link correctly from one condition, another condition will suffer and its target link will not be proper.. which is the same problem with the js-based addon..i think you will need to make a compromise but with autoit all conditions are calculated in a much better way


dodobird, since this extension passes the link externally to kmeleon like an external application, you might want to change some preferences to make the link openn in a new tab and not override the current page:

open kmeleon preferences and under browsing>window diversion> set urls passed from external applications to open in a new tab


Options: ReplyQuote
Re: Plugins and or extension like >>
Posted by: JamesD
Date: September 22, 2009 11:25PM

@ mslayer

You are right about my 'index()' statement. Was too late at night for old guy like me.

Regarding the 'while' loop, it could look like this.
_OpenCleanlink {
alert($LinkURL, "The highlighted link", INFO);
$_OpenCleanURL = $LinkURL ;
$_OpenCleanPos = 0 ;
while($_OpenCleanPos != -1) {
	$_OpenCleanPos = index( $_OpenCleanURL, "&url=http");
	if ($_OpenCleanPos > 0 ) {
		$_OpenCleanURL = substr( $_OpenCleanURL, $_OpenCleanPos +5 );
		alert($_OpenCleanURL, "$_OpenCleanURL DEBUG", INFO);
		}
	}
$kTabs?opentab( $_OpenCleanURL )yawning smileypennew( $_OpenCleanURL );
}

Pos is zero so the while will operate once. If it finds "&url=http" Pos will will be a positive integer. In that case substr changes URL to be the remainder of itself. Since Pos is not -1 while will loop again. When no more instances of "&url=http", index() will set Pos to -1 and the while loop will stop.

Options: ReplyQuote
Re: Plugins and or extension like >>
Posted by: dodobird
Date: September 23, 2009 12:19AM

Quote
disrupted
thanks james, i persoanlly prefer macro solutions to keep everything within kmeleon but sometimes it's much easier and less coding to work outside

the extension seems to be working fine..on various links i've tested, it didn;t fail once..we just have to wait for dodobird for feedback


Re:Feedback
Works fine for going direct to a link, BUT... is there any way to rework this so that if you just want to copy the link to note pad or to a download manager that is monitoring for right clicks of links it will only copy the direct link to the download manager or note pad?
Thats what the one in FF will do as well as what you have already done with this.
Example would be: right click a link and have an option in the menu to SAVE CLEANED LINK or some wording to that effect?
Thanks for all you efforts in this, never expected this type of commitment or working up a new feature just because I asked about it.

Options: ReplyQuote
Re: Plugins and or extension like >>
Posted by: JohnHell
Date: September 23, 2009 02:16PM

Replacing the last open command with setclipboard:

setclipboard($_OpenCleanURL);

EDIT:

If you use a app that hasn't monitoring of clipboard than you'll need:

exec(""path to the download app.exe" ".$_OpenCleanURL);



Edited 2 time(s). Last edit at 09/23/2009 02:20PM by JohnHell.

Options: ReplyQuote
Re: Plugins and or extension like >>
Posted by: disrupted
Date: September 23, 2009 04:56PM

i didn't know you were going to use it to trigger a monitoring download manager.. i made an update and the linkurl now adds a bogus extension before sending to clipboard in case the linkurl ends with an extension like .zip .exe etc that might trigger a download manager.. that suffix is removed in autoit (sending that kind of linkurl to autoit as a command parameter is not an option because those strings are almost always too long for autoit to handle as a parameter)

the context menu now has 2 commands:
open clnredirect and copy clnredirect

download here:
http://kmext.sf.net/files/cleanredirect.7z




sources:
# K-Meleon Macros (http://kmeleon.sourceforge.net/wiki/index.php?id=MacroLanguage)

# ---------- cleanredirect -------------------

$_tool_path=getfolder(RootFolder)."\\Tools";

clndirect{
menugrayed=(hostname($LinkURL)=="");
$bogus e xt=(".bog");
setclipboard($LinkURL.$bogus e xt);
exec($_tool_path."\\cleanredirect.exe ");
}

clndirect_get{
menugrayed=(hostname($LinkURL)=="");
$bogus e xt=(".bog");
setclipboard($LinkURL.$bogus e xt);
statusbar("cleaned target link has been copied to the clipboard");
exec($_tool_path."\\cleanredirect.exe -justcopy");
}


clndirect_BuildMenu{
setmenu(LinkSave,inline,cln_redirect,7);
setmenu(cln_redirect,macro,"Open ClnRedirect",clndirect);
setmenu(cln_redirect,macro,"Copy ClnRedirect",clndirect_get);
}

$OnInit=$OnInit."clndirect_BuildMenu;";
# --------------------------------------------------------------------
$macroModules=$macroModules."cleanredirect;";


; AutoIt Version: 3.3.0
; Language: Gibberish
; Platform: Win9x/NT
; Author: yanni
;

#NoTrayIcon
#include <String.au3>

$chkurl=ClipGet()
$getkmbinary1=stringtrimright(@scriptdir, 5)
$getkmbinary=($getkmbinary1 & "k-meleon.exe")

$getpos=StringInStr($chkurl, "http" , "", -1)
$getpos2=StringInStr($chkurl, "www" , "", -1)
;;Msgbox(0,$getpos2, $getpos2)

if $cmdline[0]=0 then
targetkm()
else
targetclip()
endif

func targetkm()
if $getpos2>9 then
;Msgbox(0,"www test", "www test")
$rembog=StringTrimRight($chkurl, 4)
$stripout=StringTrimLeft($rembog, $getpos2-1)
$cleanup1=StringReplace($stripout, "&param1=value1", "" )
$cleanup2=StringReplace($cleanup1, "&param2=value2", "" )
$cleanup3=StringReplace($cleanup2, "&param3=value3", "" )
$cleanup4=StringReplace($cleanup3, "&param4=value4", "" )
$cleanup5=StringReplace($cleanup4, "&param5=value5", "" )
$cleanup6=StringReplace($cleanup5, "&param6=value6", "" )
$cleanup7=StringReplace($cleanup6, "&param7=value7", "" )
$cleanup8=StringReplace($cleanup7, "&param8=value8", "" )
$cleanup9=StringReplace($cleanup8, "&param9=value9", "" )
$cleanup10=StringReplace($cleanup9, "http%3a", "http:" )
$cleanup11=StringReplace($cleanup10, "https%3a", "https:" )
$jscleanpos=StringInStr($cleanup11, "','" , "", 1)
$jsclean=StringMid($cleanup11, 1, $jscleanpos-1)
$ultraclean=StringInStr($jsclean, "%" , "", 1)
$thredirect=StringMid($jsclean, 1, $ultraclean-1)
;;Msgbox(0,$ultraclean, $ultraclean)
;Msgbox(0,$thredirect, $thredirect)
$open=($getkmbinary & " " & $thredirect)
run($open)
elseif $getpos2<9 then
;Msgbox(0,$getpos, $getpos)
;Msgbox(0,"http test", "http test")
$rembog=StringTrimRight($chkurl, 4)
$stripout=StringTrimLeft($rembog, $getpos-1)
;Msgbox(0,$stripout, $stripout)
$cleanup1=StringReplace($stripout, "&param1=value1", "" )
$cleanup2=StringReplace($cleanup1, "&param2=value2", "" )
$cleanup3=StringReplace($cleanup2, "&param3=value3", "" )
$cleanup4=StringReplace($cleanup3, "&param4=value4", "" )
$cleanup5=StringReplace($cleanup4, "&param5=value5", "" )
$cleanup6=StringReplace($cleanup5, "&param6=value6", "" )
$cleanup7=StringReplace($cleanup6, "&param7=value7", "" )
$cleanup8=StringReplace($cleanup7, "&param8=value8", "" )
$cleanup9=StringReplace($cleanup8, "&param9=value9", "" )
;Msgbox(0,$cleanup9, $cleanup9)
$cleanup10=StringReplace($cleanup9, "http%3a", "http:" )
;Msgbox(0,$cleanup10, $cleanup10)
$cleanup11=StringReplace($cleanup10, "https%3a", "https:" )
$jscleanpos=StringInStr($cleanup11, "','" , "", 1)
$jsclean=StringMid($cleanup11, 1, $jscleanpos-1)
$ultraclean=StringInStr($jsclean, "%" , "", 1)
$thredirect=StringMid($jsclean, 1, $ultraclean-1)
;;Msgbox(0,$ultraclean, $ultraclean)
;Msgbox(0,$thredirect, $thredirect)
$open=($getkmbinary & " " & $thredirect)
run($open)
else
;Msgbox(0,"www first", "www first")
$rembog=StringTrimRight($chkurl, 4)
$stripout=StringTrimLeft($rembog, $getpos2-1)
$cleanup1=StringReplace($stripout, "&param1=value1", "" )
$cleanup2=StringReplace($cleanup1, "&param2=value2", "" )
$cleanup3=StringReplace($cleanup2, "&param3=value3", "" )
$cleanup4=StringReplace($cleanup3, "&param4=value4", "" )
$cleanup5=StringReplace($cleanup4, "&param5=value5", "" )
$cleanup6=StringReplace($cleanup5, "&param6=value6", "" )
$cleanup7=StringReplace($cleanup6, "&param7=value7", "" )
$cleanup8=StringReplace($cleanup7, "&param8=value8", "" )
$cleanup9=StringReplace($cleanup8, "&param9=value9", "" )
$cleanup10=StringReplace($cleanup9, "http%3a", "http:" )
$cleanup11=StringReplace($cleanup10, "https%3a", "https:" )
$jscleanpos=StringInStr($cleanup11, "','" , "", 1)
$jsclean=StringMid($cleanup11, 1, $jscleanpos-1)
$ultraclean=StringInStr($jsclean, "%" , "", 1)
$thredirect=StringMid($jsclean, 1, $ultraclean-1)
;;Msgbox(0,$ultraclean, $ultraclean)
;Msgbox(0,$thredirect, $thredirect)
$open=($getkmbinary & " " & $thredirect)
run($open)
endif
exit
endfunc


func targetclip()
if $getpos2>9 then
;Msgbox(0,"www test", "www test")
$rembog=StringTrimRight($chkurl, 4)
$stripout=StringTrimLeft($rembog, $getpos2-1)
$cleanup1=StringReplace($stripout, "&param1=value1", "" )
$cleanup2=StringReplace($cleanup1, "&param2=value2", "" )
$cleanup3=StringReplace($cleanup2, "&param3=value3", "" )
$cleanup4=StringReplace($cleanup3, "&param4=value4", "" )
$cleanup5=StringReplace($cleanup4, "&param5=value5", "" )
$cleanup6=StringReplace($cleanup5, "&param6=value6", "" )
$cleanup7=StringReplace($cleanup6, "&param7=value7", "" )
$cleanup8=StringReplace($cleanup7, "&param8=value8", "" )
$cleanup9=StringReplace($cleanup8, "&param9=value9", "" )
$cleanup10=StringReplace($cleanup9, "http%3a", "http:" )
$cleanup11=StringReplace($cleanup10, "https%3a", "https:" )
$jscleanpos=StringInStr($cleanup11, "','" , "", 1)
$jsclean=StringMid($cleanup11, 1, $jscleanpos-1)
$ultraclean=StringInStr($jsclean, "%" , "", 1)
$thredirect=StringMid($jsclean, 1, $ultraclean-1)
;;Msgbox(0,$ultraclean, $ultraclean)
;Msgbox(0,$thredirect, $thredirect)
ClipPut($thredirect)
elseif $getpos2<9 then
;Msgbox(0,$getpos, $getpos)
;Msgbox(0,"http test", "http test")
$rembog=StringTrimRight($chkurl, 4)
$stripout=StringTrimLeft($rembog, $getpos-1)
;Msgbox(0,$stripout, $stripout)
$cleanup1=StringReplace($stripout, "&param1=value1", "" )
$cleanup2=StringReplace($cleanup1, "&param2=value2", "" )
$cleanup3=StringReplace($cleanup2, "&param3=value3", "" )
$cleanup4=StringReplace($cleanup3, "&param4=value4", "" )
$cleanup5=StringReplace($cleanup4, "&param5=value5", "" )
$cleanup6=StringReplace($cleanup5, "&param6=value6", "" )
$cleanup7=StringReplace($cleanup6, "&param7=value7", "" )
$cleanup8=StringReplace($cleanup7, "&param8=value8", "" )
$cleanup9=StringReplace($cleanup8, "&param9=value9", "" )
;Msgbox(0,$cleanup9, $cleanup9)
$cleanup10=StringReplace($cleanup9, "http%3a", "http:" )
;Msgbox(0,$cleanup10, $cleanup10)
$cleanup11=StringReplace($cleanup10, "https%3a", "https:" )
$jscleanpos=StringInStr($cleanup11, "','" , "", 1)
$jsclean=StringMid($cleanup11, 1, $jscleanpos-1)
$ultraclean=StringInStr($jsclean, "%" , "", 1)
$thredirect=StringMid($jsclean, 1, $ultraclean-1)
;;Msgbox(0,$ultraclean, $ultraclean)
;Msgbox(0,$thredirect, $thredirect)
ClipPut($thredirect)
else
;Msgbox(0,"www first", "www first")
$rembog=StringTrimRight($chkurl, 4)
$stripout=StringTrimLeft($rembog, $getpos2-1)
$cleanup1=StringReplace($stripout, "&param1=value1", "" )
$cleanup2=StringReplace($cleanup1, "&param2=value2", "" )
$cleanup3=StringReplace($cleanup2, "&param3=value3", "" )
$cleanup4=StringReplace($cleanup3, "&param4=value4", "" )
$cleanup5=StringReplace($cleanup4, "&param5=value5", "" )
$cleanup6=StringReplace($cleanup5, "&param6=value6", "" )
$cleanup7=StringReplace($cleanup6, "&param7=value7", "" )
$cleanup8=StringReplace($cleanup7, "&param8=value8", "" )
$cleanup9=StringReplace($cleanup8, "&param9=value9", "" )
$cleanup10=StringReplace($cleanup9, "http%3a", "http:" )
$cleanup11=StringReplace($cleanup10, "https%3a", "https:" )
$jscleanpos=StringInStr($cleanup11, "','" , "", 1)
$jsclean=StringMid($cleanup11, 1, $jscleanpos-1)
$ultraclean=StringInStr($jsclean, "%" , "", 1)
$thredirect=StringMid($jsclean, 1, $ultraclean-1)
;;Msgbox(0,$ultraclean, $ultraclean)
;Msgbox(0,$thredirect, $thredirect)
ClipPut($thredirect)
endif
exit
endfunc



fuck shit slut cunt pussy piss are okay but po-rn and se-x are no no's?

Options: ReplyQuote
Re: Plugins and or extension like >>
Posted by: Zero3K
Date: April 15, 2014 08:37PM

It would be nice if the Clean Redirect macro was made into one that automatically cleans all redirects in the URLs on a page.

Options: ReplyQuote


K-Meleon forum is powered by Phorum.