On history pages, elements with the HTML class "history-size" could have a data attribute with the number of bytes. To show you what I mean, the current HTML
<span class="history-size">(48,849 bytes)</span>
could be changed to
<span class="history-size" data-bytes="48849">(48,849 bytes)</span>
In other words, the data attribute should be like the text, but without the parens, without the unit (because it's in the attribute name) and without any kind of formatting between the numbers (comma or depending on language).
Solution: change formatRevisionSize in includes/Linker.php.