Remove a line that is clearing the hash fragment in the window URL fo…#31
Remove a line that is clearing the hash fragment in the window URL fo…#31vemonet wants to merge 1 commit intozazuko:mainfrom
Conversation
…r no reason. Wherever this line is there or not, adding a # fragment is anyway breaking the ability of Yasgui to use query params (e.g. ?query), so removing the hash does not do anything apart from introducing unwanted side effects and removing freedom from developers using Yasgui. Also improved a bit the readme docs to run tests
|
| //firefox does some decoding if we're using window.location.hash (e.g. the + sign in contentType settings) | ||
| //Don't want this. So simply get the hash string ourselves | ||
| url.query(url.anchor()); | ||
| if (urlFromWindow) window.location.hash = ""; //clear hash |
There was a problem hiding this comment.
Thank you for the PR and also for the documentation improvements.
I understand the reason why the removal of the hash from the URL could impact some websites, but this was the behavior since years. Changing this would also have unexpected effects for current solutions.
An alternative could be to add an explicit configuration parameter ; by default it keeps the current behavior, and if this new configuration option is set, then that hash clearing could be ignored.
@vemonet do you think it could make sense?
That way we have something that is still behaving the way people expect, and for people having an issue with the current behavior could easily just explicitly tell Yasgui to not remove the hash.
Could you update this PR to integrate that suggestion?
Remove a line that is clearing the hash fragment in the window URL for no reason. There are no comments in the code about why they did that. And I don't see why it is need. Anyway wherever this line is there or not, adding a # fragment is breaking the ability of Yasgui to use query params (e.g. ?query), so removing the hash does not do anything apart from introducing unwanted side effects and removing freedom from developers using Yasgui. Some developers deploying Yasgui might want to use the #, in our case it will allow to link to specific example queries so that they can be shared using their IRI
Also improved a bit the readme docs to run tests
@ludovicm67