Skip to content

requestPointerLock example not working #789

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
quinton-ashley opened this issue Apr 10, 2025 · 7 comments
Open

requestPointerLock example not working #789

quinton-ashley opened this issue Apr 10, 2025 · 7 comments
Labels
Bug Something isn't working

Comments

@quinton-ashley
Copy link
Contributor

quinton-ashley commented Apr 10, 2025

Not working on latest Chrome or Safari on macOS

https://p5js.org/reference/p5/requestPointerLock/

Would you like to work on the issue?

no

@quinton-ashley quinton-ashley added the Bug Something isn't working label Apr 10, 2025
@quinton-ashley
Copy link
Contributor Author

Image Image

@ksen0
Copy link
Member

ksen0 commented Apr 10, 2025

The example works in the editor, so the function itself works (https://editor.p5js.org/ksen0/sketches/Kv_EZjhbb). There's another issue on the website that's currently causing several other problems and is being worked on #790 - so when that's resolved and this issue persists, will need to check more deeply what else may be the problem here

@davepagurek
Copy link
Collaborator

Merged that PR! I think it's likely unrelated though, as that error states, we likely need to add allow-pointer-lock to here:

sandbox="allow-scripts allow-popups allow-modals allow-forms allow-same-origin"

@ksen0 agreed that this is a website issue, I'll transfer this to that repo

@davepagurek
Copy link
Collaborator

Actually, I'm not sure I have that permission (or at least p5.js-website doesnt show up in the list of repos when I click Transfer Issue.) @ksen0 does it show up for you?

@ksen0
Copy link
Member

ksen0 commented Apr 11, 2025

@davepagurek looks like the issue's already on the website! Here's my Chrome error:

Image

But it's the same Chrome error as in other places that do seem to work, like https://p5js.org/reference/p5/bezierTangent/

The requestPointerLock itself seems to be failing silently for me, which is strange

@davepagurek
Copy link
Collaborator

oh, of course, that makes sense why I can't switch it. sorry, got mixed up with my other notifications!

I think the mixed content error is unrelated to the pointer lock one, and the failing item is a <link> tag trying to do some prefetching. So if that fails, it just means clicking a link works the usual way and might be a tad slower than if the linked page was prefetched. The code initiating the blocked request looks like this:

Image ...which doesnt seem to be a thing in our codebase, but rather an Astro-generated thing based on this.

prefetch: {
defaultStrategy: "viewport",
prefetchAll: true,

Not sure yet where the http is coming from though, when I add a breakpoint there, all the prefetch links start with https 🤔

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants