browser-history

Selective history.back() using Backbone.js

吃可爱长大的小学妹 提交于 2019-12-03 03:02:46
I have a Backbone app. I'm using Backbone.history to enable use of the back button. We have a page (settings) that auto loads a popup requiring input from the user. If the user chooses cancel, I want to go back to the previous page. I can do this using window.history.back(). The problem is, if the user went directly to that page (app#settings) from another url (like google) by typing the url into the browser, I want to redirect the user to the home page (app/) rather than going back to google. I haven't been able to figure out any way to do this. Backbone.history looks like it store

Angular 2: Prevent router from adding to history

我只是一个虾纸丫 提交于 2019-12-03 02:59:13
We have a client that is iFraming in our app to their website. They don't want the router navigation within our app to affect the back button navigation for their own site. We've tried a couple methods including using post messages to try and have the iFrame communicate with the parent window whenever a history.back() is triggered. My question is if there is any easy way to not affect the browser's history when using Angular 2's router. As far as I know, I couldn't find anything within Angular 2's advanced router documentation: https://angular.io/docs/ts/latest/guide/router.html It turns out

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

别等时光非礼了梦想. 提交于 2019-12-03 02:11:18
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 some way to replace the current URL without adding an entry to the user’s browsing history? I’m inquiring about the standalone Browser History page, not the actual page navigation history that the Back button uses. The correct way to make it is using the

preserving browser “back” button functionality using AJAX/jQuery to load pages and history.pushState() method

对着背影说爱祢 提交于 2019-12-02 23:32:09
I'd like to preserve the back button functionality when loading pages via AJAX (jQuery load method) and pushing the URL to the browser bar via the history.pushState method. The problem occurs when one clicks on the browser back button and the 1st click only restores the previous URL but does not load the previous page. Here's my code so far: $(function(){ var profile_url= "/profile"; $('#click_button').click(function(){ $('#main_content').load(profile_url); history.pushState({profile:profile_info}, "profile", profile_url); }); }); My question is is there any way to do an AJAX load of the

How to turn off autocomplete while keep using datalist element in html

最后都变了- 提交于 2019-12-02 23:25:39
I have a input field which shows a list using html5 <datalist> element. The problem is that with <datalist> the browser autocomplete also shows the history list (which is the list of previously typed values, that are not included in the <datalist> ). So I just want to get rid of the history-list not the <datalist> . If I use the autocomplete = "off" feature, this also blocks the <datalist> . In short, I just want the <datalist> not the history one. Is it possible for you to use the input field without an id or name attribute? Without that, the browser doesn't really have any way to associate a

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

↘锁芯ラ 提交于 2019-12-02 22:15:29
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 not block popstate . Chrome/Safari decides otherwise, and it leads our problem: When managing history for

how to change url without changing browser history

浪尽此生 提交于 2019-12-02 21:40:46
Until now, I only know that if I want to change URL without reloading the whole page i have to use HTML browser history API. I am using this concept in my website. Let's take example. Let suppose user is on this page https://www.example.com/aboutus and then he goes to product listing in which we have filters. On clicking any filters system generates new url something like this https://www.example.com/products?brands[]=song&brands[]=samsung&condition[]=new Internally it is just calling history.pushState({}, 'Title', link.href); But, it has one problem. Clicking back button takes to the previous

Angular: take user to home on clicking browser back button [duplicate]

久未见 提交于 2019-12-02 07:21:26
问题 This question already has answers here : History push state redirects instead of just pushing new state to browser history (2 answers) Closed 8 months ago . I want to take the user to the home page when a user clicks on the back button of the browser if the user is in my angular platform. There is an edge case as well which is to be handled, if user has come to our platform via google search, Fb or direct entering link, then we cant this behavior but if he ia already roaming around in our

Angular: take user to home on clicking browser back button [duplicate]

為{幸葍}努か 提交于 2019-12-02 03:33:53
This question already has an answer here: History push state redirects instead of just pushing new state to browser history 2 answers I want to take the user to the home page when a user clicks on the back button of the browser if the user is in my angular platform. There is an edge case as well which is to be handled, if user has come to our platform via google search, Fb or direct entering link, then we cant this behavior but if he ia already roaming around in our platform then we don't want each back button to take user to home. i.e. User Enter the link and press button => take him to home.

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

流过昼夜 提交于 2019-12-02 01:51:32
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! 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 page in either the URL, or in a SESSION variable. No. For security reasons the History object doesn't allow