browser-history

How do you access browser history?

感情迁移 提交于 2019-12-27 11:43:15
问题 Some e-Marketing tools claim to choose which web page to display based on where you were before. That is, if you've been browsing truck sites and then go to Ford.com, your first page would be of the Ford Explorer. I know you can get the immediate preceding page with HTTP_REFERRER, but how do you know where they were 6 sites ago? 回答1: Javascript this should get you started: http://www.dicabrio.com/javascript/steal-history.php There are more nefarius means to: http://ha.ckers.org/blog/20070228

How to get notified about changes of the history via history.pushState?

拟墨画扇 提交于 2019-12-27 10:19:52
问题 So now that HTML5 introduces history.pushState to change the browsers history, websites start using this in combination with Ajax instead of changing the fragment identifier of the URL. Sadly that means that those calls cannot be detect anymore by onhashchange . My question is: Is there a reliable way (hack? ;)) to detect when a website uses history.pushState ? The specification does not state anything about events that are raised (at least I couldn't find anything). I tried to create a

Angular Browser History back without reload previous page

喜欢而已 提交于 2019-12-25 07:29:42
问题 i have a AngularJS app with list of items and the detail of the item. If I do some changes in detail and I want to return to list , list is already created again via remote request. What is the best practice to stop reloading page after return from detail? I tried to solve it via this topic: angularjs getting previous route path But without luck. In list I'm using: data-ng-controller="UsersCtrl" data-ng-init="initGrid()" I think that problem is here. Thanks for any advice and simple example.

Stop android browser from loading URL

被刻印的时光 ゝ 提交于 2019-12-25 02:11:39
问题 Is there any way to stop android native browser from being loading specific URL (eg. xyz.com) provided by my app and show notification about blocking ? If we can't stop then how to redirect browser to that another HTML page like otherPage.html (that is saved in sdcard) whenever xyz.com is visited? I am busting my head into for many days with lot of searching, but no luck so far. Any example/tutorial would be great. Bundle Thanks 回答1: You can create a WebViewClient and "filter" specific url:

Test browser history before going back via javascript?

一笑奈何 提交于 2019-12-24 21:37:40
问题 I'm playing around with using some javascript to add extra functionality to a back button on my website. Right now I have a set of javascript that looks like this: $(".back-link a").live("click", function(){ history.go(-1); return false; }); Now, it works great but I'm trying to make it as bulletproof as possible and one issue I foresee is that if someone lands on a project page and hasn't come to it via my home page then going back in their history one step will take them off my site.

Add query string using pushstate

人走茶凉 提交于 2019-12-24 16:31:09
问题 I am doing something like below if(history.pushState) { var stateObject = { dummy: true }; var url = window.location.protocol + "//" + window.location.host + window.location.pathname + '?myNewUrlQuery=1'; history.pushState(stateObject, jQuery(document).find('title').text(), + url); } I am getting pathname correct, but getting query string as Nan. For example I am getting result like http://example.com/mypage/Nan Instead of http://example.com/page/?myNewUrlQuery=1 Please tell me is it possible

javascript redirect with hash tag

蹲街弑〆低调 提交于 2019-12-24 16:19:26
问题 I have implemented my website's search results with AJAX, using History.js. For HTML5 browsers, I have URLs like http://example.com/search/X6a2/3 , which, in browsers not supporting the History API, does fall back nicely to http://example.com/search/#X6a2/3 . However, if a HTML5 URL is opened in an older browser, the new hash tag is appended to the full URL as soon as the page is changed. (for example http://example.com/search/X6a2/3#/X6a2/4 - ugh!) All I need is a clean way to redirect to

iOS UIWebView: How can I figure out what the previous URL is?

喜欢而已 提交于 2019-12-24 02:39:10
问题 I'm rewriting the goBack function with my own because I need to be able to change the URL depending on whether the orientation changed or not. How can I access the URL history and figure out the previous one? 回答1: You need to implement the UIWebViewDelegate. It has methods that will allow you to control the back functionality as well as letting you capture the URL when you navigate to it. 来源: https://stackoverflow.com/questions/7958601/ios-uiwebview-how-can-i-figure-out-what-the-previous-url

Implementing history-api-fallback for Webpack Production environment

淺唱寂寞╮ 提交于 2019-12-24 01:43:09
问题 My stack is React/Redux as frontend together with React Router v4 and Firebase Hosting as backend. Like many others, I also faced the issue of meeting the 404 page not found when users refreshed at a page other than the root URL like https://example.com/about or manually key in the URL https://example.com/about. I researched many websites and HashBrowser seem to be a workaround for this problem but it is not a complete solution. It does not bring the user to the correct page but instead

Android Webview: Is there a way to know what the previous URL is?

折月煮酒 提交于 2019-12-23 07:36:34
问题 Is there a way to access the history so that I know what URL the user is visiting when they hit the back button (which calls WebView.goBack())? 回答1: This is probably the method you're looking for: WebView.copyBackForwardList 回答2: String historyUrl=""; myWebView = (WebView) findViewById(R.id.webViewContent); WebBackForwardList mWebBackForwardList = myWebView.copyBackForwardList(); if (mWebBackForwardList.getCurrentIndex() > 0) historyUrl = mWebBackForwardList.getItemAtIndex(mWebBackForwardList