browser-history

React router 4 history.listen never fires

左心房为你撑大大i 提交于 2019-12-03 11:22:38
Switched to router v4 and history v4.5.1 and now history listener not working import createBrowserHistory from 'history/createBrowserHistory' const history = createBrowserHistory() history.listen((location, action) => { console.log(action, location.pathname, location.state) // <=== Never happens }) render( <Provider store={store}> <Router history={history}> ... </Router> </Provider>, document.getElementById('root') ) Any ideas why it is being ignored? Since you are using BrowserRouter(with import alias Router as mentioned in comments of the question), it doesn't care the history prop you pass

accessing history in a firefox addon

南笙酒味 提交于 2019-12-03 09:16:24
I'm working on a firefox addon, using the addon builder. I want to periodically scan the browser's history.. the entire history. I'm looking for functionality like chrome's history api . It seems window.history is limited to session history only. Any help? I'm going crazy trying to figure this out. Addons like history export must do something like this, but their code is not immediately understandable to me. You'll need to access the xpcom service nsIBrowserHistory , here's some example code that works with the SDK: https://builder.addons.mozilla.org/package/157396/latest/ The places api is a

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

给你一囗甜甜゛ 提交于 2019-12-03 09:15: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

Clear Android Browser History

流过昼夜 提交于 2019-12-03 08:33:10
I am writing an application for a client that will have several devices that are open to customers to look at and play with. They want to be able to clear the browser history on a regular basis so that if a customer opens the browser to an inappropriate web site the next customer to come along will not see this. I am currently using this to clear the history and searches: Browser.clearHistory(getContentResolver()); Browser.clearSearches(getContentResolver()); This correctly clears the history. But any windows(tabs) that were open in the browser remain open. How can I tell the browser to close

Clear WebBrowser control browsing history

↘锁芯ラ 提交于 2019-12-03 08:27:45
I want to clear WebBrowser control history after WebBrowser completes its browsing. The history state of the System.Windows.Forms.WebBrowse control is internal and cannot be modified directly. All actions are performed via the GoBack and GoForward methods. You can prevent your users from going backwards and forwards by setting the CanGoBack and CanGoForward properties to false. You would also want to modify the AllowWebBrowserDrop , WebBrowserShortcutsEnabled and IsWebBroserContextMenuEnabled properties as well. Because history is only exposed through these methods, properties and user actions

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

穿精又带淫゛_ 提交于 2019-12-03 08:12:37
问题 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. 回答1: Is it possible for you to use the input

how to change url without changing browser history

删除回忆录丶 提交于 2019-12-03 08:08:28
问题 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

How do I remove a page from the browser history?

故事扮演 提交于 2019-12-03 05:22:37
I have an have an ASP.Net page which contains a button. This Page contains a ServerSide Paypal button. When pushed my server does various clever things on the back end and then rewrites the response as a form and some javascript which posts this form to paypal.. This all works great. However, if the user then elects to click back, they will arrive at my generated self-posting form and that will forward them again to Paypal. I thought if I could find a way to have my generated form page not exist in the history, then this will solve my problem. but I have no idea how to correct this. How can I

Can I update window.location.hash without having the web page scroll?

感情迁移 提交于 2019-12-03 04:27:33
Using JavaScript, is there a way to update window.location.hash without scrolling the web page? I have clickable title elements that toggle the visibility of a div directly beneath them. I want the /foo#bar in the history when clicking titles but don't want the page scrolling about. So when navigating away from /foo#bar I'll be able to use the back button and have the div whose ID is in window.location.hash be visible upon return. Is this behavior possible? This behavior is very much possible. You should look into some of the libraries that have been developed to give you this functionality.

Getting the current URL in an Android browser

被刻印的时光 ゝ 提交于 2019-12-03 03:20:46
I'm searching for a way to get the current URL a user is visiting on the android browser application. I figured out that I can get the last visited URL from the Browser.BOOKMARKS_URI database using the following technique: Cursor cursor = context.getContentResolver().query(Browser.BOOKMARKS_URI, Browser.HISTORY_PROJECTION, null, null, Browser.BookmarkColumns.DATE + " DESC"); cursor.moveToNext(); String url = cursor.getString(Browser.HISTORY_PROJECTION_URL_INDEX); cursor.close(); The problem with this, is that the Browser.BOOKMARKS_URI db doesn't get updated when the user presses back in order