General :
K-Meleon Web Browser Forum
General discussion about K-Meleon
Re: Shortcut to Desktop, but not for this page
Date: September 05, 2007 09:13PM
Interestingly, if you right-click the
links from the previous post you can send them to the desktop.
The macro only fails when you right-click from
within those pages.
Would this difference get us a bit closer to a solution?
________________________________
make windows xp behave
Re: Shortcut to Desktop, but not for this page
Date: September 05, 2007 10:03PM
Thanks for the report, 666.
I'll look at it. I've a suspicion...
Re: Shortcut to Desktop, but not for this page
Date: September 05, 2007 11:10PM
It might help to know that FavRenAdd will not rename and add the Microsoft Technet page either.
Re: Shortcut to Desktop, but not for this page
Date: September 06, 2007 02:35PM
I need to run the tests more but just one time gave the following results.
This test ran WScript
C:\Program Files\k-meleon\Profiles\default\ae3wngxv.slt\macros\FavRenAdd.js
C:\\Documents and Settings\\Compaq_Owner.JIM-BARBARA\\Favorites\\Unfiled_New\\Test Perigee.net.url
http://www.perigee.net/
No change in code
This test did not run WScript
C:\Program Files\k-meleon\Profiles\default\ae3wngxv.slt\macros\FavRenAdd.js
C:\\Documents and Settings\\Compaq_Owner.JIM-BARBARA\\Favorites\\Unfiled_New\\Test Microsoft ms06-045.url
http://www.microsoft.com/technet/security/bulletin/ms06-045.mspx
No change in code
This test did run WScript and did make a favorite (( NO HYPEN IN FILENAME ))
C:\Program Files\k-meleon\Profiles\default\ae3wngxv.slt\macros\FavRenAdd.js
C:\\Documents and Settings\\Compaq_Owner.JIM-BARBARA\\Favorites\\Unfiled_New\\MSB 921398.url
http://www.microsoft.com/technet/security/bulletin/ms06-045.mspx
No change in code
This test did run WScript and did make a favorite (( PARENS ARE IN FILENAME ))
C:\Program Files\k-meleon\Profiles\default\ae3wngxv.slt\macros\FavRenAdd.js
C:\\Documents and Settings\\Compaq_Owner.JIM-BARBARA\\Favorites\\Unfiled_New\\msb (921398).url
http://www.microsoft.com/technet/security/bulletin/ms06-045.mspx
No change in code
This test did run WScript and did make a favorite (( I typed both hypens this time ))
C:\Program Files\k-meleon\Profiles\default\ae3wngxv.slt\macros\FavRenAdd.js
C:\\Documents and Settings\\Compaq_Owner.JIM-BARBARA\\Favorites\\Unfiled_New\\msb - ms06-045.url
http://www.microsoft.com/technet/security/bulletin/ms06-045.mspx
No change in code
This test did not run WScript and did not make a favorite (( WHATEVER IS BETWEEN MS06 AND 045 IS NOT A HYPEN ))
C:\Program Files\k-meleon\Profiles\default\ae3wngxv.slt\macros\FavRenAdd.js
C:\\Documents and Settings\\Compaq_Owner.JIM-BARBARA\\Favorites\\Unfiled_New\\Microsoft Security Bulletin MS06-045 .url
http://www.microsoft.com/technet/security/bulletin/ms06-045.mspx
When I did not change the "-" between MS06 and 045 the job failed. The WScript did not run. When I typed the "-" the job did run. Can something on the web page look like a hypen but not be a hypen?
Re: Shortcut to Desktop, but not for this page
Date: September 06, 2007 03:10PM
Second test not conclusive.
No code change
This did not run WScript and did not make a favorite (( TWO HYPENS ?? IN FILENAME FROM WEB PAGE ))
C:\Program Files\k-meleon\Profiles\default\ae3wngxv.slt\macros\FavRenAdd.js
C:\\Documents and Settings\\Compaq_Owner.JIM-BARBARA\\Favorites\\Unfiled_New\\Activation Trojan Horse - Video demonstration - Softpedia.url
http://news.softpedia.com/news/Microsoft-Confirms-the-Windows-Activation-Trojan-Horse-54566.shtml
No code change
This did not run WScript and did not make a favorite (( I DELETED HYPENS BUT LEFT REST IN FILENAME ))
C:\Program Files\k-meleon\Profiles\default\ae3wngxv.slt\macros\FavRenAdd.js
C:\\Documents and Settings\\Compaq_Owner.JIM-BARBARA\\Favorites\\Unfiled_New\\Trojan Horse Video demonstration Softpedia.url
http://news.softpedia.com/news/Microsoft-Confirms-the-Windows-Activation-Trojan-Horse-54566.shtml
No code change
This did not run WScript and did not make a favorite (( I TYPED FILENAME WHAT ABOUT HYPENS IN URL? ))
C:\Program Files\k-meleon\Profiles\default\ae3wngxv.slt\macros\FavRenAdd.js
C:\\Documents and Settings\\Compaq_Owner.JIM-BARBARA\\Favorites\\Unfiled_New\\Softpedia test.url
http://news.softpedia.com/news/Microsoft-Confirms-the-Windows-Activation-Trojan-Horse-54566.shtml
In both cases there was a hypen just prior to an interger in a string being passed to WScript. One was in the filename and I could change that. One was in the URL and I cannot change that. In both cases the script file did not run. Could there be a problem passing the hypen interger using the exec statement?
Re: Shortcut to Desktop, but not for this page
Date: September 06, 2007 04:41PM
"Interestingly, if you right-click the links from the previous post you can send them to the desktop.
The macro only fails when you right-click from within those
pages."
SAME HERE.
Charlie
~~If it ain't broke, why screw it up?~~
Re: Shortcut to Desktop, but not for this page
Date: September 06, 2007 09:38PM
OK, I've posted a new version of
KmmShortcut.
My suspicion was right. The problem is that the length of the command line that exec() can execute is limited. I found a number of 258 characters. The new macro takes this into account. When an URL is very long - somewhat beyond 200 characters depending on your installation - it is not possible to create a shortcut. You are notified then.
Currently, I'm not sure were the 258 character limit is coming from - from exec() or from the OS. So I'm not sure either whether the magic number is valid for all versions of Windows.
When you observe that the macro doesn't create a shortcut
without notifying you that the url is too long, then please tell me. We have to reduce the magic number then.
Re: Shortcut to Desktop, but not for this page
Date: September 07, 2007 07:12PM
The new macro works perfectly on the misbehaving pages from my opening post. Thanx for the update, kko!
Re: Shortcut to Desktop, but not for this page
Posted by:
sensai
Date: September 08, 2007 03:13AM
MSDN says:
"Maximum Path Length
In the Windows API, the maximum length for a path is MAX_PATH, which is defined as 260 characters. A path is structured in the following order: drive letter, colon, backslash, components separated by backslashes, and a null-terminating character, for example, the maximum path on the D drive is D:\<256 chars>NUL.
The Unicode versions of several functions permit a maximum path length of approximately 32,000 characters composed of components up to 255 characters in length. To specify that kind of path, use the "\\?\" prefix.
Note The maximum path of 32,000 characters is approximate, because the "\\?\" prefix can be expanded to a longer string, and the expansion applies to the total length.
For example, "\\?\D:\<path>". To specify such a UNC path, use the "\\?\UNC\" prefix. For example, "\\?\UNC\<server>\<share>". These prefixes are not used as part of the path itself. They indicate that the path should be passed to the system with minimal modification, which means that you cannot use forward slashes to represent path separators, or a period to represent the current directory. Also, you cannot use the "\\?\" prefix with a relative path. Relative paths are limited to MAX_PATH characters.
When using the API to create a directory, the specified path cannot be so long that you cannot not append an 8.3 file name.
The shell and the file system may have different requirements. It is possible to create a path with the API that the shell UI cannot handle......"
HTH
Re: Shortcut to Desktop, but not for this page
Date: September 08, 2007 05:28AM
Thanks kko,
The Shortcut to Desktop seems to be working great now.
Charlie
~~If it ain't broke, why screw it up?~~
Re: Shortcut to Desktop, but not for this page
Date: September 08, 2007 01:55PM
Quote
kko
Currently, I'm not sure were the 258 character limit is coming from - from exec() or from the OS. So I'm not sure either whether the magic number is valid for all versions of Windows.
It's partly from both. As sensai mentioned, there's a 260-char limit on paths specified by MAX_PATH. The problem is that K-Meleon uses this value as the buffer size, which would only be OK if there was no command line args.
Re: Shortcut to Desktop, but not for this page
Date: September 08, 2007 03:26PM
Oops! Spoke too soon. The macro still needs some cleaning up.
The short URL http://www.freepops.org/en/ gives me a "URL too long" error.
Edited 2 time(s). Last edit at 09/10/2007 01:08PM by 666.
Re: Shortcut to Desktop, but not for this page
Date: September 08, 2007 11:25PM
Works for [www.freepops.org] here.
Charlie
~~If it ain't broke, why screw it up?~~
Re: Shortcut to Desktop, but not for this page
Date: September 10, 2007 01:07PM
url:
http://openphoto.net/
error message:
Unable to create shortcut - URL too long!
http://openphoto.net/gallery/index.html?org_id=29 is longer, but the macro has no problem with this one!
My copy of the macro (freshly re-copied from kmeleon.sourceforge.net) chokes in what looks like a random fashion, which has nothing to do with the length of the URL.
________________________________
make windows xp behave
Re: Shortcut to Desktop, but not for this page
Date: September 10, 2007 01:14PM
I think I found the problem:
Any URL that ends with a slash ("/") resists the "shortcut to desktop" macro.
Re: Shortcut to Desktop, but not for this page
Date: September 10, 2007 01:40PM
Good find
p.s. A call ending with a slash tries to create a list of the files in a directory.
Can that cause it by trying to get too many data?
Edited 1 time(s). Last edit at 09/10/2007 01:41PM by guenter.
Re: Shortcut to Desktop, but not for this page
Date: September 10, 2007 04:04PM
sensai & rmn: Thanks for the info.
Quote
666
I think I found the problem:
Any URL that ends with a slash ("/") resists the "shortcut to desktop" macro.
Sorry, I should have tested with km 1.1 (migrated to 1.5 recently which doesn't show this problem).
I've put up a new version. Minor correction in the script too (not related to this problem).
Hope it works now.
Re: Shortcut to Desktop, but not for this page
Date: September 13, 2007 05:23AM
Seems like everything's fixed. Thanx!
________________________________
make windows xp behave