alto_contraste{
$jsison = getpref(BOOL,$jscript);
$jsison == false ? &JSToggle : 0 ;
injectJS("function kmbody(){var body; var num = 0; var cuantos; body = document.getElementsByTagName('*'); cuantos = document.getElementsByTagName('*').length; while(num<cuantos){body[num].style.backgroundImage = 'url(none)'; body[num].style.backgroundColor = '#858585'; body[num].style.color = '#000000'; if(body[num].href){body[num].style.backgroundColor = '#808090'} num++;}}");
open("javascript:kmbody();");
$jsison == false ? &JSToggle : 0 ;
}
Quote
siria
Regarding your macro lines, sorry no idea if this helps, but can't harm to try with the default commands from main.kmm:
"$jscript" is there "$pref_JavaScript"
"&JSToggle" is called "&pref_ToggleJavaScript"
Quote
By the way, since your example script is only changing styles, there's a good chance it may even run without unblocking javascript (I'm talking the 'normal' JS block from the priv-menu here, not that deadly CAPS-blocking thing)
Am testing via macro javascriptia, to avoid a hundred restarts. And I need to split JS code into lines, or don't understand even what little I understand of it. Anyway, this way your code actually works in this very forum, but only if I add "kmbody();" at the end of it. JS-block doesn't seem to matter.
Change the ending to:Quote
JohnHell
injectJS("function kmbody(){var body; var num = 0; var cuantos; body = document.getElementsByTagName('*'); cuantos = document.getElementsByTagName('*').length; while(num<cuantos){body[num].style.backgroundImage = 'url(none)'; body[num].style.backgroundColor = '#858585'; body[num].style.color = '#000000'; if(body[num].href){body[num].style.backgroundColor = '#808090'} num++;}}");
this macro IS NOT SITE SPECIFIC.Quote
JohnHell
this macro IS NOT SITE SPECIFIC.
pref_ToggleJavaScript{
macroinfo=_("Toggle JavaScript execution");
menuchecked=!getpref(BOOL,$pref_JavaScript);
togglepref(BOOL,$pref_JavaScript); &_pref_SyncButtons;
statusbar(sub("%s",!getpref(BOOL,$pref_JavaScript)?$off:$on,_("JavaScript execution %s")));
}
JSToggle{
togglepref(BOOL,$jscript); &PrivacySync;
statusbar(sub("%s",getpref(BOOL,$jscript)==false?$OFF:$ON,_("JavaScript execution %s")));
}
Quote
JohnHell
What is CAPS?
user_pref("capability.policy.default.javascript.enabled", "noAccess");
user_pref("capability.policy.default.javascript.enabled", "allAccess");
javascript.enabled boolean true/false
JS_hndlTop{
# Same as JS_hndlDoc, but only for the topmost frame (to avoid cross site scripting).
$FlipFlip = false;
getpref( STRING, "capability.policy.default.javascript.enabled")=="noAccess" ? $FlipFlip=true : 0 ;
$FlipFlip == true ? togglepref( STRING, "capability.policy.default.javascript.enabled", "noAccess", "allAccess") : 0;
injectJS("(function(){".$JS_func.$_JS_urlencode."with(document){".$JS_doit."}".$JS_last."})()");
$FlipFlip == true ? togglepref( STRING, "capability.policy.default.javascript.enabled", "noAccess", "allAccess") : 0;
$JS_doit=""; $JS_func=""; $JS_last=""; $JS_fail="";
}
Quote
JohnHell
In other words, what is the default value for capability.policy.default.javascript.enabled? Is set to noAccess?
From what it says here, javascript.enable value is over policies. Do I still need to play with that capability.policy.default.javascript.enabled pref?
But frankly, I have hardly ever trouble with that stuff. It happens rarely and I know how to work around in seconds, so no stress. BTW my mouse does not disappear when typing in the URL bar.
Quote
why now is not accepted "javascript:whatever_function_to_run();" as URL?
But only if you have javascript fully enabled, otherwise "javascript:" in URL bar is blocked. And it also doesn't work from urlbar if the setting to "open Typed URLs" is set to open "in a new page".
No, not the single commands in it, but the whole system in itself with macros.cfg and such. You'd really save a lot of time and gray hairs the quicker you switch to the modern macro version, and get tons of *working* new macros at that ;-)Quote
siria
Oh my, that's just way too long and complicated to discuss everything...
But I guess the main problem is just that you insist on using stoneage macros.cfg for all eternity, struggling for hundreds of hours and getting a hundred gray hears, instead of finally giving in and spending some ten hours in transfering your macros.cfg into a JohnHell.kmm file![]()
Quote
siria
Oh well. Lets still see some of the points: Those little bugs that you mention like needing to click in a page or such, that's just that, beta bugs. Due to new gecko. First dorian fixed some, then desga, currently deadlock. You know yourself this is still a slightly buggy beta version, so no reason to condemn all KM versions younger than 1.0 generally as unhandable. Those bugs are due to beta state, wait with condemning until the next stable version is out, if it still contains those bugsBut frankly, I have hardly ever trouble with that stuff. It happens rarely and I know how to work around in seconds, so no stress. BTW my mouse does not disappear when typing in the URL bar.
Quote
siria
What I changed to enable javascript? Really nothing. What I tried to tell 3 times already: there is nowadays a built-in exception rule for the injectJS command. JS is toggled automatically if an injectJS is fired. But with those exceptions allowing only less dangerous commands, like zooming or changing css styles, page titles and such. You can simply delete the JStoggle lines for the given example script. Well, this goes of course for my "current" macro system, no idea if it also goes for sort of "legacy macro emulation" on new KM versions. That may not work anymore 100% perfect 5 years later.
)
Quote
siria
About CAPS policies: Yep, as James said too, if you don't use Policy Manager, it's almost sure you don't need to think about CAPS stuff.
Okay, I digged up an old 1.0x version of mine and looked inside macros.cfg, to see which pref it really toggles. And it's still the same as today. No caps, no worries. So forget that I mentioned caps.
Quote
siria
Quote
why now is not accepted "javascript:whatever_function_to_run();" as URL?
Sure it isBut only if you have javascript fully enabled, otherwise "javascript:" in URL bar is blocked. And it also doesn't work from urlbar if the setting to "open Typed URLs" is set to open "in a new page".
I also suspect, if you have the "define kmbody" and the "execute kmbody" split up into two separate actions, and JS is toggled on-off-on-off, the script may well be killed in the middle, and the definition of kmbody forgotten again. So would much rather leave it "in one piece" in one injectJS line.
Quote
siria
So, the question is what happens if you only keep the extended js-line, delete the toggle lines, restart KM, allow JS manually, then run the macro? Does it work at all if JS is fully allowed?? If not, I'm going to blame your legacy modeNo, not the single commands in it, but the whole system in itself with macros.cfg and such. You'd really save a lot of time and gray hairs the quicker you switch to the modern macro version, and get tons of *working* new macros at that ;-)
No idea how you managed that, never happened to me. Perhaps the special characters somehow? Not really, if enter wasn't pressed, huh? But it's known that there are some bugs with urlbar in 1.6beta. Just not such spectacular crashes live on video, LOL! PS: deadlock figured out just days ago that in certain cases it's due to huge history files.
Quote
JohnHell
Old macros = new macros with different definition styles. They do exactly the same.
Quote
JohnHell
I know, and that is why I find less than funny to find asking what reasons are to still using old versions.
E.g. KM154 works quite well, apart from the increasing "outdated gecko" probs. But in yet older versions those probs certainly are more, not less.
Quote
JohnHell
When K-meleon gets stuck at 100% CPU load and the only way to continue using it is close it... what is the workaround? Please, tell me, because, right now, this is the most annoying thing with 1.6b2.
But the bug as you describe it exactly is rather unknown to me, sorry. Yeah it does exist, have read about it from others too in this forum.
Quote
JohnHell
The first time I hear there is no need to enable javascript to use injectJS. And, hey!, it's true.
Quote
JohnHell
But you told me. You assumed I was using it. Why?
Quote
JohnHell
why now is not accepted "javascript:whatever_function_to_run();" as URL?
Quote
JohnHell
But I don't toggle on-off continuously. Have a look, again, to my code. I just toggle on, inject code, let run code, toggle off.
Quote
JohnHell
Never, never, can this kill a script. Unless the toggle off is being run before wait until script finishes. This behavior is correctly made by 1.1.x, why not in 1.6b2?
BTW you mentioned jit, that's also one of the things I've disabled on my oldie machine.
Quote
JohnHell
What do you have against old macro definition if they do exactly the same?
Quote
siria
Hey, cool video!No idea how you managed that, never happened to me. Perhaps the special characters somehow? Not really, if enter wasn't pressed, huh? But it's known that there are some bugs with urlbar in 1.6beta. Just not such spectacular crashes live on video, LOL! PS: deadlock figured out just days ago that in certain cases it's due to huge history files.
Quote
siria
How come I have a hard time believing you "exactly the same"? Ah yes - because the very same code lines work fine in a "normal" macro environment and not in a "legacy emulation" environment?? That's the only difference, or do you know another? If the code itself is the same?
Quote
siria
100% cpu load bug
Quote
siria
Yeah, it would easier be found on macrolanguage2 page. But frankly, how often and thoroughly you study that one??
Quote
siria
Quote
JohnHell
why now is not accepted "javascript:whatever_function_to_run();" as URL?
Quote
JohnHell
But I don't toggle on-off continuously. Have a look, again, to my code. I just toggle on, inject code, let run code, toggle off.
At first, yes, but then you posted about "javascript:whatever_function_to_run();" as URL. So that sounds as injecting the last part via URLbar now instead of via injectJS. If that was just a misunderstanding, all the better.
And it was before disable javascript. So no harm.
Quote
siria
Quote
JohnHell
Never, never, can this kill a script. Unless the toggle off is being run before wait until script finishes. This behavior is correctly made by 1.1.x, why not in 1.6b2?
It does work in 1.6b2, must be some other reason in your setup...![]()
BTW you mentioned jit, that's also one of the things I've disabled on my oldie machine.
Quote
siria
Quote
JohnHell
What do you have against old macro definition if they do exactly the same?
Oh nothing. Just can't help getting the impression that they don't quite exactly do the same in our 1.6b2 browsers. It works on mine. It works not on yours. "Exactly the same"?? *whistle*

Who knows - perhaps that history bug is also responsible for other weird crashes?? Can only tell that it happens extremely rarely to my, and my history is quite short)