Re-applies the changes from 3e0cfd44 (#11602), reverting d93ec0a0 (#11764) now that the conflict with the webclient listener was fixed in 119edf51 (#11895).