As discussed with @MatthiasSaihttam, this really needs to be fixed soon as it causes one obvious bug (and possibly other bugs too); one can not longer see the extra statistics on others profile pages or even their own profile page.
The getKAID() function is failing because the queried window item does not exist.
But I have found another method which might fix this, but will require a bit of work.
As discussed with @MatthiasSaihttam, this really needs to be fixed soon as it causes one obvious bug (and possibly other bugs too); one can not longer see the extra statistics on others profile pages or even their own profile page.
The getKAID() function is failing because the queried window item does not exist. But I have found another method which might fix this, but will require a bit of work.
I started on it in the commit below, so if anyone wants to build upon it, please do. https://github.com/An0n3m0us/ka-extension-ts/commit/0736204a68f0b56f4ebffb628aa9ef0cdadce9c7
Another method could be to extract the username or KAID from the window link, and using a getJSON call to get the KAID if the former scenario occurs.