Revert "Revert "HTML injection fix for bluetooth pairing, issue 65946""

This reverts commit d6fab60f4dd243b985c42271a0a3670d016d99d7.