liveracers.com website is missing essential elements on PM32

For support with specific websites

Moderator: trava90

Forum rules
Please always mention the name/domain of the website in question in your topic title.
Please one website per topic thread (to help keep things organized). While behavior on different sites might at first glance seem similar, they are not necessarily caused by the same.

Please try to include any relevant output from the Toolkit Error Console or the Developer Tools Web Console using the following procedure:
  1. Clear any current output
  2. Navigate or refresh the page in question
  3. Copy and paste Errors or seemingly relevant Warnings into a single [ code ] block.
User avatar
andikay
Moon lover
Moon lover
Posts: 86
Joined: 2019-05-25, 23:40

liveracers.com website is missing essential elements on PM32

Unread post by andikay » 2023-02-01, 20:14

The website liveracers.com is a website to organize and track racing sim races that are happening on racing servers. Racing leagues can connect their servers to this site and get live info on what's happening on the servers there. If a server is live you can click them on the left side and then get live data from it. The problem is that since PM 32 there are no servers shown anymore to click - and the search field also disappears on PM 32.

First I thought this was a website issue, but I then checked it in Firefox and sure enough the servers were there. I then tried my old backup PM 31.4.2 and the servers were there too. I then checked with a fresh profile on PM 32 and PM 31.4.2, nothing changed, meaning the servers are there on PM 31.4.2 and not there on PM 32. Here are screenshots from how the site looks on both versions:

PM 31: https://imgur.com/tru1Dob
PM 32: https://imgur.com/6fEH65h

This is the example website (the subdomain changes depending on the racing league, this one is for ASRC): https://asrc.liveracers.com/Live

I get the following error in both PM 31.4.2 and PM 32 in the error console:

Code: Select all

Warning: Use of getPreventDefault() is deprecated.  Use defaultPrevented instead.

Source File: https://asrc.liveracers.com/jquery/js?v=jyist1l_9DURXrnqT9ML2zNlKggLN8u_zVumH4lRjME1
Line: 1
But I get the following error only in PM 32 in the error console:

Code: Select all

Error: TypeError: a is null
Source File: https://asrc.liveracers.com/ext/js?v=yokX15GMdPR-NbXNAMDEDokVmmyAIphaoerfP8PDKSQ1
Line: 21
Last edited by andikay on 2023-02-02, 05:46, edited 1 time in total.

User avatar
Moonchild
Pale Moon guru
Pale Moon guru
Posts: 35474
Joined: 2011-08-28, 17:27
Location: Motala, SE
Contact:

Re: liveracers.com wbesite is missing essential elements on PM32

Unread post by Moonchild » 2023-02-01, 21:46

Looks like it's a regex issue.

Code: Select all

parseTag: function (b) {
var h = this,
a = h.tagRe.exec(b),
e = a[1],  <== FAILS HERE
i = a[2],
d = a[3],
g = a[4],
c;
if (e == '.') {
  if (!h.validTypes) {
    h.definitions.push('var validTypes={string:1,number:1,boolean:1};');
    h.validTypes = true
  }
  c = 'validTypes[typeof values] || ts.call(values) === "[object Date]" ? values : ""'
} else {
  if (e == '#') {
   c = 'xindex'
  } else {
    if (e.substr(0, 7) == 'parent.') {
      c = e
    } else {
      if (isNaN(e) && e.indexOf('-') == - 1 && e.indexOf('.') != - 1) {
        c = 'values.' + e
      } else {
        c = 'values[\'' + e + '\']'
      }
    }
  }
}
if (g) {
  c = '(' + c + g + ')'
}
if (i && h.useFormat) {
  d = d ? ',' + d : '';
  if (i.substr(0, 5) != 'this.') {
    i = 'fm.' + i + '('
  } else {
    i += '('
  }
} else {
  return c
}
return i + c + d + ')'
},
evalTpl: function ($) {
  eval($);
  return $
},
newLineRe: /\r\n|\r|\n/g,
aposRe: /[']/g,
intRe: /^\s*(\d+)\s*$/,
tagRe: /([\w-\.\#]+)(?:\:([\w\.]*)(?:\((.*?)?\))?)?(\s?[\+\-\*\/]\s?[\d\.\+\-\*\/\(\)]+)?/
So tagRe.exec(b) doesn't return an object in v32.*?
Any regex gurus out here that can weigh in?
"Sometimes, the best way to get what you want is to be a good person." -- Louis Rossmann
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite

User avatar
Kris_88
Keeps coming back
Keeps coming back
Posts: 933
Joined: 2021-01-26, 11:18

Re: liveracers.com wbesite is missing essential elements on PM32

Unread post by Kris_88 » 2023-02-02, 03:38

https://stackoverflow.com/questions/542 ... -u-invalid

Code: Select all

tagRe: /([\w-\.\#]+)(?:\:([\w\.]*)(?:\((.*?)?\))?)?(\s?[\+\-\*\/]\s?[\d\.\+\-\*\/\(\)]+)?/

PM v32:
tagRe.exec("parent.baseCls") == ["parent","parent",null,null,null]
tagRe.exec(".") == null

PM v29.4.5
tagRe.exec("parent.baseCls") == ["parent.baseCls","parent.baseCls",null,null,null]
tagRe.exec(".") == [".",".",null,null,null]
[\w-\.\#] seems, invalid regex ?

User avatar
adoxa
Fanatic
Fanatic
Posts: 153
Joined: 2019-03-16, 13:26

Re: liveracers.com website is missing essential elements on PM32

Unread post by adoxa » 2023-02-02, 06:59

/[\w-\.]/ will not match ., when it should; it does match -. Using Modify HTTP Response to escape the dash seems to work (two servers were displayed):

Code: Select all

[["asrc.liveracers.com",["/\\/ext\\/js/",["/\\\\w-/g","\\w\\-"]]]]

User avatar
Moonchild
Pale Moon guru
Pale Moon guru
Posts: 35474
Joined: 2011-08-28, 17:27
Location: Motala, SE
Contact:

Re: liveracers.com website is missing essential elements on PM32

Unread post by Moonchild » 2023-02-02, 08:51

Oh, I see. My tired (and sick) brain didn't see that in the string.

Well, it makes sense that it doesn't match:

Code: Select all

/[\w-\.]/
Literally means defining a range from \w to "."; that range is invalid, because \w is not a singular character match, so it will not match anything as a result. In this case the - has to either be escaped or put at the end so it's clear it's not a range definition.

So it seems the difference here is that in v29, this was treated differently.
"Sometimes, the best way to get what you want is to be a good person." -- Louis Rossmann
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite

User avatar
Moonchild
Pale Moon guru
Pale Moon guru
Posts: 35474
Joined: 2011-08-28, 17:27
Location: Motala, SE
Contact:

Re: liveracers.com website is missing essential elements on PM32

Unread post by Moonchild » 2023-02-02, 09:10

Aha, seems there's a typo in our source code, such that if the left hand is a range and the right hand is not, it will not add the right hand character, even in non-unicode mode where it should treat this literally without error. I'll get that fixed!
"Sometimes, the best way to get what you want is to be a good person." -- Louis Rossmann
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite

User avatar
andikay
Moon lover
Moon lover
Posts: 86
Joined: 2019-05-25, 23:40

Re: liveracers.com website is missing essential elements on PM32

Unread post by andikay » 2023-02-02, 19:14

Ah, very interesting to read. It's been a while since I have worked with regular expressions. Thanks a lot for looking into it, I appreciate it very much.

Locked