When I added the script https://meta.wikimedia.org/wiki/User:SuperHamster/view-it-full.js as a gadget on hrwiki, it was throwing the error "mw.Api is not a constructor".
Wouldn't it be better to put the script inside a $(document).ready(), as in https://hr.wikipedia.org/wiki/Special:Permalink/7361522
Description
Description