browser-history

Gatsby.js: Navigating with URL Parameters and the Browser Back / Forward Buttons

江枫思渺然 提交于 2019-12-05 05:45:16
I have an Articles component which displays a list of posts. The list is paginated so that a maximum of 10 posts can display per page. There is a "Next Page" button that when clicked will update the component state and the corresponding url parameter like so: page 1: /news page 2: /news?page=2 page 3: /news?page=3 ...and so on. The way the constructor() and render() methods are set up, it will read this URL parameter and display the correct posts if the user navigates directly to /news?page=3, for instance. The issue I'm having is that the browser back and forward buttons don't seem to

getting WebView history from WebBackForwardList

試著忘記壹切 提交于 2019-12-05 04:34:14
How do i get the history of a WebView using the WebBackForwardList class? I looked at the documentation page but i could not understand it, is WebBackForwardList the proper way to access the history of WebView? I intend to parse the history to a ListView, I cannot find any examples of how to access the history of WebView, What is the proper method to get the history? On your webView instance, just use copyBackForwardList(), for example WebBackForwardList wbfl = webView.copyBackForwardList(); Then setup a for-loop to scan the list, pull entries (e.g., title, URL), and send them to your ListView

Support browser back-button with ajax without relying on a hash change?

不打扰是莪最后的温柔 提交于 2019-12-05 04:13:26
问题 I'm currently using the jQuery BBQ plugin to enable the bowser navigation buttons to work, but I have a problem in that if a bookmark is saved by a user for one of the pages, say... www.mysite.com/#page1 when the user returns via the bookmark the full page has to first load... www.mysite.com/ before the hash part of the url can be used for the ajax call back to complete the page. To address the problem I've tried creating only a 'skeleton' page on all url calls to the main page so that all

HTML5 push/replaceState and the <base> tag causes security exception

纵然是瞬间 提交于 2019-12-05 03:16:33
I have a test version of a site located at a subdomain of the normal site, like: http://test.x.com instead of http://x.com . I use the <base> tag to translate all resource requests back to the original domain: <base href="http://x.com/" /> This tactic worked great until I implemented HTML5 push/replaceState support. Now, if I execute this statement in the console: history.pushState({}, "", ""); ... then I get a DOMException object in WebKit-based browsers: code: 18 constructor: DOMExceptionConstructor line: 2 message: "SECURITY_ERR: DOM Exception 18" name: "SECURITY_ERR" sourceId: 4839191928 _

Backbone.history.start() blocks back button from leaving the page

▼魔方 西西 提交于 2019-12-05 02:47:39
问题 I've run into this on a few apps now, so I wonder if I'm doing something wrong with Backbone history. Here's the situation... I have two pages, let's say: index.html app.html The index page is just a normal, flat HTML page with a link to app.html . On the App page, Backbone.history.start() is called to fire up hash state management, which is used to toggle between two views on the App page, say: app.html#search app.html#results So, navigating back and forth between the #search and #results

Changing state without changing browser history in angular ui-router

一个人想着一个人 提交于 2019-12-04 22:30:14
Assume that we have a logic like this: From state A, change to state B. Whenever we arrive to state B, the app always redirect us to state C by calling $state.go(stateC) Now we are in state C My question is how to go back to state A from state C (given the fact that state A can be any state we don't know at run-time, meaning user can access state B from any other states) Use the location option with value "replace" ... $state.go(stateC, null, { location: 'replace' }) See https://angular-ui.github.io/ui-router/site/#/api/ui.router.state.$state#methods_go location - {boolean=true|string=} - If

HTML5 reload page when moving back

馋奶兔 提交于 2019-12-04 21:33:32
I'm working with Moodle 2.6, but this isn't really a Moodle question. An activity is defined as an URL. That URL is just a custom-built video player. When the video ends, it goes back to the Moodle course page. That all works just fine, but the Moodle page doesn't reflect that this activity has been completed until the page is refreshed/reloaded using F5. Here is the javascript code that I've used to detect the end of the video: video1.addEventListener("ended", function() { history.back(1); }); I've tried using this: window.location.reload(history.go(-1)); in place of the history.back(1),

Stop page from appearing in browser history

时光总嘲笑我的痴心妄想 提交于 2019-12-04 16:55:01
I have a simple flow: A.html -> B.html -> C.html Now, page B either 302's (temporarily redirects giving 302 redirect code) to page C , or it shows a progress bar; then, after an ajax call is done, it redirects to page C . When the user is on C , and they hit "Back" I want them to end up on A instead of B . If the page did the 302 redirect, then the back behavior is what I want. Otherwise they get that intermediary page. Is there any way to solve this easily? Presumably when the Ajax is done you are using: location.href = "http://example.com/c"; Change that to: location.replace("http://example

Clear WebBrowser control browsing history

一个人想着一个人 提交于 2019-12-04 14:27:25
问题 I want to clear WebBrowser control history after WebBrowser completes its browsing. 回答1: 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

How do I disable backbone history but still allow hash-based routing?

瘦欲@ 提交于 2019-12-04 11:20:30
问题 Say I do the following: Click a link on the homepage (/) and go to /posts/1 Trigger an event and go to the backbone route /posts/1/#/1/edit I click back I need to make it so that the user ends up back on the homepage (/) not back at /posts/1 So I need to allow for backbone hash routes to work but not modify the history. I'd personally prefer to keep the history, but it's a requirement of a project. 回答1: The latest version of Backbone (0.9.x) has the ability to trigger a route, but not add it