Extensions :  K-Meleon Web Browser Forum
All about K-Meleon extensions. 
Pages: Previous12345Next
Current Page: 2 of 5
Re: macro troubleshoot_prefs (no change, only to check) (V5)
Posted by: anonymous
Date: November 14, 2017 11:05PM

Test for KM 1.6:
$INTVERSION=iniread("Version","LastVersion","",getfolder(ProfileFolder)."\\version.ini");
$_k=injectJS("(function(){var x=(".$INTVERSION.").toString(16);return(x.substr(0,1)+'.'+parseInt(x.substr(1,2),0)+'.'+parseInt(x.substr(3,7),0))})()");


Options: ReplyQuote
Re: macro troubleshoot_prefs (no change, only to check) (V5)
Posted by: siria
Date: November 16, 2017 01:20AM

It works, cool. Things can be so easy with expert skills :cool:
Assuming it will also work in 76?

Still working at finishing that macro, but while you're here:
Adding Favorites (IE) still has a prehistoric GUI as far as I know (been awhile that I last tested on a 7X beta), tossing everything into a fix "new folder". Years ago James and I struggled mighty with workarounds with helper macros, but they have the prob that there's no real refresh-menu command. Any chance that could be added?
Of course, updating the Fav plugin with a better GUI too would be yet better.
And actually I've always liked most an ancient Favorites macro, that uses a wscript or something that calls the native IE dialog for adding new Favorites. Had rewritten and extended it to my likes.
The prob is, it only works on my old system here, but 'modern' Vista refused it, no permission sad smiley Perhaps you know an easy solution too...?



Edited 1 time(s). Last edit at 11/16/2017 01:23AM by siria.

Options: ReplyQuote
Re: macro troubleshoot_prefs (no change, only to check) (V5)
Posted by: rodocop
Date: November 16, 2017 01:35AM

Heh,
siria - here my new stuff goes!

Look: there was even an example of creating URL routine.

so this command
exec($CHPpath." ".$NIRpath." urlshortcut \"http://www.nirsoft.net\" \"~$folder.favorites$\" \"NirSoft\" ");
will create URL-shortcut to NirSoft homepage in Favorites folder.

And you know how to get URL and TITLE for current page! ;-)



Edited 1 time(s). Last edit at 11/16/2017 01:36AM by rodocop.

Options: ReplyQuote
Re: macro troubleshoot_prefs (no change, only to check) (V5)
Posted by: siria
Date: November 16, 2017 02:03AM

May be, but am just not a fan of needing external tools. Would rather have it all done 'internally'...

Ah sorry, and yet another old struggle:
Sometimes in macros I needed to transfer long text strings (whole pages) between macro-vars and injectJS back and forth and back again, for example for regex-replacements etc., but kept running into probs with special characters being treated as syntax by JS. Again, struggled FOREVER with trying to escape them one by one, due to JS and my genes not being compatible at all, and lost hundreds of gray hairs sad smiley In the end it somehow worked, but probably just luck and not reliable. Not sure if possible, but if macrolanguage could get a solution for this somehow that would be great too.

Another old prob (sigh, so many), sometimes in macros I'd like to show some var-text in a new empty browser page, but without saving it to disk first (or at least only to a cache folder). In older KM versions it worked with opening a new tab and injecting "document.write" (if I remember right? And possibly the "new tab" had to be created by JS too, and that required again popup permission, and...) But in 7X-betas there were again new stupid permission probs. Another endless struggle, and really can't remember the outcome anymore, but anyway. Such a function is on my macrolanguage-wishlist too :cool:

Options: ReplyQuote
Re: macro troubleshoot_prefs (no change, only to check) (V5)
Posted by: JohnHell
Date: November 16, 2017 02:16AM

The permissions problems are with the OS, not K-meleon.

Options: ReplyQuote
Re: macro troubleshoot_prefs (no change, only to check) (V5)
Posted by: siria
Date: November 16, 2017 11:55AM

Yes am aware, but not sure if that necessarily means there are no workarounds at all possible. FF addons can do all sorts of stuff that is forbidden to normal macros.

Quote
rodocop
so this command
exec($CHPpath." ".$NIRpath." urlshortcut \"http://www.nirsoft.net\" \"~$folder.favorites$\" \"NirSoft\" ");
will create URL-shortcut to NirSoft homepage in Favorites folder. ;-)

Just remembered: my old Favinia macro writes them too, anywhere, all by itself smiling smiley Simple little text files like ini's. No external tools needed at all.
Just no idea if it still works flawlessly on highly complicated modern systems/geckos. But anyway, for now have given up struggling too much with those, way over my head, and own machines.
As for using this method to add favorites, am doing that when saving one directly into a folder 'outside' IE faves. Or when saving "all open tabs" into a Fav folder (which must already exist before). While for inside-additions the native GUI is nicer. And both methods just don't update the KM-Fav-menu. The refresh-workaround of others with first adding a fake using the Fav-plugin and then deleting this one again, is too 'hot' for my skills, the last thing I'd want to risk is accidentally deleting something wrong.

Options: ReplyQuote
Re: macro troubleshoot_prefs (no change, only to check) (V5)
Posted by: anonymous
Date: November 16, 2017 09:08PM

Test for KM 1.5.21, KM 1.6.x and KM 76.x:
(Popup included for injectJS_v1.5 without return.)
injectJS("(function(){var x=(".$INTVERSION.").toString(16);if(x.substr(0,1)==2){x=((parseInt(x.substr(0,1),0)+5)+''+(parseInt(x.substr(1,2),0)+3)+'.'+parseInt(x.substr(3,7),0))}else{x=(x.substr(0,1)+'.'+parseInt(x.substr(1,2),0)+'.'+parseInt(x.substr(3,7),0));}x='K-Meleon Version: '+x;alert(x);})()");


Options: ReplyQuote
Re: macro troubleshoot_prefs (no change, only to check) (V5)
Posted by: siria
Date: November 17, 2017 02:56AM

Anyone have me some version numbers for 74, 75, 75.1 handy?
in profile/version.ini -> LastVersion

Options: ReplyQuote
Re: macro troubleshoot_prefs (no change, only to check) (V5)
Posted by: rodocop
Date: November 17, 2017 09:34AM

KM 74 final:

platform.ini
[Build]
BuildID=20140803202131
Milestone=24.7.0
SourceStamp=bce71a749a08

version.ini
[Version]
LastVersion=33554450

KM 75 final:

platform.ini
[Build]
BuildID=20150426163313
Milestone=31.6.0
SourceStamp=ac9794c078ff
version.ini
[Version]
LastVersion=33619975

KM 75.1 final:

platform.ini
[Build]
BuildID=20150815021428
Milestone=31.8.0
SourceStamp=777e60ca8853

version.ini
[Version]
LastVersion=33685509



Edited 5 time(s). Last edit at 11/17/2017 09:41AM by rodocop.

Options: ReplyQuote
Re: macro troubleshoot_prefs (no change, only to check) (V5)
Posted by: siria
Date: November 17, 2017 11:49AM

Thank you smiling smiley That converts hex/decimal to:
# 17104933 => 1050025 => 1.5.0025 => KM 1.5.3 + 1.5.4 RC or final +?
# 17170436 => 1060004 => 1.6.0004 => KM ALL 1.6alphabeta+CCFME + KM1.7alpha
# 33554450 => 2000012 => 2.0.0012 => KM 74 final (g-20140803202131 / 24.7.0)
# 33619975 => 2010007 => 2.1.0007 => KM 75 final +Pro +? (g-20150426163313 / 31.6.0)
# 33685509 => 2020005 => 2.2.0005 => KM 75.1 final +Pro +? (g-20150815021428 / 31.8.0)
# 33751044 => 2030004 => 2.3.0004 => KM 76b3u1, 76b3u2

Thinking about it, the forks would be interesting too...



Edited 2 time(s). Last edit at 11/17/2017 12:00PM by siria.

Options: ReplyQuote
Re: macro troubleshoot_prefs (no change, only to check) (V5)
Posted by: rodocop
Date: November 17, 2017 12:43PM

Well,

adodupan's KM 1.8b24

platform.ini
[Build]
BuildID=20140301194541
Milestone=24.3.0
SourceStamp=cd943018fd5b

version.ini
[Version]
LastVersion=33554439

naruman's KM 74+1 (v.7, last)

all the same as KM 74 final.



Edited 3 time(s). Last edit at 11/17/2017 12:45PM by rodocop.

Options: ReplyQuote
Re: macro troubleshoot_prefs (no change, only to check) (V5)
Posted by: siria
Date: November 17, 2017 04:34PM

@rodocop
thanks, and is there anything unique in your Pro versions, that a macro could check via readfile perhaps? If a certain file exists, or a certain text inside? In readme? A pref? A skin pic? Or could also be something in omni.ja.

Options: ReplyQuote
Re: macro troubleshoot_prefs (no change, only to check) (V5)
Posted by: rodocop
Date: November 17, 2017 08:18PM

Almost nothing.
Nothing what could be read through macro.

Just small kmeleonMain.js in components inside omni.ja

But reading platform.ini edited from now according to your advice will be enough to separate Pro-build from official one.



Edited 1 time(s). Last edit at 11/17/2017 08:18PM by rodocop.

Options: ReplyQuote
Re: macro troubleshoot_prefs (no change, only to check) (V5)
Posted by: siria
Date: November 17, 2017 08:43PM

Yeah but that platform.ini is not official, will only work in this macro.
There are also the titles in readme.html, and the vendor-pref.

Can macros really not read omni.ja? Have no idea, but don't wanna give up without at least a little test ;-)
The test file is a normal one that should exist in official KM too:

testmacro_omnija{
# KM-PRO: \\components\\KmeleonMain.js");
$_x=readfile(getfolder(RootFolder)."\\browser\\components\\kmHelper.manifest");
$_x=="" ? $_y="v2:" : $_y="v1:";
$_x==""? $_x=readfile(getfolder(RootFolder)."\\browser\\omni.ja\\components\\kmHelper.manifest") : 0;
$_x=="" ? $_x="cannot read :-(" : $_x=substr($_x,0,500)." (....)";
alert($_y."\n".$_x,"File kmHelper.manifest in omni.ja:",INFO);
}

testmacro_omnija_BuildMenu{
setmenu(KMDocs,macro,"Troubleshooting: test file in OMNI.JA",testmacro_omnija);
}
$OnInit=$OnInit."testmacro_omnija_BuildMenu;";

Options: ReplyQuote
Re: macro troubleshoot_prefs (no change, only to check) (V5)
Posted by: rodocop
Date: November 17, 2017 08:46PM

Macros surely can - as that 'resource://' URL is pointed inside root of omni.ja exactly!

Options: ReplyQuote
Re: macro troubleshoot_prefs (no change, only to check) (V5)
Posted by: siria
Date: November 17, 2017 08:56PM

LOL! Just the last days have I looked at that resource-stuff again - and now already forgotten!

Options: ReplyQuote
Re: macro troubleshoot_prefs (no change, only to check) (V5)
Posted by: siria
Date: November 17, 2017 09:30PM

No idea what I'm doing wrong, but just cannot read it sad smiley
Tested in KM1.6 with existing default files.
But neither any URLs starting with resource:/// nor resource:\\ don't work, nor reading from inside a jar file, like getfolder(RootFolder)."\\chrome\\kmprefs\\locale\\en-US\\contents.rdf"

Options: ReplyQuote
Re: macro troubleshoot_prefs (no change, only to check) (V5)
Posted by: anonymous
Date: November 17, 2017 09:33PM

Some early versions with date of K*.exe.
The same Gecko 25 version with four different browsers:
17170432 0x1060000  KM 74 BuildID=20131025151332 Milestone=25.0 2013-11-03, 2013-11-06
1241513987 0x4A000003 KM 74 BuildID=20131025151332 Milestone=25.0 2013-11-18, 2013-12-26

Gecko 24:
33554436 0x2000004  KM 74 B  Gecko 24.2.0.5118 2014-01-13
33554436 0x2000004  KM 74 B2 BuildID=20140204005730 Milestone=24.3.0 2014-02-08
33554438 0x2000006  KM 74 B3 BuildID=20140301194541 Milestone=24.3.0 2014-03-08
33554439 0x2000007  KM 74 B4 BuildID=20140529202211 Milestone=24.6.0esrpre 2014-05-01

Gecko 30:
33554439 0x2000007  KM 74 b4 BuildID=20140612234948 Milestone=30.0 2014-06-13


Options: ReplyQuote
Re: macro troubleshoot_prefs (no change, only to check) (V5)
Posted by: rodocop
Date: November 17, 2017 09:39PM

Nobody is perfect! (c) grinning smiley

OFFTOPIC MODE ON
---------------------
Today I was also stupid - and presenting the extension which was the first use of new KMM_TASK_LOGIC tool I've simply forgotten to add that exe into 7z-package!!!

Now my mistake is fixed, but...

But this isn't the greatest illustration however!
One russian user (she's a lady, wow-wow-wow! But I'm not sexist, you know ) tried to install that extension and she got BIG TROUBLE.

Empty KM window (no toolbars, menus - no any chrome at all!) XML-errors and full breakage!

She said it gets so after installing my extension. I questioned her deeply and finally she described me how she proceeded there:

"I deleted folders browser, kmextensions, locales, macros, skins, tools from K-Meleon and replaced them with ones from extension - so then I got this! 3 times!!!"

I was hardly able to write a word in answer! ;-)

So, again - nobody is perfect.
--------------------------------------------------------------
OFFTOPIC MODE OFF



Edited 1 time(s). Last edit at 11/17/2017 09:40PM by rodocop.

Options: ReplyQuote
Re: macro troubleshoot_prefs (no change, only to check) (V6)
Posted by: siria
Date: November 18, 2017 12:15AM

Quote
rodocop
"I deleted folders browser, kmextensions, locales, macros, skins, tools from K-Meleon and replaced them with ones from extension - so then I got this! 3 times!!!"
I was hardly able to write a word in answer! ;-)

I can imagine that grinning smiley Incredible... LOL!!
But this is someone I'd most warmly recommand one of the fully automatic big player browsers

Regarding the macro, am a bit stuck - due to that version circus that cute little puppy macro has grown into a Bernhardiner dog, oh my... at the moment a big mess, which does work, but not happy yet with its clumsiness and looks.
Anyway, attached below is the latest version v6 for checking.
At the moment also contains a second menuline if anyone is curious about converting any copied version-ini number from hex to dec format. Will hide that later again in the final (??) version.



Edited 1 time(s). Last edit at 08/25/2018 09:35PM by siria.

Options: ReplyQuote
Re: macro troubleshoot_prefs (no change, only to check) (V5)
Posted by: rodocop
Date: November 18, 2017 01:02AM

Quote
anonymous
Some early versions with date of K*.exe.

Great stuff!!! KM74-30!!! Played with it comparatively long time!

But I have something even more unusual!

KM74-31esr!!!
[Build]
BuildID=20140927181416
Milestone=31.1.2
[Version]
LastVersion=50331648

KM 1.8.0b17 (adodupan)
[Build]
BuildID=20131112160018
Milestone=25.0.1
[Version]
LastVersion=1241513987



Edited 3 time(s). Last edit at 11/18/2017 01:08AM by rodocop.

Options: ReplyQuote
Re: macro troubleshoot_prefs (no change, only to check) (V6)
Posted by: rodocop
Date: November 18, 2017 01:15AM

Quote
siria
But this is someone I'd most warmly recommand one of the fully automatic big player browsers

Well, I wouldn't agree this time - this is an example of IDEAL potentially loyal user of K-Meleon.

She tried number of times!
She regged on forum for help!
She was waiting about 2 weeks for solution.

And finally she installed KM for 2 older people! Ready evangelist of our project!

Moreover: without her appearance there on forum I will never (most likely) create such an extension! And her feedback forced me to check things and find my own STUPID mistake!!!

I respect her as much as I can!



Edited 1 time(s). Last edit at 11/18/2017 01:16AM by rodocop.

Options: ReplyQuote
Re: macro troubleshoot_prefs (no change, only to check) (V6)
Posted by: rodocop
Date: November 18, 2017 01:59AM

Quote
siria
Anyway, attached BELOW is the latest version v6 for checking.

Tested and being thinking about end-user usability made 2 quick changes (lines 73-78):
if (confirm($_x."\n\n        =====  Show more ? =====","V5 - Check current settings  (Text copied to clipboard):",OKCANCEL,INFO)=="OK") {  $_x="";
	opennew("about:");
	opentab("about:config");
	opentab("about:permissions");
	opentab("about:addons");
	opennew("chrome://console2/content/console2.xul");

1) Now all new helper tabs open in new window (they can be easily lost in current windows with dozens of tabs - and I do 'lost' them!)
2) Error Console also opens in it's own window as otherwise it resizes all the browser to its small size and user get lost again - what the hell is going on?!

Now it looks much better! ;-)

Also changed V5 to V6 and some strings:





Edited 1 time(s). Last edit at 11/18/2017 02:11AM by rodocop.

Options: ReplyQuote
Re: macro troubleshoot_prefs (no change, only to check) (V6)
Posted by: siria
Date: November 18, 2017 07:40AM

Thanks, will consider.
But you caught the old version again, from first post, instead of the one at the LAST post directly. v6 was already in my download correct :cool:

The new ini-numbers you both posted convert to weird decimals:
1.6.0000 .... 3.0.0000 .... 4.(notanumber). ..... Uh oh *scratchhead*



Edited 1 time(s). Last edit at 11/18/2017 07:48AM by siria.

Options: ReplyQuote
Re: macro troubleshoot_prefs (no change, only to check) (V6)
Posted by: rodocop
Date: November 18, 2017 10:30AM

Oh, I've got it! Nobody is perfect once again!!! ;-)

Let's go on.

Fred KM-16-S2014
[Build]
BuildID=20110301215306
Milestone=1.9.1.18pre
[Version]
LastVersion=17170436

Fred KM-16-F3628

Has no platform.ini and the same LastVersion=17170436 while it has really different core (1.7 exe not 1.6)

And the same refers to KM CCF ME 0.097



Edited 3 time(s). Last edit at 11/18/2017 10:31AM by rodocop.

Options: ReplyQuote
Re: macro troubleshoot_prefs (no change, only to check) (V6)
Posted by: anonymous
Date: November 18, 2017 10:03PM

@rodocop
Fred uploaded dozens of packages using parts of newest Geckos. Package names contain S for Seamonkey or F for Firefox. He updated timestamps and added his varying custom configurations.

@siria
Macros kplugin has no library to read compressed files and the basic "readfile" command only reads text from filesystem.

Options: ReplyQuote
Re: macro troubleshoot_prefs (no change, only to check) (V6)
Posted by: siria
Date: November 19, 2017 12:45AM

While opening my older KM versions again one of my pet error messages showed up again:
"Call to the undefined macro"! Grmpf.
Always wished it had the kindness to reveal also WHICH one exactly, sigh.

Quote
anonymous
Macros kplugin has no library to read compressed files and the basic "readfile" command only reads text from filesystem.

Ok, thanks for explaining.

Rodocop, please please please remove that UA file from omni.ja? :cool:
You can test if it still works (99%?) or not after moving it into browser/components/... as single file. And if a less misleading name would work too...

Options: ReplyQuote
Re: macro troubleshoot_prefs (no change, only to check) (V6)
Posted by: anonymous
Date: November 19, 2017 01:45AM

@siria
"Call to the undefined macro"
Never wrote a macro causing this error, but you can paste yours.
It would be nice to see how it was fixed in 2.x versions.

You can use injectJS to access omni.ja and create a popup showing what is requested.

Options: ReplyQuote
Re: macro troubleshoot_prefs (no change, only to check) (V6)
Posted by: siria
Date: November 19, 2017 08:21AM

The undefined macro: this always happens when there's a typo in a macro name, which is called by another.
Was it ever fixed? When I wrote "in my older versions" it just meant that "currently" there's no name typo in my active macros. It's hard enough figuring it out in a new in-the-works macro that contains dozends of submacros, but at least I'd be aware at which one I'm currently working, and it didn't produce this error an hour earlier yet. But in those older KM versions I wouldn't even know where to start searching, could be in ALL kmm macros, so would first have to disable half of them for testing.

callmacroone{
&callmacro2;
}
callmacrotwo{
$_x="test";
}

_callmacro_BuildMenu{
setmenu("&Help",macro,"Call macro1 (no error at all)","callmacro1",0);
setmenu("&Help",macro,"Call macroone-macro2 (error undefined)","callmacroone",1);
}
$OnInit=$OnInit."_callmacro_BuildMenu;";


----------
UPDATE:
simply check or create that pref and suddenly that error WILL show the LINE numbers causing it!!
kmeleon.plugins.macros.debug = true
----------

How's that injectJS done with omni.ja?



Edited 3 time(s). Last edit at 11/25/2017 07:07AM by siria.

Options: ReplyQuote
Re: macro troubleshoot_prefs (no change, only to check) (V6)
Posted by: anonymous
Date: November 19, 2017 06:15PM

@siria
Your example works perfect.
The name of the invalid macro call was missing in "EvalError" at line 333.
----------
Something in browser/omni.ja of 76RC:
$mypath="chrome://kmprefs/content/contents.rdf";
injectJS("(function(){var rX=new XMLHttpRequest();rX.open('GET','".$mypath."',true);rX.onreadystatechange=function(){if(rX.readyState===4){if(rX.status===200||rX.status==0){var rT=rX.responseText;alert(rT);}}};rX.send(null);})();");


Options: ReplyQuote
Pages: Previous12345Next
Current Page: 2 of 5


K-Meleon forum is powered by Phorum.