Hi. I wrote a gadget here, but the script does nothing, not even adding the main object to mw
. The code works if I paste directly on the browser console, and I also removed all deprecated functions listed on ResourceLoader/Migration guide (users), so I don't know what another thing can I do. I'm using MediaWiki 1.29.2. Thanks for the help.
Topic on Project:Support desk
On an unrelated note, 1.29.x is an old version unsupported since middle of 2018, so that website (and data of its users) is insecure.
You could add some debugging and use your web browser's developer tools.
I know 1.29 is already obsolete, I don't have access to the server. The developer tools' console doesn't show any error, so I don't know what's wrong.
Does any error show in the error console? You can also try with debug=true in the URL.
Also, there's a missing semicolon (try pasting the code to https://jshint.com/ ), that may be an issue when the code is minimized
I wrote the missing semicolon, and I checked the code on that page. The console simply doesn't show any error, even with debug=true
. The same code works if I put it in MediaWiki:Common.js, so I'm sure it isn't a syntax problem.
Looking at https://es.vikidia.org/wiki/MediaWiki:Gadgets-definition
It's definition says type=styles, which is wrong since you're trying to run JavaScript...
Mmm, I didn't realized of that. Now it works. Thanks.