Sketch iframes block pointer lock and file downloads (requestPointerLock and save* examples do nothing)
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 62/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- react, typescript
Línea de trabajo
El atributo sandbox se establece en src/components/CodeEmbed/frame.tsx, y el issue indica que esa línea es el único cambio necesario. Lee el archivo para ver qué tokens allow- están presentes y luego revisa el atributo allow, que el issue pide dejar sin cambios. Reproduce el problema con los ejemplos de referencia requestPointerLock() y saveJSON(). Se considera terminado cuando el bloqueo del puntero se activa y las descargas se inician con una acción del usuario, y una prueba cubre el valor de sandbox. Pregunta a los mantenedores por qué se omitieron los flags antes de cambiarlos, ya que el razonamiento de seguridad no está indicado.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Most appropriate sections of the p5.js website?
Reference, Examples
What is your operating system?
Linux
Web browser and version
152.0.7977.64
I reproduced this in Chromium. The cause is the sandbox attribute on the iframe, which is in the HTML the site sends.
Actual Behavior
The iframe that runs sketches on the site has this sandbox in src/components/CodeEmbed/frame.tsx:
allow-scripts allow-popups allow-modals allow-forms allow-same-origin
It has no allow-pointer-lock and no allow-downloads. So two things fail silently:
requestPointerLock()is blocked. The browser logs "Blocked pointer lock". This is the problem in #789.- Downloads are blocked. The
saveJSON()andsaveStrings()examples on the reference pages download nothing. The Download button in the Loading and Saving Data examples (JSON and Table) does nothing too.
Expected Behavior
These examples should work the same as they do in the web editor. The pointer lock should engage, and the files should download when the user clicks or presses a key.
Steps to reproduce
- Open the
requestPointerLock()reference page, double click the sketch, and check the console. - Open the
saveJSON()reference page, double click the sketch, and check for a download. - Open the Examples page for Loading and Saving Data, then JSON, and click the Download button.
On a local build I added allow-pointer-lock allow-downloads to the sandbox. The pointer lock then worked, and numbers.json and data.txt downloaded.
I checked the reference examples that call save functions. They run on a key press, a double click or a button, so none of them should start a download on page load.
The fix is small. I would change only the sandbox line and add a test for it. I did not touch the allow attribute, so this does not overlap with #1583.
Related: #789
Would you like to work on the issue?
Yes, I would like to work on it. Is there any reason these flags were left out on purpose?
- Lenguaje dominante
- MDX
- Estrellas
- 97
- Forks
- 330
- Merge medio
- 2 d 7 h
- PR fusionados (30 d)
- 13
Preparar el entorno
Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de processing/p5.js-website
-
`<canvas>` tag rendered instead of escaped in `p5.Graphics` reference pageQuizá libre de nuevo @rakesh2OO5 la tomó hace 141 días y no hay ningún pull request abierto. AbiertoBug
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
processing/p5.js-website#1389 · 3 comentarios ·
Los mantenedores suelen responder en 1 día
-
Add Korean translations for `layered-rendering-with-framebuffers.mdx`Posiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
processing/p5.js-website#1374 ·
Los mantenedores suelen responder en 1 día
-
Add Korean translations for `intro-to-p5-strands.mdx`Posiblemente ocupada @eupthere la tomó hace 196 días. Abierto
Dificultad 1/5 1-3 horas Aptitud para principiantes 86/100
processing/p5.js-website#1356 · 1 reacción ·
Los mantenedores suelen responder en 1 día
-
[2.0] TutorialLayout.astro is missing the showBanner translation featurePosiblemente ocupada @kramosss la tomó hace 103 días. AbiertoBug Reserved (CodeDay)
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
processing/p5.js-website#1329 · 7 comentarios ·
Los mantenedores suelen responder en 1 día
-
Add Korean terminology tableAbiertolang-ko
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
processing/p5.js-website#1323 · 4 comentarios ·
Los mantenedores suelen responder en 1 día
Todos los issues de processing/p5.js-website
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
-
`nsh-core` fails to compile when taffy's default `calc` feature is enabled elsewhere in the graphAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
longbridge/nsh#966 ·
Los mantenedores suelen responder en 1 día
-
bug ui
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
hashtopolis/server#2614 ·
Los mantenedores suelen responder en 1 día
-
変換の候補のどれが Zenzai の答えか分からないAbierto要トリアージ
Dificultad 2/5 1-3 horas Aptitud para principiantes 64/100
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
VictorKildahl/cra#192 ·
Los mantenedores suelen responder en 1 día