Seems like the declarative option would address this use case in the most straightforward way: https://github.com/w3c/screen-wake#declarative-option