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

Example page view source doesn't work in Chrome #20

Closed
DouglasLivingstone opened this issue Apr 9, 2012 · 3 comments
Closed

Example page view source doesn't work in Chrome #20

DouglasLivingstone opened this issue Apr 9, 2012 · 3 comments

Comments

@DouglasLivingstone
Copy link

On http://mtrpcic.github.com/pathjs/html5_basic.html there is an instruction to view the source of the page to see what's going on. That won't work in Chrome after clicking on any of push state links, eg Users.

View source in Chrome opens a new tab to a view source url, for example:

view-source:http://mtrpcic.github.com/users

This does a request for http://mtrpcic.github.com/users, then shows the source of the GitHub 404 page.

@dannyc
Copy link

dannyc commented Apr 16, 2012

This is not an issue with Chrome's view source this is an issue with the page's updated URL losing all of it's path after the domain. You would run into a 404 error if you tried to do a page refresh (ctrl +r) since the URL does not map to real resource. The initial URL is
http://mtrpcic.github.com/pathjs/html5_basic.html
after clicking on about:
http://mtrpcic.github.com/about
the "/pathjs/html5_basic.html" got lost. Without digging too much into the code the problem is either in the example's call to Path.history.pushState or in pathjs's pushState implementation ignoring the path. I imagine that this is not expected behavior and the path should be maintained, otherwise deep linking, bookmarking, (view source, open new tabs), etc. is impossible.

@DouglasLivingstone
Copy link
Author

Agreed, this isn't a bug in Chrome. It works in some browsers (for example, Safari always shows the source for the initial page) so I included full steps to reproduce.

A simple fix would be to use paths like /pathjs/html5_basic.html?page=about so that extra files are not required in the repository.

@mtrpcic
Copy link
Owner

mtrpcic commented Apr 29, 2012

This isn't an issue with PathJS, it's an issue with some browsers implementation of the "View Source" function. Some browsers take the current pages source, while others do another request. If you'd like to view the source of the HTML5 examples, simply view the source before modifying the URL via interaction with HTML5 pushState.

@mtrpcic mtrpcic closed this as completed Apr 29, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants