开发者

How can I return home from an a Rails Kiosk Error page without an adress bar or keyboard

开发者 https://www.devze.com 2023-02-11 06:02 出处:网络
Im hosting a rails app on heroku. It runs on the client on a touchscreen with Google Chrome in Kiosk mode, so no browser chrome or keyboard. The login/home page is different for every kiosk.

Im hosting a rails app on heroku. It runs on the client on a touchscreen with Google Chrome in Kiosk mode, so no browser chrome or keyboard. The login/home page is different for every kiosk.

Error pages are static assets, so I'll have to do this with Javascript. If there is an error I want to display a button that will let the user get back to the home page.

I can't just use a back button script b/c of the potential for multiple errors. I thought about using localstorage to store a reference to the home page, but the error pages are served from a different domain so they wont have access.

Any ideas?

Edit: This works in Firefox onClick="window.home();" If I set the browser's home page to that particular kiosk. But apparently isn't supported in Chrome. Is there an开发者_JAVA百科y way to store some kind of variable that any domain can access on a per browser/kiosk basis.


I think you're making this too hard. You already have the information you need to go back stored in "local storage" -- the browser history. Simply use javascript to look at the history and go back as far as you need.

As far as returning to the home page, isn't the home page a well known URI? What's wrong with <a href="http://example.com/index.html">go home</a>?

Update

Isn't the home page always going to be the first page in the history? You seem to be saying that you're in a situation where you want to return to a page for which you don't know the base URI, don't know how you got where you are, and don't know where you started.

I suppose you could put the place you'd like to go into a cookie, but if you don't even know the base URI, how would you retrieve it?

I'm beginning to think the real answer is "you need to rethink your design, there's something deeply wrong."

0

精彩评论

暂无评论...
验证码 换一张
取 消