I have a piece of code that's supposed to run every time Wikipedia Recent Changes is (semi)automatically refreshed (live feed / button press on new changes):
$(document).ready(function() {
if (mw.config.get("wgCanonicalSpecialPageName") === "Recentchanges") {
mw.hook("wikipage.content").add(function (){
/*...code to move some divs around...*/
console.log("fired!")
})
}
}
This always seems to fire twice. My question is whether "wikipage.content change" applies only to content provided by the server, or does my div-moving-around also count as content change, triggering the hook for the second time. How can one prevent this from happening? Thnx.