摘要 |
In some example embodiments, a request for a navigation action is detected via a web browser during a pre-navigation state of a single page application, and a state object is persisted, with the state object comprising a dictionary property and an index property. The dictionary property comprises a list of all uniform resource locator (URL) fragments stored in a browser history, with the list of URL fragments comprising a pre-navigation URL fragment for the pre-navigation state and a post-navigation URL fragment for a post-navigation state. The pre-navigation state is navigated to within the web browser using the state object. Based on a detection of unsaved data, a navigation confirmation request is displayed within the recovered pre-navigation state of the single-page application using the pre-navigation URL fragment. The navigation confirmation request is configured to receive an indication of whether or not to perform the navigation action. |
主权项 |
1. A system comprising:
an event detection module configured to detect a request for a navigation action via a web browser during a pre-navigation state of a single page application within the web browser; a state persistence module, executable on at least one processor, configured to persist a state object, the state object comprising a dictionary property and an index property, the dictionary property comprising a list of all uniform resource locator (URL) fragments stored in a browser history of the web browser, the list of URL fragments comprising a pre-navigation URL fragment corresponding to the pre-navigation state and a post-navigation URL fragment corresponding to a post-navigation state, the post-navigation state corresponding to a result of a performance of the navigation action, the index property comprising an index of a current URL fragment in the list of the dictionary property; and a navigation module configured to:
navigate, based on the detecting the request, to the pre-navigation state of the single-page application within the web browser using the state object;detect unsaved data for the single-page application; anddisplay, based on the detecting the unsaved data, a navigation confirmation request within the recovered pre-navigation state of the single-page application using the pre-navigation URL fragment, the navigation confirmation request being configured to receive an indication of whether or not to perform the navigation action within the web browser. |