Sketch iframes block pointer lock and file downloads (requestPointerLock and save* examples do nothing)
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 62/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- react, typescript
Direzione di ricerca
L'attributo sandbox è impostato in src/components/CodeEmbed/frame.tsx, e la issue indica che quella riga è l'unica modifica necessaria. Leggila per vedere quali token allow- sono presenti, poi controlla l'attributo allow, che la issue chiede di lasciare invariato. Riproduci con gli esempi di riferimento requestPointerLock() e saveJSON(). È completato quando il blocco del puntatore si attiva e i download partono su azione dell'utente, e un test copre il valore di sandbox. Chiedi ai maintainer perché i flag sono stati esclusi prima di modificarli, dato che il ragionamento sulla sicurezza non è indicato.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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?
- Lingua principale
- MDX
- Stelle
- 97
- Fork
- 330
- Merge medio
- 2g 7h
- PR unite (30g)
- 13
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di processing/p5.js-website
-
`<canvas>` tag rendered instead of escaped in `p5.Graphics` reference pageForse di nuovo libera @rakesh2OO5 l’ha presa 142 giorni fa e non c’è nessuna pull request aperta. ApertaBug
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
processing/p5.js-website#1389 · 3 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
Add Korean translations for `layered-rendering-with-framebuffers.mdx`Forse già presa Una pull request collegata a questa issue è aperta o già unita. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
processing/p5.js-website#1374 ·
I maintainer di solito rispondono entro 1 giorno
-
Add Korean translations for `intro-to-p5-strands.mdx`Forse già presa @eupthere l’ha presa 196 giorni fa. Aperta
Difficoltà 1/5 1-3 ore Idoneità per principianti 86/100
processing/p5.js-website#1356 · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno
-
[2.0] TutorialLayout.astro is missing the showBanner translation featureForse già presa @kramosss l’ha presa 104 giorni fa. ApertaBug Reserved (CodeDay)
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
processing/p5.js-website#1329 · 7 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
Add Korean terminology tableApertalang-ko
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
processing/p5.js-website#1323 · 4 commenti ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di processing/p5.js-website
Issue simili
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 67/100
I maintainer di solito rispondono entro 1 giorno
-
Review view: Daily/Weekly Review header buttons use the app-wide toolbar control styleForse già presa @colherdesopa l’ha presa oggi. Aperta
Difficoltà 1/5 1-3 ore Idoneità per principianti 90/100
dongdongbh/Mindwtr#1515 ·
I maintainer di solito rispondono entro 1 giorno
-
bug good first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 86/100
KonstantinStarovoytov/kitden#21 ·
I maintainer di solito rispondono entro 1 giorno
-
bug design
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
pranavvehmid/delt#66 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
guybedford/es-module-shims#556 ·