Development :  K-Meleon Web Browser Forum
K-Meleon development related discussions. 
New macrolanguage3 in KM75
Posted by: siria
Date: September 28, 2015 09:35PM

It's great that macrolanguage gets actively developed and extended again, now generation3 smiling smiley

A bunch of those newly added macro functions is listed for KM75 here:
http://kmeleonbrowser.org/changelog.txt
and here
http://kmeleonbrowser.org/wiki/index.php?id=MacroLanguage2

But am a bit lost how they work exactly... learning slowly, bit by bit as needed...
Yesterday finally got around to try out and play with "addperm", the most exciting for me! After finally having some understanding that it's all about those gecko settings "permissions.default.xxx", which ones exist and how they work, and how site exceptions are stored (permissions.sqlite in profile), how those can be edited (extension ExExPermission or Editor-tool), the whole system got a lot clearer to me.

Now the wiki-description for this new macro command is:
Quote
km-wiki
$SUCCESS = addperm( URL, TYPE, PERMISSION, [, SESSION_ONLY] );

Add a new permission for the specified site and return true when successful.
TYPE = "cookie", "image", ...
PERMISSION = "allow", "deny", "promp"
SESSION_ONLY = If true, permission will be deleted when k-meleon is exited

Now played around with it and slowly starting to get it...
But Mozilla has 3 permission types: 1=allow / 2=block / 3=same-site
addperm has 3 too, but: 1=allow / 2=block / ??=promp (ask each time?)
Prompting sounds interesting but cannot test it on my offline Vista.
Still, could the function be extended with the "same-site" type too?
Session_only sounds like another interesting unique feature...

The element TYPES, are those restricted by "addperm" itself or is it a free VAR that can use all possible mozilla types? script, stylesheet, object, media, subdocument, refresh...

Of course, after editing sites, there should also be a way to manage those permissions later.
Only for cookies and images there is the ancient xul-editor, which is okay but so basic it's even lacking the same-site option (INT=3)
For all other types there is only ExExPermission (old version works great in KM1.6, but no idea how to get KM75-version working, download broken, and copying ExEx-files from 74+1 doesn't seem enough), or a free sqlite-editor.
Not sure which way would be best now for a (hopefully native) editor, little editors for single types like images+cookies? Or the complete ExEx-Editor, showing all permissions for 1 site together? But that thing is fascinating, and love its ultra tiny file size grinning smiley Just the layout could use some improvements to save height... and an info-button... and refresh-type is missing...

Slightly Offtopic:
does "permissions.default.refresh" work for anyone, and which KM version??
In KM1.6 it has zero effect... a little test page can be found with "schach"+"browsertest"



(sig) New unofficial K-Meleon 76.4 (KMG76.4) available, in own subforum.
Based on Goanna engine, called 'test' builds forever but more stable as 75.1 acc. forum members. It's 1-2 generations ahead of predecessor KM76RC-2016
K-Meleon FAQ (link missing in forum sidebar)
Tips&Tricks - Learning new stuff every day
New to K-Meleon? What do you like? What not?

Options: ReplyQuote
Re: New macrolanguage3 in KM75
Posted by: JamesD
Date: September 28, 2015 11:58PM

Quote
siria
A bunch of those newly added macro functions is listed for KM75 here:
http://kmeleonbrowser.org/changelog.txt
and here
http://kmeleonbrowser.org/wiki/index.php?id=MacroLanguage2

But am a bit lost how they work exactly... learning slowly, bit by bit as needed...

Feel free to ask me about the new statements in the MacroLanguage2. Most, but not all, I did test macros on before doing the documentation.

note that "$SUCCESS = addperm( URL, TYPE, PERMISSION, [, SESSION_ONLY] );" is one I just accepted Dorian's information without making my own tests.

Options: ReplyQuote
Re: New macrolanguage3 in KM75
Posted by: Yogi
Date: September 29, 2015 09:54AM

Quote
siria
After finally having some understanding that it's all about those gecko settings "permissions.default.xxx", which ones exist and how they work, and how site exceptions are stored (permissions.sqlite in profile)

Since you are at "permissions.sqlite", you might want to take a short look at this: HTTPS bent into the next super-cookies by researcher
The only way I've found for not letting sites to misuse "permissions.sqlite" was to deny writing access to the database.
The only minor drawback with denied writing access to "permissions.sqlite" I've noticed - K-Meleon will launch slightly slower.

Options: ReplyQuote
Re: New macrolanguage3 in KM75
Posted by: guenter
Date: September 29, 2015 01:44PM

Quote
Yogi
Quote
siria
After finally having some understanding that it's all about those gecko settings "permissions.default.xxx", which ones exist and how they work, and how site exceptions are stored (permissions.sqlite in profile)

Since you are at "permissions.sqlite", you might want to take a short look at this: HTTPS bent into the next super-cookies by researcher
The only way I've found for not letting sites to misuse "permissions.sqlite" was to deny writing access to the database.
The only minor drawback with denied writing access to "permissions.sqlite" I've noticed - K-Meleon will launch slightly slower.



I would not worry so much. grinning smiley

<OT RANT>

They can fingerprint Your browser anyway.


https://panopticlick.eff.org/


My score is:

Quote
panopticlick
Your browser fingerprint appears to be unique among the 5,886,870 tested so far.
Currently, we estimate that your browser has a fingerprint that conveys at least 22.49 bits of identifying information.
The measurements we used to obtain this result are listed below. You can read more about our methodology, statistical results, and some defenses against fingerprinting in this article.

If they combine that score with my IP. It is unique. But Thor and other IP changers may help?

Reading this linked article shows even another method.

Where even a Germanic god like THOR cannot smash the trackers for You.


https://nakedsecurity.sophos.com/2014/11/05/how-to-clear-out-cookies-flash-cookies-and-local-storage/

section ETags

Quote
ETags
By embedding the same file, such as a transparent image, in every web page and ensuring each new visitor is given a different ETag they could be turned in to de facto cookies - or used as a sneaky way to recreate cookies that users have deleted.

Means. They give You a file that You store in Your browser cache.

Which gives You the choice.


Squander bandwidth by reloading always all files or let them track You with an ETAG in Your browser cache.


On DSL 50 I have chosen to squander - but not all have that much DSL speed.

Other people's browser and system may not be so informative as mine.

So they need not squander so much bandwidth.

Or they are on a slow third party proxy - which excludes speed in surfing anyway.

</OT RANT>

p.s. The combination of fonts installed by You with Your programs, together with the update state and brand of browser plugins and browser makes You and Your machine traceably unique IMHO. And to browse without plugins and JavaScript ... is no fun.



Edited 2 time(s). Last edit at 09/29/2015 01:58PM by guenter.

Options: ReplyQuote
Re: New macrolanguage3 in KM75
Posted by: Yogi
Date: September 29, 2015 06:06PM

@ Guenter

Déjà vu smiling smiley We already had this kind of discusssion.
I'll try to make it short this time. smiling smiley

Some people don't bother about being tracked, others do.
For some it's funny to get all possible junk delivered via scripting while for others, fun means exactly the opposite.
As for plugins, flash plugin is the only plugin I still keep, but it's only in Opera Presto, which I use quite seldom.
One can also use different browsers or browser-profiles for different tasks.

Fingerprinting is not bulletproof, not even combined with an IP number which can be also the gateway of a network. Not to mention if you have a dynamic IP.
Besides, you can reduce fingerprinting exposure of your browser in Gecko based browsers, in internal cfg and/or by disabling scripting.
All other methods you've mentioned are easy to overcome.
One exception are HTTS cookies. There is no easy way to prevent such cookies from being stored. Such coookies aren't even mentioned by EFF. That's also the reason for my hint to Siria.

Options: ReplyQuote
Re: New macrolanguage3 in KM75
Posted by: siria
Date: September 29, 2015 06:33PM

As always, it's a personal compromise between the features you need and the intrusions you're forced to allow.
Yes WITHOUT javascript I find the web much more fun too grinning smiley
But unlike guenters banking sites I rarely need scripted sites anyway, and in that case it's a matter of 1 button click.

So far htts-cookies don't exist for me anyway - using KM1.6 :cool:
Unfortunately cannot even test in 75. But what if you define the couple site-exceptions you need and then set the file write-protected, to avoid automatic additions?



(sig) New unofficial K-Meleon 76.4 (KMG76.4) available, in own subforum.
Based on Goanna engine, called 'test' builds forever but more stable as 75.1 acc. forum members. It's 1-2 generations ahead of predecessor KM76RC-2016
K-Meleon FAQ (link missing in forum sidebar)
Tips&Tricks - Learning new stuff every day
New to K-Meleon? What do you like? What not?

Options: ReplyQuote
Re: New macrolanguage3 in KM75
Posted by: Yogi
Date: September 29, 2015 10:11PM

Quote
siria
But what if you define the couple site-exceptions you need and then set the file write-protected, to avoid automatic additions?

Call me lazy but IMHO it isn't worth the effort even to test.

Best practice is to use different browsers or browser-profiles for different tasks.
E.g. in case of your banking site, you have to drop your pants anyway. Your bank must know who operates the transaction and it's in your own interest that you get identified. Even in this scenario if your bank doesn't intermix secure and insecure connections (and they must not do so), HTTS cookies are meaningles.
As for normal browsing, HTTS cookies make little to no sense.

Options: ReplyQuote
Re: New macrolanguage3 in KM75
Posted by: guenter
Date: October 02, 2015 04:41PM

Quote
Yogi

Best practice is to use different browsers or browser-profiles for different tasks.

Same here.

p.s. Though it bugs me that I cannot switch out the elements that can be used for fingerprinting like fonts and plugins.

The only way is blocking JS for some sites and that is not always wanted.



Edited 1 time(s). Last edit at 10/02/2015 04:42PM by guenter.

Options: ReplyQuote
Re: New macrolanguage3 in KM75
Posted by: siria
Date: January 05, 2016 11:59PM

Question, running into a prob again:
Sometimes I have some text in a variable and the user shall save it into a (new or old) file of his choice. Would like to use "writefile(path,content)", but how to input the yet unknown path?

Is there any easier way than using 1) "promptforfolder" +2) "prompt" to type a filename?

Options: ReplyQuote
Re: New macrolanguage3 in KM75
Posted by: JamesD
Date: January 06, 2016 11:38AM

Quote
siria
Question, running into a prob again:
Sometimes I have some text in a variable and the user shall save it into a (new or old) file of his choice. Would like to use "writefile(path,content)", but how to input the yet unknown path?

Is there any easier way than using 1) "promptforfolder" +2) "prompt" to type a filename?

I cannot think of another way. Remember that writefile will overwrite an existing file without notice. You might need to use fileexists() and then ask user whether they wish to overwrite or append using appendfile().

Options: ReplyQuote
Re: New macrolanguage3 in KM75
Posted by: siria
Date: September 28, 2018 12:48AM

@devs
Is there any chance to improve the macros plugin to figure out if a pref exists or not?
This bug is causing me endless probs since years sad smiley
Perhaps getpref could return "undefined" or whatever instead of "false", "", or 0?

Just an example:
the well-known pref "general.useragent.override"
Only if the pref itself doesn't exist at all, KM will send the default UA.
But if the pref exists with an empty string, the useragent string will be empty too.
Macros can only ask "getpref(STRING,..." ?? and the answer will always be "empty", regardless if really empty or non-existent.

Options: ReplyQuote
Re: New macrolanguage3 in KM75
Posted by: siria
Date: September 03, 2019 02:11PM

@fellow macro writers:
Whoa, I must have missed this - or was it never announced?

In Aug.2016 (between KM76RC and KM76RC2) Dorian finally increased the LIMIT for injectJS-return and readfile!
https://github.com/roytam1/kmeleon/commit/24598b7e94e217e6bfa7c7a25e93e71b55a01290#diff-6c92aaef5e9364db2c14d3c510f65dbe

The title "increased buffer size" sounds promising, but had to take a much closer look now to figure out what it really means:
the injectJS-limit for a returned string was increased from very tiny 4kB to 32kB!
And if I read it right, the readfile-limit seems to have grown from 64kB to over a million??

Now if only there existed also some exchange variable to easily pass a string the other way around too, from macrolanguage over into js too, without needing to struggle and mess with stupid escapes, sigh...
And of course wouldn't mind getting those bigger limits in KMG74 too :cool:
And perhaps even in KM1.6 too, after adding TLS1.3 and a few other essential updates to it too... oh well.



Edited 1 time(s). Last edit at 09/03/2019 02:16PM by siria.

Options: ReplyQuote
Re: New macrolanguage3 in KM75
Posted by: roytam1
Date: September 03, 2019 02:52PM

> And perhaps even in KM1.6 too, after adding TLS1.3 and a few other essential updates to it too... oh well.

thats hard as newer NSS comes with C/C++ syntax that old MSVC compiler can't accept.

Options: ReplyQuote
Re: New macrolanguage3 in KM75
Posted by: siria
Date: September 03, 2019 09:24PM

Quote
roytam1
> And perhaps even in KM1.6 too, after adding TLS1.3 and a few other essential updates to it too... oh well.

thats hard as newer NSS comes with C/C++ syntax that old MSVC compiler can't accept.

Thanks for replying. Pity, but in that case TLS1.2 would be perfectly fine too ;-)

Even in the last few months the killing of old browsers has continued strongly.
The latest blow just yesterday: even mobile.twitter.com is now blocked completely!
Overall I feel that meanwhile 70-80% of all websites are blocked for KM1.x
Especially bothersome for browsing related stuff, like mozilla's developer domain, github, etc.
But 90-95% still show up (although sometimes messed) in your retrozilla FF2 (probably similar in Fx36).
The remaining 5-10% insisting on TLS1.3 are rather harmless so far.

Also still have hopes for KMG74 becoming fully usable some day in 98se.
The engine seems to run amazingly fine, and the crashes are much less since discovering it's mostly caused by menu stuff: by a macro which removed a menuline at startup, or by another macro adding a menuline in all uppercase (was a specific one only). The crashes didn't happen instantly, only when trying to view those menus. Wonder if perhaps those are even just caused by the normal KM-bugs in the earlier KM7x builds? Those menus were very buggy on all systems, just not crashing in newer ones, and Dorian struggled hard with finding fixes/workarounds even up to KM76.
And recently noticed: KG74 may get hickup after opening a local page? Opening the first page is fine, only afterwards opening any website by macros tends to crash. Haven't verified this one yet, only try to avoid local pages for now. Wonder if this could be related to upper-lowercase probs too, since the macro command to get the root folder path returns it in all uppercase. Overall, that is my prime suspect: perhaps simple case stuff is the core reason for crashes? Aside from lack of RAM occasionally.



Edited 1 time(s). Last edit at 09/03/2019 09:37PM by siria.

Options: ReplyQuote
Re: New macrolanguage3 in KM75 / Howto copy alert-popups
Posted by: siria
Date: October 08, 2019 02:38PM

Not really about macrolanguage, just a tip for some macros:

Did you know that on Windows systems the text of alert-popups can simply be copied with CTRL+C?!

Found this on various website, just as example here too:
https://www.raymond.cc/blog/how-to-copy-text-or-error-messages-from-any-dialog-boxes-in-windows/

Was excited to read it, but there's a little catch: it depends on the age of the system.
Works in XP SP3, but Win98SE is too old sad smiley

Anyone here who could test this in Win2000 and XP SP2 too?
Searched the web for this info, but not found yet.

Major pity that just those old systems, which could use this output-workaround most, because their old KM-version cannot return anything from injectJS, cannot use this workaround either sad smiley

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

But here's another exciting output workaround, even for the oldest Win systems:
javascript PROMPTS!
After just recently learning that they can show a multi-line info text, which is very handy for macros too, now realized they can even show a copy-able text with linebreaks in that ultrashort 1-line input field! At least if this is the default text, pre-filled by JS.
This field appears to have rectangles as linebreaks, but when copy-pasting this line into a text editor, those rectangles are automatically transformed into real linebreaks.
Also extremely helpful for such macro-workarounds in old KM:
this prompt field can contain over 32kB characters!

javascript:var x='aaa\nbbb\nccc'; prompt('test\nfor\nlinebreaks:', x);

Just wish I'd learned those tricks years ago already!



Edited 2 time(s). Last edit at 10/08/2019 03:08PM by siria.

Options: ReplyQuote
Re: New macrolanguage3 in KM75 / Howto copy alert-popups
Posted by: JohnHell
Date: October 08, 2019 04:38PM

Quote
siria
Anyone here who could test this in Win2000 and XP SP2 too?

It does work on SP2, but can't see how useful can be, beyond the system/version/troubleshot/whateverICan'tRemember info macro.

Options: ReplyQuote
Re: New macrolanguage3 in KM75 / Howto copy alert-popups
Posted by: JohnHell
Date: October 09, 2019 03:22PM

It works on 2000 too.

Options: ReplyQuote
Re: New macrolanguage3 in KM75 / Howto copy alert-popups
Posted by: siria
Date: October 09, 2019 03:43PM

Great! smiling smiley

And today I learned: the prompt length also does not depend on the KM-version at all, only on the OS!

- prompt in Windows98 (SE) can handle about 32kb input/output
- prompt in XP SP3 allows UNLIMITED length!! (or at least 1 mio, had to stop, machine too weak)

Testcode for max length:
javascript: s = prompt("a", Array(999999).join("0")); alert(s.length);


Options: ReplyQuote


K-Meleon forum is powered by Phorum.