Any way to lock mouse pointer for 1st person projects?

Hello, I’ve made a project which uses node.js to make a first person game, but I’m trying to figure out how to lock the mouse into the webview so that it functions normally. Any way to do so?


To add onto this, when I do attempt to do PointerLock, I get this error:

Uncaught (in promise) DOMException: Failed to execute 'requestPointerLock' on 'Element': Blocked pointer lock on an element because the element's frame is sandboxed and the 'allow-pointer-lock' permission is not set.