[TASK] Improve debugging code

Improve debugging code to be less open to misinterpretation,
improve and externalize JS code.

Expand debug output check to react also on matching devIPMask.

Resolves: #58594
Releases: 1.6
Change-Id: Id65660d55a74c1f989e2a61251217d63be984aae
Reviewed-on: https://review.typo3.org/29920
Reviewed-by: Francois Suter
Tested-by: Francois Suter