According to [[mw:ResourceLoader/JavaScript Deprecations#wikibits.js]], the function "addOnloadHook" is deprecated in favour of "jQuery(document).ready".
This change breaks some scripts.[1][2]
E.g.: consider a function to get the rows of the table present on
[[Special:Upload]]:
function test(){
document.getElementById( 'mw-htmlform-description' ).rows
}
If it is executed by "addOnloadHook", it will return all the 6 rows, but if it is executed by "jQuery(document).ready", it only returns 4 rows.
You can confirm this broken behavior using the sample code [3].
[1] https://pt.wikipedia.org/w/index.php?oldid=27372605
[2] https://pt.wikipedia.org/wiki/MediaWiki_Discussão:Gadget-UploadForm.js#Gadget_padr.C3.A3o_e_ResourceLoader
[3] https://en.wikipedia.org/?oldid=457179751
Version: unspecified
Severity: normal