General :  K-Meleon Web Browser Forum
General discussion about K-Meleon 
Javascript problems
Posted by: Slickone
Date: March 26, 2019 11:10PM

There are a lot pages that have javascript buttons and links where none of them work with K-Meleon, but work with every other browser. Does anyone else have this issue?

Options: ReplyQuote
Re: Javascript problems
Posted by: JohnHell
Date: March 27, 2019 12:58AM

Examples? Versions?

Options: ReplyQuote
Re: Javascript problems
Posted by: rodocop
Date: March 27, 2019 11:52PM

Well, not a lot really.
Not with ALL OTHER working.
But they are. Aliexpress.com; lenta.ru; pikabu.ru as examples (broken even in very recent KM). New scripting kits deployed on some sites are breaking the web - and frequently without fallback option.

they are forcing ppl to constantly update-update-update their browsers...



Edited 1 time(s). Last edit at 03/27/2019 11:53PM by rodocop.

Options: ReplyQuote
Re: Javascript problems
Posted by: Slickone
Date: April 10, 2019 05:15PM

Quote
JohnHell
Examples? Versions?
Several, but the only one I can think of right now is slickdeals.net
On the front page, there are javascript links for Grid | List | Simple, Preferences, and on my avatar (to get to my account), though you'll need an account to get to some or all of that (another reason I didn't post it to begin with). Also, no pictures appear. I do have javascript and images enabled.

FYI, I was just asking if anyone was having that problem first. If it's a common, known problem, there'd be no need for me to post examples.

Options: ReplyQuote
Re: Javascript problems
Posted by: JohnHell
Date: April 10, 2019 05:42PM

Ok, we need examples to be able to test and tell if it is a common problem or just your settings, nothing else. Nothing intended to violate your privacy. Or if the error comes from a specific K-meleon version (that you didn't tell).

Anyway, did you already tried the Goanna engine version? Still the same?


As a generic answer for your generic question, we all have javascript problems. And sometimes isn't even our fault, or are ways of coding that tend to errors.

Quite a few that shouldn't be allowed in strict mode in a quick look to the error console, but, anyway, sorry if I offended you.

Options: ReplyQuote
Re: Javascript problems
Posted by: anonymous
Date: April 10, 2019 07:48PM

@Slickone
In a Gecko 38 based KM the pictures appear and the links work if DOM storage is enabled. Test Firefox ESR 38 and newer versions to find the oldest compatible JS engine for anything else.

Options: ReplyQuote
Re: Javascript problems
Posted by: Slickone
Date: April 10, 2019 10:26PM

Another example:
Walmart.com, in the search box at the top, entering characters and clicking the search button does nothing.

There are others but I haven't been keeping a list of them.

Quote
JohnHell
Ok, we need examples to be able to test and tell if it is a common problem or just your settings, nothing else. Nothing intended to violate your privacy. Or if the error comes from a specific K-meleon version (that you didn't tell).
I'm confused. I thought I gave an example.?
I'm using KM 76.

Quote

Anyway, did you already tried the Goanna engine version? Still the same?
Haven't tried it yet, since the last time I read about it, people reported problems with using an adblock. That may be fixed now, but I haven't had time to check back on it, and do whatever steps will be required to install adblock. Kmeleon of course requires more time than other browsers because of all the reading and tweaking required.



Edited 1 time(s). Last edit at 04/10/2019 10:27PM by Slickone.

Options: ReplyQuote
Re: Javascript problems
Posted by: JohnHell
Date: April 11, 2019 01:08AM

Quote
Slickone
Quote
JohnHell
Ok, we need examples to be able to test and tell if it is a common problem or just your settings, nothing else. Nothing intended to violate your privacy. Or if the error comes from a specific K-meleon version (that you didn't tell).
I'm confused. I thought I gave an example.?
I'm using KM 76.

English is not my mother language, but, I think it was obvious I was answering you about your, in my opinion, complain about why give an example.

If you weren't asking for help in the first post, my fault. But if you were, it is important to give all information as I already said to let others help you, or, at least try, and give you advices.

Sorry for the off-topic.
I leave the conversation.

Options: ReplyQuote
Re: Javascript problems
Posted by: anonymous
Date: April 11, 2019 05:14AM

@Slickone
Did you pick Walmart search because it depends on DOM storage too? Works fine.

Options: ReplyQuote
Re: Javascript problems
Posted by: Slickone
Date: April 11, 2019 09:27PM

Quote
anonymous
@Slickone
Did you pick Walmart search because it depends on DOM storage too? Works fine.
I'm not sure what you mean. There's a search box at the top of the page. If I enter text and click the search button, the button doesn't work. There's a drop down arrow to the left that also doesnt' work.

Options: ReplyQuote
Re: Javascript problems
Posted by: anonymous
Date: April 11, 2019 11:58PM

@Slickone
Looks like more things are missing in the Gecko 38 esrpre version you're using. Symptoms are identical to newer KM versions with DOM storage disabled.

Options: ReplyQuote
Re: Javascript problems
Posted by: Slickone
Date: April 13, 2019 04:10PM

Quote
anonymous
@Slickone
Looks like more things are missing in the Gecko 38 esrpre version you're using. Symptoms are identical to newer KM versions with DOM storage disabled.
How would I check/fix that?

Options: ReplyQuote
Re: Javascript problems
Posted by: Slickone
Date: April 24, 2019 07:08PM

How can I fix this?

Options: ReplyQuote
Re: Javascript problems
Posted by: siria
Date: April 25, 2019 08:19PM

Quote
Slickone
Quote
anonymous
Looks like more things are missing in the Gecko 38 esrpre version you're using. Symptoms are identical to newer KM versions with DOM storage disabled.
How would I check/fix that?

For checking if DOM storage is enabled globally, look in about:config
dom.storage.enabled = true
But it's probably already true, since it's the default setting.
While at it, would also check if dom.indexedDB.enabled = true

Aside from that, the best chance is to try with the newest KG76 version.
But even in that one the script engine has probs with very modern code.

Quote
Slickone
slickdeals.net
On the front page, there are javascript links for Grid | List | Simple, Preferences

In the source code this "looks" like json to me.
@experts:
this has bothered me since quite some time:
can anyone tell me why json does NOTHING in my KM1.6??
It should, acc. Mozilla Firefox 3.5 supports it. But it seems that json-code is often the reason when pages open completely blank in KM1.6 (e.g. instagram).
But even in KG74!
I keep suspecting the culprit could be just some pref or setting... To verify, had also tested with a new unzipped KM-version and profile awhile back, but no luck either.

Options: ReplyQuote
Re: Javascript problems
Posted by: rodocop
Date: April 26, 2019 01:52AM

No an expert in json-related things, but Insta doesn't load now even with Goanna 3.4.2.
Only witj latest.

Options: ReplyQuote
Re: Javascript problems
Posted by: siria
Date: April 26, 2019 02:39AM

Quote
rodocop
No an expert in json-related things, but Insta doesn't load now even with Goanna 3.4.2.
Only witj latest.

There's a long insta thread at msfn, have come across it again, someone discovered a css fix for vanished video display, and UA is most important, it must be OLDER as current FF. What was it that worked fine, FF60...? But not sure for which browser versions that was meant exactly.
https://msfn.org/board/topic/178259-instagram-videos-not-working-in-firefox-52-esr/

Anyway, for insta I meanwhile have a monster macro for KM1.6 (was a neverending regex+js nightmare in whole winter, after discovering too late there are actually web viewer services, argh)

But json seems completely disabled everywhere. Just have no simple test page link yet.

Options: ReplyQuote
Re: Javascript problems
Posted by: JohnHell
Date: April 26, 2019 07:02PM

Quote
siria
But json seems completely disabled everywhere. Just have no simple test page link yet.

JSON is just a way of defining a javascript variable object. It is exactly the same as skins.cfg in K-meleon 75.1 and above, indeed Dorian implemented that file content as JSON (Don't you remember when asked for opinions when developing/betatesting 75.1?).

Anyway, here you have a very simplistic example:
http://geocities.ws/jothache/jsontest.html

There is no reason to not work, beyond 1.6 might be too old, but should. When it doesn't work might be because the page is using some un-implemented function in K-meleon JavaScript engine version. As an example we have the recently reported Pinterest not loading. It doesn't even load in some of the latest versions.


But, beyond this, that you both talk about Instagram, it loads perfectly fine for me with 75.0.

Anyway, I have a script too to browse it without JavaScript (what Instagram lets, as last year removed some pagination functionality without javascript). I used it because the CSS transitions and animations eat too much CPU, but, anyway, it loads fine with JavaScript and in a new fresh profile.

Options: ReplyQuote
Re: Javascript problems
Posted by: rodocop
Date: April 26, 2019 10:03PM

I think this is due to the same javascript.options.strict pref in about:config

When it's true - Insta loads under 75.
When false - doesn't even under Goanna 3.4.2



Edited 1 time(s). Last edit at 04/26/2019 10:05PM by rodocop.

Options: ReplyQuote
Re: Javascript problems
Posted by: JohnHell
Date: April 26, 2019 10:28PM

Quote
rodocop
I think this is due to the same javascript.options.strict pref in about:config

When it's true - Insta loads under 75.
When false - doesn't even under Goanna 3.4.2


Nop, is not that preference, until the other day (the other thread), I never enabled it and ever worked.

I just enabled it for those tests and now is disabled again, and in a fresh profile, is disabled by default. I only can say K-meleon 75.0 loads it.

I can't tell about posting messages or whatever as I don't have an account, neither I'll have. But for viewing and exploring it works fine.

Options: ReplyQuote
Re: Javascript problems
Posted by: siria
Date: April 26, 2019 10:55PM

Quote
JohnHell
JSON is just a way of defining a javascript variable object. It is exactly the same as skins.cfg in K-meleon 75.1 and above, indeed Dorian implemented that file content as JSON (Don't you remember when asked for opinions when developing/betatesting 75.1?).

Yep, that's exactly where I first heard about it, and since then have an idea "how that json stuff looks". But doesn't mean having any understanding ;-)

Quote
JohnHell
Anyway, here you have a very simplistic example:
http://geocities.ws/jothache/jsontest.html

There is no reason to not work, beyond 1.6 might be too old, but should. When it doesn't work might be because the page is using some un-implemented function in K-meleon JavaScript engine version. As an example we have the recently reported Pinterest not loading. It doesn't even load in some of the latest versions.

Thanks for making this little test page! Amazing, probably the first time KM1.6 does indeed eat it. So at least the most extreme basic stuff works, good to know. And gives me a little more understanding of the whole thing.

Meanwhile have come across another example page, a parcel service:
https://nolp.dhl.de/nextt-online-public/de/search?piececode=3333333333333&cid=dhlde
There the json block looks much smaller and more manageable as instagrams, yet still does nothing in KM1.6 Then again, no wonder, the calling js-file is external and whopping 250kB size, so that's probably the culprit. But it does work in KG74, so at least have now learned that json is NOT completely blocked mysteriously in both ;-) Guess have just become way too much allergic after seeing again and again broken websites with json code inside, and the endless struggle with the insta-macro was a pain too.

Quote
JohnHell
But, beyond this, that you both talk about Instagram, it loads perfectly fine for me with 75.0.

Quote
rodocop
I think this is due to the same javascript.options.strict pref in about:config
When it's true - Insta loads under 75.
When false - doesn't even under Goanna 3.4.2

Good to know! So insta needs this pref, and a not too young UA, and videos possibly the msfn css hack too.

This pref has probably been misunderstood completely all the time. Sure by myself - always thought this would block non-perfect scripts! So in reality it's just the other way around, if false it can cause empty pages. Crazy.
To my surprise, had it even already included myself in the trouble-info macro, with a note about empty pages, so this solution had been found before, but at the time made no sense either.
Anyway, if the default is still false, it should urgently be changed in all new builds!

Quote
JohnHell
Nop, is not that preference, until the other day (the other thread), I never enabled it and ever worked.
I just enabled it for those tests and now is disabled again, and in a fresh profile, is disabled by default. I only can say K-meleon 75.0 loads it.

Sigh... all those mysteries... so there's yet more involved... < running away screaming, lol! >

Options: ReplyQuote
Re: Javascript problems
Posted by: JohnHell
Date: April 27, 2019 12:53AM

Quote
siria
Quote
JohnHell
JSON is just a way of defining a javascript variable object. It is exactly the same as skins.cfg in K-meleon 75.1 and above, indeed Dorian implemented that file content as JSON (Don't you remember when asked for opinions when developing/betatesting 75.1?).

Yep, that's exactly where I first heard about it, and since then have an idea "how that json stuff looks". But doesn't mean having any understanding ;-)

Quote
JohnHell
Anyway, here you have a very simplistic example:
http://geocities.ws/jothache/jsontest.html

There is no reason to not work, beyond 1.6 might be too old, but should. When it doesn't work might be because the page is using some un-implemented function in K-meleon JavaScript engine version. As an example we have the recently reported Pinterest not loading. It doesn't even load in some of the latest versions.


Thanks for making this little test page! Amazing, probably the first time KM1.6 does indeed eat it. So at least the most extreme basic stuff works, good to know. And gives me a little more understanding of the whole thing.

Meanwhile have come across another example page, a parcel service:
https://nolp.dhl.de/nextt-online-public/de/search?piececode=3333333333333&cid=dhlde
There the json block looks much smaller and more manageable as instagrams, yet still does nothing in KM1.6 Then again, no wonder, the calling js-file is external and whopping 250kB size, so that's probably the culprit. But it does work in KG74, so at least have now learned that json is NOT completely blocked mysteriously in both ;-) Guess have just become way too much allergic after seeing again and again broken websites with json code inside, and the endless struggle with the insta-macro was a pain too.

Consider JSON just as data, human readable data, as that is what it is, mostly. I mean, yeah. The problem is that it is an object and can contain pairs of all kinds, from just data to be accessed in a more... human way, to functions, to arrays, to... whatever.

The fail then can be from wrong functions inside the JSON like object to the functions that actually use it, not by using it, but by using functions that may or may not be implemented in the browser version engine, JavaScript engine.

By the way, I was allergic to JSON too, but is not much different from an array (instead call array[value] is object.property). Just it was harder to understand. But the only difficulty is that there are pairs of data property and values. That is supposed to be more human readable.

But has some drawbacks, that may be the problem with 1.6 (can't remember the engine version it used). For example, there is no easy way to know how many properties an object has, and so the function getOwnPropertyNames(), a very, very, very handy function to access objects almost the same way as arrays, and it wasn't implemented until Firefox 4. And this may be a good reason to fail.

Quote
siria
Quote
JohnHell
But, beyond this, that you both talk about Instagram, it loads perfectly fine for me with 75.0.

Quote
rodocop
I think this is due to the same javascript.options.strict pref in about:config
When it's true - Insta loads under 75.
When false - doesn't even under Goanna 3.4.2

Good to know! So insta needs this pref, and a not too young UA, and videos possibly the msfn css hack too.

This pref has probably been misunderstood completely all the time. Sure by myself - always thought this would block non-perfect scripts! So in reality it's just the other way around, if false it can cause empty pages. Crazy.
To my surprise, had it even already included myself in the trouble-info macro, with a note about empty pages, so this solution had been found before, but at the time made no sense either.
Anyway, if the default is still false, it should urgently be changed in all new builds!


That preference is for reporting errors, but I can't get why is really needed for some scripts, or for the browser itself, how the errors from javascript are reported. It is as I told, that the workaround, till rodocop discovered to us, was to enable the error console.

Dumb.

To specify strict JavaScript there is the "use strict;" definition on the script itself, so the browser interprets it.


And enable it, why? It isn't the faulty thing. For example, here I have a Seamonkey from last year, and with that set to false, yes, it is still false by default, those pages with problems work.... so, what then? It is something else from somewhere else.


Quote
siria
Quote
JohnHell
Nop, is not that preference, until the other day (the other thread), I never enabled it and ever worked.
I just enabled it for those tests and now is disabled again, and in a fresh profile, is disabled by default. I only can say K-meleon 75.0 loads it.

Sigh... all those mysteries... so there's yet more involved... < running away screaming, lol! >



Yeap, that's it, sorry, LOL.



Edited 1 time(s). Last edit at 04/27/2019 12:54AM by JohnHell.

Options: ReplyQuote
Re: Javascript problems
Posted by: JohnHell
Date: April 27, 2019 01:25AM

Updated the test page so you can test if getOwnPropertyNames is not working with 1.6.

Options: ReplyQuote
Re: Javascript problems
Posted by: adodupan
Date: May 02, 2019 12:54AM

Guys there is no reason for your allergies, using json should not be so difficult, it is possible even in macrolanguage. Here is an example of how to use it, i hope it will help to demystify this.
Macro search selected text in a new tab, it will appear in the Tools menu and in the context menu.
$OnInit = $OnInit."_sst_01;";
$OnStartup = $OnStartup."_sst_02;";
$__varsst_01 = getfolder(ProfileFolder)."\\sst.json"; # json file
$__varsst_02 = _("Search Selected"); # popup menu, status bar
$__varsst_03 = _("Search_Selected"); # inline menu
$__varsst_04 = _("Search Selected Text"); # popup menu, prompt dialog
$__varsst_05 = _("Add Search Engine"); # menu item, status bar
$__varsst_06 = _("Delete Search Engine"); # status bar
$__varsst_07 = _("Search "); # menu item
$__varsst_08 = _("Delete "); # menu item
$__varsst_09 = _("Enter name"); # prompt dialog
$__varsst_10 = _("Try again with another name!"); # prompt dialog
$__varsst_11 = _("Enter search url"); # prompt dialog
$__varsst_12 = _("Try again with another url!"); # prompt dialog
$__varsst_13 = ""; # this value is the json file content
# this macro builds the menu
_sst_01 {
  setmenu(SelectedText, popup, $__varsst_02);
  setmenu($__varsst_02, inline, $__varsst_03);
  setmenu("WebServices", popup, $__varsst_04);
  setmenu($__varsst_04, macro, $__varsst_05, _sst_04);
  setmenu($__varsst_04, separator, -1);
  # check if there is a json file in the profile folder
  if(!fileexists($__varsst_01))
    writefile($__varsst_01, "[]");
}
# this macro is executed on startup and when a user adds a new search engine
_sst_02 {
  $__varsst_13 == "" ? &_sst_10 : 0;
  $List = $__varsst_13; $ExecMacros = "_sst_03"; &ExecMacros_List;
}
# this macro dynamically creates items in the context menu (eg Search Google),
# also dynamically creates items in the menu (eg Delete Google)
_sst_03 {
  setmenu($__varsst_03, macro, $__varsst_07.substr($ListItem, 0, index($ListItem, "@")), "_sst_08(".$ListItem.")");
  setmenu($__varsst_04, macro, $__varsst_08.substr($ListItem, 0, index($ListItem, "@")), "_sst_06(".$ListItem.")");
}
# this macro is a command "Add Search Engine" 
_sst_04 {
  macroinfo = $__varsst_05;
  $__varsst_14 = true; $__varsst_15 = ""; $__varsst_16 = "";
  # prompt dialog text
  $__varsst_17 = $__varsst_09; $__varsst_18 = $__varsst_10;
  &_sst_05;
  if($__varsst_14) {
    # $__varsst_16 is search engine name
    $__varsst_15 = $__varsst_16; $__varsst_17 = $__varsst_11; $__varsst_18 = $__varsst_12; &_sst_05;
  }
  if($__varsst_14) {
    # $__varsst_16 is search engine url
    # add a new search engine in a variable, add it to a json file, then add new menu items
    $__varsst_13 = $__varsst_13.$__varsst_15."@".$__varsst_16.";"; &_sst_09; &_sst_02;
  }
}
# this macro displays a dialog with an optional message prompting the user to input some search engine
_sst_05 {
  $__varsst_16 = prompt($__varsst_17, $__varsst_04, ""); 
  if(length($__varsst_16) == 0 or index($__varsst_16, ";") > -1 or index($__varsst_16, "@") > -1) {
    $__varsst_19 = confirm($__varsst_18, $__varsst_04, YESNO, QUESTION);
    $__varsst_19 == "YES" ? &_sst_05 : $__varsst_14 = false;
  }
}
# this macro is a command "Delete Search Engine"
_sst_06 {
  macroinfo = $__varsst_06;
  $__varsst_20 = $ARG;
  $__varsst_13 = sub($__varsst_20.";", "", $__varsst_13); &_sst_09;
  $List = $__varsst_03."@".$__varsst_07.";".$__varsst_04."@".$__varsst_08.";"; $ExecMacros = "_sst_07"; &ExecMacros_List;
}
# this macro deletes previously dynamically created menu items
_sst_07 {
  setmenu(substr($ListItem, 0, index($ListItem, "@")), macro, substr($ListItem, index($ListItem, "@") + 1).substr($__varsst_20, 0, index($__varsst_20, "@")),);
}
# this macro is a command "Search Selected",
# it is executed when user clicks on an item in the context menu (eg Search Google)
_sst_08 {
  macroinfo = $__varsst_02;
  $__varsst_21 = $ARG;
  opentab(substr($__varsst_21, index($__varsst_21, "@") + 1).$SelectedText);
}
# this macro stores data in a json file
_sst_09 {
  $__varsst_22 = injectJS("(
    function() {
      var sst1 = '".$__varsst_13."', sst2 = sst1.split(';'), sst3 = [];
      for (var a in sst2) {
        if(sst2[a].length > 0) {
          var sst4 = sst2[a].split('@');
          sst3.push({name: sst4[0], url: sst4[1]});
        }
      }
      var sst5 = JSON.stringify(sst3);
      return sst5;
    }
  ())");
  writefile($__varsst_01, $__varsst_22);
}
# this macro reads the stored data from the json file,
# it is executed only on startup
_sst_10 {
  $__varsst_23 = readfile($__varsst_01);
  $__varsst_13 = injectJS("(
    function() {
      var sst6 = '".$__varsst_23."', sst7 = '', sst8 = JSON.parse(sst6);
      for (var a in sst8)
        sst7 += sst8[a].name + '@' + sst8[a].url + ';';
      return sst7;
    }
  ())");
}
Regards

Options: ReplyQuote
Re: Javascript problems
Posted by: Slickone
Date: May 06, 2019 09:03PM

Quote
siria
Quote
Slickone
Quote
anonymous
Looks like more things are missing in the Gecko 38 esrpre version you're using. Symptoms are identical to newer KM versions with DOM storage disabled.
How would I check/fix that?

For checking if DOM storage is enabled globally, look in about:config
dom.storage.enabled = true
But it's probably already true, since it's the default setting.
While at it, would also check i
f dom.indexedDB.enabled = true
Yes, both are set to true.

Quote

Aside from that, the best chance is to try with the newest KG76 version.
But even in that one the script engine has probs with very modern code.
KG76 - is that KM on Goanna?

Options: ReplyQuote
Re: Javascript problems
Posted by: anonymous
Date: May 08, 2019 04:30AM

@Slickone
Server side modification. Walmart allows searching without DOM storage now.

Options: ReplyQuote


K-Meleon forum is powered by Phorum.