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

History API doesn’t work for local files #222

Closed
ai opened this issue Sep 9, 2015 · 19 comments
Closed

History API doesn’t work for local files #222

ai opened this issue Sep 9, 2015 · 19 comments

Comments

@ai
Copy link

ai commented Sep 9, 2015

History.pushState is prohibited in local files. As result there is not way to open Shower presentation as file from disk.

@pepelsbey seems like critical issue.

@pepelsbey
Copy link
Member

Yes, since Chrome 45 History API doesn’t work for local files. We’re open for suggestions, something better than “just use hashbangs alredy” :\

@pepelsbey pepelsbey changed the title Don’t work as local file because of SecurityError History API doesn’t work for local files Sep 10, 2015
@ai
Copy link
Author

ai commented Sep 10, 2015

Can tag has two IDs? 1 and full1?

@pepelsbey
Copy link
Member

@ai, the point of real ID is to use :target pseudo-class for the current slide, which works even without JS. This is the right thing to do: use features available in the language exactly how they were designed.

@ai
Copy link
Author

ai commented Sep 10, 2015

@pepelsbey I know, this is why I ask about two IDs.

@pepelsbey
Copy link
Member

There’s only one ID in index.html#full1, non-exiting one :(

@ai
Copy link
Author

ai commented Sep 10, 2015

What about removing ID changes in overview mode? Why we need to non-JS keyboard selection?

@pepelsbey
Copy link
Member

Let’s look at the following URL: index.html?full#last — full mode, last slide, clean and simple. And if you remove ?full you’ll get index.html#last last slide in list mode or without #last you’ll get index.html?full just a full screen mode with the very first slide selected.

This system is too good to just trash it.

@pepelsbey
Copy link
Member

If you have index.html#full-last and index.html#last it could mean anything and this is not something you’d edit manually to change current slide or presentation’s mode :(

@ai
Copy link
Author

ai commented Sep 10, 2015

@pepelsbey the bug is critical to denial ;).

?full#last was not so good solution, because query part of URL mean different thing. We have same document, so we need to have same URL without hash.

@ai
Copy link
Author

ai commented Sep 10, 2015

@pepelsbey so what do you think if index.html#last will be a fullscreen slide and we week not have non-JS keyboard in overview.

We need to fix this issue as fast as possible, and non-JS keyboard overview is to rare case.

@pepelsbey
Copy link
Member

@zloylos, any ideas how this could be fixed? This is rather critical as most presentations are launched locally and setting up a server is not a viable option in many cases :\

@pepelsbey
Copy link
Member

I wonder if History API could polifilled somehow only for Chrome. There’s history.js for example.

@ai
Copy link
Author

ai commented Sep 10, 2015

@pepelsbey it is common security issue. This bahviour will be standard way or we all will have secirity problems.

@pepelsbey
Copy link
Member

Solution: use only slide IDs index.html#1 and store mode in body class name <body class="shower full"> and in localStorage so it would stay if you’d reload page. And open in full screen mode by default if there’s #ID in URL and in the list mode if there’s no one.

@ai
Copy link
Author

ai commented Sep 17, 2015

@pepelsbey who is current JS programmer to ask to fix it? I can also try to fix it, when I will finish slides.

@ghost
Copy link

ghost commented Sep 17, 2015

@pepelsbey @ai I will try to fix it for few days.

@pepelsbey
Copy link
Member

Fixed by shower/core/pull/22

@pepelsbey
Copy link
Member

Right, it seems they have reverted this behavior for local files. This thing works fine in the current Chrome.

<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<title></title>
</head>
<body>
	<script>
		history.replaceState(null, null, '?full');
	</script>
</body>
</html>

@shvaikalesh, I guess it’s time to bring it back :) But let me test in IE/Edge first.

@pepelsbey pepelsbey reopened this Aug 3, 2017
@pepelsbey
Copy link
Member

pepelsbey commented Aug 3, 2017

It works just fine in IE11 and Edge, as well as in Firefox and Safari.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants