-
Notifications
You must be signed in to change notification settings - Fork 37
hash routing support #889
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
hash routing support #889
Conversation
Some SPAs (e.g. Zammad), use hash routing (e.g. /#ticket/...). With this change you can have working internal routing for links like `https://my.nextcloud.com/apps/external/1/#ticket/zoom/102` Signed-off-by: John Rallis <rallisf1@yahoo.gr>
provokateurin
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting idea!
I think this needs to be extended to also automatically update the hash if the user changes it in the URL bar.
For that you need to listen to developer.mozilla.org/en-US/docs/Web/API/Window/hashchange_event and update the iframe src accordingly.
Also you can not just append the hash, because the existing iframe src might already have a hash.
Let me know if you need any help with this!
listen for hashchange properly update hash value Signed-off-by: John Rallis <rallisf1@yahoo.gr>
|
I updated as you requested. Ideally we should catch the hashchange in the iframe as well, but that requires using postMessage, which needs custom code in the SPA. As this is mostly unavailable (e.g. when loading a SaaS, or just not able to edit the SPA's code), I didn't add an event listener for it. |
|
Indeed, that probably won't work. |
|
I'll test it tomorrow, but the code looks good :) Thank you for your contribution! |
provokateurin
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works as expected 🚀
|
Hello there, We hope that the review process is going smooth and is helpful for you. We want to ensure your pull request is reviewed to your satisfaction. If you have a moment, our community management team would very much appreciate your feedback on your experience with this PR review process. Your feedback is valuable to us as we continuously strive to improve our community developer experience. Please take a moment to complete our short survey by clicking on the following link: https://cloud.nextcloud.com/apps/forms/s/i9Ago4EQRZ7TWxjfmeEpPkf6 Thank you for contributing to Nextcloud and we hope to hear from you soon! (If you believe you should not receive this message, you can add yourself to the blocklist.) |
Some SPAs (e.g. Zammad), use hash routing (e.g. /#ticket/...). With this change you can have working internal routing for links like
https://my.nextcloud.com/apps/external/1/#ticket/zoom/102