browser-history

history.replaceState still adds entries to the “Browsing History”

ぐ巨炮叔叔 提交于 2019-12-20 12:28:19
问题 The bounty expires in 4 days . Answers to this question are eligible for a +50 reputation bounty. John is looking for a more detailed answer to this question. Specifically, calling the following snippet of code: history.replaceState(undefined, undefined, "#" + value) will correctly not affect the back button behavior of the current page, but will add an entry to the "browsing history" page, which I don’t want. Pictured below is Chrome’s History page, but this also happens in Firefox. Is there

How to handle back button when browser is not firing popstate event immediately

落爺英雄遲暮 提交于 2019-12-20 10:25:13
问题 This question may sound weird, because most of the time popstate is fired synchronously as users press the back button. However, W3C spec states that a UA (browser) is allowed to queue popstate when traversing history (see item 14), ie. popstate is fired asynchronously (even though URL has changed at this point). Browser vendors interpret and implement this spec differently. Mozilla decides Firefox should be able to fire popstate before load , and for good reasons, so that slow images will

can I check what site window.history.back() will bring the user to?

偶尔善良 提交于 2019-12-20 03:23:17
问题 in one of my webpages I want to send the user back to the previous page after some computation, but only if the previous page was a page from my website. So I am wondering if there is an easy way to check that? Thank you for any input! 回答1: You can however check how you arrived at the current page by using 2 methods: document.referrer , but that only works if the user didn't block that, and gives you some limited info. A more robust method might be to set some information about the previous

History push state redirects instead of just pushing new state to browser history

删除回忆录丶 提交于 2019-12-19 10:32:30
问题 I am trying to push a new state to browser history on my APP initialization but while pushing the state it also redirects the page which is not required. Here is a demo working app. https://angular-tet5fy.stackblitz.io/page2?fbclid=IwAR1zP_UTnCQxKMp8o3ZXf-n4NR3ftu_4JoulLqItaONa-_wSPJ_DT95OgRU This is the code: ngAfterViewInit() { console.log('init called'); var x = document.referrer; console.log('ref', x); if (x) { console.log('pushing state'); this.location.pushState({id:'page3'}, 'Page3', '

History push state redirects instead of just pushing new state to browser history

江枫思渺然 提交于 2019-12-19 10:32:08
问题 I am trying to push a new state to browser history on my APP initialization but while pushing the state it also redirects the page which is not required. Here is a demo working app. https://angular-tet5fy.stackblitz.io/page2?fbclid=IwAR1zP_UTnCQxKMp8o3ZXf-n4NR3ftu_4JoulLqItaONa-_wSPJ_DT95OgRU This is the code: ngAfterViewInit() { console.log('init called'); var x = document.referrer; console.log('ref', x); if (x) { console.log('pushing state'); this.location.pushState({id:'page3'}, 'Page3', '

Current state of Jquery history/back-button plugins?

痞子三分冷 提交于 2019-12-18 12:44:30
问题 I spent a long time looking into this about a year ago, I tried: Jquery BBQ plugin Jquery History plugin jquery .address plugin I found the jquery.address plugin to be the best, but these things change quickly. Has anyone thoroughly researched the options for this RECENTLY? Keen to hear some thoughts before I integrate jquery.address again (I didn't have any issues with it before) 回答1: Hey Guys, I'm the author of History.js which as SnippetSpace has said in his answer works with the HTML5

What format is the Safari History.db history_visits.visit_time in?

前提是你 提交于 2019-12-18 12:01:02
问题 When looking at the History.db from Safari, there's a table named history_visits which has a column named visit_time , which is a REAL value. It has values such as 470799793.096987 . What format is that in? I'd like to see it in a format such as 12/08/2015 05:12:05. 回答1: It's the number in seconds since 00:00:00 UTC on 1 January 2001. It must be coming from an NSDate . NSDate objects encapsulate a single point in time, independent of any particular calendrical system or time zone. Date

How do I actually use history.js on my site

淺唱寂寞╮ 提交于 2019-12-18 10:10:19
问题 I've read all the posts about history.js on stackoverflow including, this, this and this and at looked the source code but as a newcomer to javascript/jquery I'm having trouble figuring out how to actually implement to have html 5 history support and fallback to support html4 browsers such as ie8/9. As I can appreciate the UX benefits from presenting consistent URL's as much as possible, how this solves deep linking and allows for bookmarking I want to implement but I get a bit lost when

Prevent browser scroll on HTML5 History popstate

六眼飞鱼酱① 提交于 2019-12-18 09:57:18
问题 Is it possible to prevent the default behaviour of scrolling the document when a popstate event occurs? Our site uses jQuery animated scrolling and History.js, and state changes should scroll the user around to different areas of the page whether via pushstate or popstate. The trouble is the browser restores the scroll position of the previous state automatically when a popstate event occurs. I've tried using a container element set to 100% width and height of the document and scrolling the

browser back and forward button does not invoke callback method with statechange event of history.js

穿精又带淫゛_ 提交于 2019-12-18 05:06:06
问题 I used (https://github.com/browserstate/history.js) and have a piece of code like this History.Adapter.bind(window, 'statechange', function() { var State = History.getState(); alert('Inside History.Adapter.bind: ' + State.data.myData); }); function manageHistory(url, data, uniqueId){ var History = window.History; if ( !History.enabled ) { return false; } History.replaceState({myData: data}, null, '?stateHistory=' + uniqueId); } if I invoke manageHistory() after my ajax call, then History