Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add option to pass JSON Config from a different website to a Maroon WebGL build #548

Closed
FlorianGlawogger opened this issue Oct 30, 2024 · 1 comment · Fixed by #551
Closed
Assignees
Labels
feature New or missing feature

Comments

@FlorianGlawogger
Copy link
Collaborator

FlorianGlawogger commented Oct 30, 2024

Describe the issue
It would be great if Peter could use his own website to configure the parameters for e.g. the optics experiment, and then link to a Maroon build (either on his own server or the TU Graz Maroon build), and the Maroon build then automatically loads the custom configuration for the experiment

Related: #512

@FlorianGlawogger FlorianGlawogger added the feature New or missing feature label Oct 30, 2024
@FlorianGlawogger FlorianGlawogger self-assigned this Oct 30, 2024
@github-project-automation github-project-automation bot moved this to To do in Maroon Oct 30, 2024
@FlorianGlawogger
Copy link
Collaborator Author

FlorianGlawogger commented Nov 6, 2024

The options for how this might be implemented:

  • Passing string as URL parameter (GET request) is problematic, as URLs have length limitation that is too short for complicated optics experiment setups (Galilean Telescope config has >7000 characters, URLs should be below 2000 characters)
  • POST request allows for unlimited characters; however, if Maroon is hosted on another server, CORS might be a problem; and we'd need some server-side code PHP, node.js, flask etc.; also, if two users access the website at the same time, they must not interfere with each other, so we'd need some solution for this, like session data
  • Storing value as cookie/localStorage/SessionStorage would also be possible, but then we'd have to think about different things like cookie consent banners, clearing the cookie again; and Cross-origin limitations also apply here
  • some sort of cross-origin communication mechanism with iframe, but both website would need to be open at the same time, and probably also not an elegant solution
  • URL fragment/hash, instead of the regular GET parameters, we could send the data as URL fragments (after an # at the end of an URL, usually this is used to link to a certain part of a page like so), Chrome limits these to 2MB (Galilean Telescope e.g. has 8kB, or a bit over 7000 characters), and other browsers might also have limitations of about 80000 characters, but it should still suffice I think, some browsers also only limit the number of characters the URL bar can display but will still process all characters , the server wouldn't be aware of the data transmitted, but it doesn't need to be anyway, so I think this would be the best/easiest solution as of now, feel free to let me know your thoughts

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New or missing feature
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

1 participant