p5.js-web-editor
p5.js-web-editor copied to clipboard
getURLParams() not working in fullscreen share mode
Nature of issue?
- Found a bug
Details about the bug:
- Web browser and version: Chrome 97.0.4692.71 (Official Build) (x86_64)
- Operating System: OSX
- Steps to reproduce this bug:
- Consider the example at https://p5js.org/reference/#/p5/getURLParams
- Paste the code below in a new editor window
- Create the fullscreen share mode using File, Share, Fullscreen option
- add ?year=2014&month=May&day=15 to the URL
- From the description, it is expected not to work from the editor, but supposed to work using the 'share' URLs
Snippet:
// Example: http://p5js.org?year=2014&month=May&day=15
function setup() {
let params = getURLParams();
text(params.day, 10, 20);
text(params.month, 10, 40);
text(params.year, 10, 60);
}
Welcome! 👋 Thanks for opening your first issue here! And to ensure the community is able to respond to your issue, be sure to follow the issue template if you haven't already.
I think this is because the fullscreen and embed links now also display the sketch in an iframe (an iframe within an iframe in the case of embed) in order to prevent phishing, and since the parent and iframe have different subdomains, I don't know if the iframe could get the url of the parent.
So as long as that's the case, I'm wondering if it makes sense to update the reference page on the website to clarify.
hey @calebfoss would u please explain a bit and help to work on it
@rinkydevi What would you like further explanation on?
I'm going to close this for now, please feel free to reopen this or create a new issue if needed, thanks!