User talk:Anomie/useridentifier.js

Latest comment: 6 months ago by Ahecht in topic A couple of added features

A bug in this code

edit

Hi User:Anomie !

I was looking through our JavaScript error logs and there is a bug in this code. The script seems to be used by at least 3 people but is occurring often enough that it could be considered a privacy issue (it errors on ever page view so acts as a record of browsing history). It seems to mostly be occuring on the mobile contributions page https://en.m.wikipedia.org/wiki/Special:Contributions. Looks simple enough to fix.

The error is: TypeError: Cannot read properties of null (reading 'match')

stack trace is :

at HTMLDocument.onLoad https://en.m.wikipedia.org/w/index.php?title=User:Anomie/useridentifier.js&action=raw&ctype=text/javascript:196:17 at mightThrow https://en.m.wikipedia.org/w/load.php?lang=en&modules=jquery%2Coojs-ui-core%2Coojs-ui-widgets&skin=minerva&version=szq54:49:881 at process https://en.m.wikipedia.org/w/load.php?lang=en&modules=jquery%2Coojs-ui-core%2Coojs-ui-widgets&skin=minerva&version=szq54:50:54

Thanks in advance and let me know if you need any further information!

Jon (WMF) (talk) 18:41, 10 March 2023 (UTC)Reply

Looks like you're probably overstating things, and you've also tried to fix this in the past and screwed it up. I went ahead with a proper fix. Anomie 01:42, 11 March 2023 (UTC)Reply

A couple of added features

edit

@Anomie Thanks again for the script. I implemented a couple of features in my sandbox version (User:Ahecht/sandbox/Scripts/useridentifier.js) that you might want to incorporate:

  • It checks the user groups at meta for any beginning with "global", to catch things like global-renamer that aren't included in globaluserinfo.groups. I also added a Global Renamer icon.
  • It will show the last logged action instead of the last edit if it is more recent.

--Ahecht (TALK
PAGE
)
15:13, 29 January 2025 (UTC)Reply