Refactored debug toolbar to use plain javascript #7400

This is MT as well. It should be `addEventListener`.