p5.js-web-editor icon indicating copy to clipboard operation
p5.js-web-editor copied to clipboard

getURLParams() not working in fullscreen share mode

Open mutterer opened this issue 3 years ago • 5 comments

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:
  1. Consider the example at https://p5js.org/reference/#/p5/getURLParams
  2. Paste the code below in a new editor window
  3. Create the fullscreen share mode using File, Share, Fullscreen option
  4. add ?year=2014&month=May&day=15 to the URL
  5. 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);
}

mutterer avatar Jan 20 '22 09:01 mutterer

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.

welcome[bot] avatar Jan 20 '22 09:01 welcome[bot]

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.

calebfoss avatar Feb 04 '22 19:02 calebfoss

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.

calebfoss avatar Feb 04 '22 19:02 calebfoss

hey @calebfoss would u please explain a bit and help to work on it

rinkydevi avatar Mar 15 '22 00:03 rinkydevi

@rinkydevi What would you like further explanation on?

calebfoss avatar Mar 15 '22 00:03 calebfoss

I'm going to close this for now, please feel free to reopen this or create a new issue if needed, thanks!

raclim avatar Jun 22 '23 21:06 raclim