Do not apply HTMLDocument edits if instrumentation is not enabled

Fix for #4985