microsoft / pxt

Microsoft MakeCode (PXT - Programming eXperience Toolkit)
https://makecode.com
MIT License
2.1k stars 588 forks source link

Editor snapshots: added extra check for mac and ios for allowing screenshots #10247

Closed srietkerk closed 4 weeks ago

srietkerk commented 1 month ago

Fixes https://github.com/microsoft/pxt-minecraft/issues/2613

Just wanted to note that the disableFileAccessinMaciOs flag is something that gets set in the appTheme when the inGame=1 query variant exists. So there's a niceness because if the file access is disabled, we shouldn't allow for screenshots, but it also is a tell that we're in game for Minecraft.

Another point is that we are also setting disableFileAccessInAndroid to true with the inGame=1 query variant. I'm thinking about adding the check for that in the enableSnapshot function as well. However, I think leaving snapshots on for android is fine; at least testing in browser on my phone worked great. I would need to test on a Chromebook to see if it would work in game, though.

Upload target: https://minecraft.makecode.com/app/2255ed413beea760a738e01f155fc4d9e0fe2948-a1ffd9d0b1?inGame=1#editor There should really only be a change with Mac/Ipad with this upload target, but, if you also want to check that nothing changes on windows/android, feel free to test!