HTML5 Session History & Navigation support in Opera Presto 2.10

W3C reference
HTML5 Session History and Navigation

Opera Presto provides support for the HTML5 Session History and Navigation (Location) interfaces.

History interface

The sequence of Documents in a browsing context is its session history. History objects provide a representation of the pages in the session history of browsing contexts. Each browsing context, including nested browsing contexts, has a distinct session history. Opera Presto's support is described in the following data table.

Method Description Support
Note: history.back/forward/go are now asynchronous when jumping to a new URL that differs only by a fragment identifier.
window.history.length
  • The length attribute of the History interface returns the number of entries in the joint session history.
  • When employed in Opera, it uses "joint" session history, not just "back" history, as per the current HTML5 draft.
Yes
window.history.state
  • Returns the current state object.
  • The state attribute of the History interface must return the last value it was set to by the user agent.
  • Initially, its value must be null.
Yes
window.history.go([delta])
  • Goes back or forward the specified number of steps in the joint session history.
  • A zero delta will reload the current page.
  • If the delta is out of range, does nothing.
  • When the go(delta) method is invoked, if the argument to the method was omitted or has the value zero, the user agent must act as if the location.reload() method was called instead. Otherwise, the user agent must traverse the history by a delta whose value is the value of the method's argument.
Yes
window.history.back()
  • Goes back one step in the joint session history.
  • If there is no previous page, does nothing.
  • When the back() method is invoked, the user agent must traverse the history by a delta -1.
Yes
window.history.forward()
  • Goes forward one step in the joint session history.
  • If there is no next page, does nothing.
  • When the forward() method is invoked, the user agent must traverse the history by a delta +1.
Yes
window.history.pushState(data, title [,url])
  • Pushes the given data onto the session history with the given URL, if provided.
  • The pushState(data, title, url) method adds a state object entry to the history.
  • The displayed page URL will be updated accordingly.
Yes
window.history.replaceState(data, title [,url])
  • Updates the current entry in the session history to have the given data and if provided, the URL.
  • The replaceState(data, title, url) method updates the state object, title, and optionally the URL of the current entry in the history.
  • The displayed page URL will be updated accordingly.
Yes

Location interface

Each Document object in a browsing context's session history is associated with a unique instance of a Location object. Opera Presto's support is described in the following data table.

Method Description Support
location.href[= value]
  • Returns the current page's location.
  • Can be set to navigate to another page.
  • The href attribute must return the current address of the associated Document object as an absolute URL.
Yes
location.assign(url)
  • Navigates to the given page.
  • When the assign(url) method is invoked, the UA must resolve the argument, relative to the entry script's base URL, and if that is successful, must navigate the browsing context to the specified url.
  • If the browsing context's session history contains only one Document, and that was the about:blank Document created when the browsing context was created, then the navigation must be done with replacement enabled.
  • Navigation for the assign() method must be done with the browsing context of the script that invoked the method as the source browsing context.
Yes
location.replace(url)
  • Removes the current page from the session history and navigates to the given page.
  • When the replace(url) method is invoked, the UA must resolve the argument, relative to the entry script's base URL, and if that is successful, navigate the browsing context to the specified url with replacement enabled.
  • Navigation for the replace() method must be done with the browsing context of the script that invoked the method as the source browsing context.
Yes
location.reload()
  • Reloads the current page.
  • When the reload() method is invoked, the user agent must run the appropriate steps from the following list:
    • If the currently executing task is the dispatch of a resize event in response to the user resizing the browsing context, repaint the browsing context and abort these steps.
    • If the browsing context's active document is an iframe srcdoc document, reprocess the iframe attributes of the browsing context's browsing context container.
    • If the browsing context's active document has its reload override flag set, perform an overridden reload.
    • Otherwise, navigate the browsing context to the document's current address with replacement enabled. The source browsing context must be the browsing context being navigated.
Yes
url=location.resolveURL(url)
  • Resolves the given relative URL to an absolute URL.
  • The resolveURL(url) method must resolve its url argument relative to the entry script's base URL, and if that succeeds return the resulting absolute URL.
  • If it fails, it must throw a SYNTAX_ERR exception instead.
No

Documentation

Opera Help

Need help? Hit F1 anytime while using Opera to access our online help files, or go here.