Board Thread:Script Suggestions/@comment-24531999-20151104231038/@comment-24473195-20160521123032

I came across some documentation for this while looking for something else. Anyway, a script by He7d3r seems to do exactly what you want. Although, this is a tool for developers not regular users and will make some pages take longer to load.

https://meta.wikimedia.org/wiki/User:He7d3r/Tools/DebugModeToggle.js

A few changes to that script will probably make it work in Wikia too. It is also possible that the new "Test script mode" in Special:jspages does this too, although that only works for scripts from the Mediawiki namespace.