質問

The main question: I need to know that previous link in my browser - is link of my site?

There are several problems:

  1. I can put current url to my stack, and when i go back through my internal method, I just remove it from url. But! If I go back or forward by press browser button how can I know is back or forward event?
  2. If I have a stack, after refresh page this stack is clear, but browser has a history (browser buttons back and forward is active).

This is the single page backbone application.

Thanks!

役に立ちましたか?

解決

After long investigation of this problem, I understand that browser (substantially I do it in Chrome) do everything to not give application information about browser history. Because it's security information. So legal way to do this does not exist.

So, in my case I assume that refreshing browser restarts single page application, and it has no history. And I serve my own history using managed Backbone router events and "back" event is handled only by clicking on MY button "back", but not browsers.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top