Skip to main content
added 1 character in body
Source Link
chuckx
  • 7k
  • 1
  • 26
  • 24

In the browser environment, location.back() is wrapper around the window.history object (for a partial path through the source, see here, here, here and here).

The contents of within the History object are purposefully not accessible.

From the HTML History interface documention:

The actual entries are not accessible from script.

From MDN the window.history object documentation:

For security reasons the History object doesn't allow the non-privileged code to access the URLs of other pages in the session history, but it does allow it to navigate the session history.


As to an alternate approach, this answer provides a technique for listening for the last 2 NavigationEnd events.

In the browser environment location.back() is wrapper around the window.history object (for a partial path through the source, see here, here, here and here).

The contents of within the History object are purposefully not accessible.

From the HTML History interface documention:

The actual entries are not accessible from script.

From MDN the window.history object documentation:

For security reasons the History object doesn't allow the non-privileged code to access the URLs of other pages in the session history, but it does allow it to navigate the session history.


As to an alternate approach, this answer provides a technique for listening for the last 2 NavigationEnd events.

In the browser environment, location.back() is wrapper around the window.history object (for a partial path through the source, see here, here, here and here).

The contents within the History object are purposefully not accessible.

From the HTML History interface documention:

The actual entries are not accessible from script.

From MDN the window.history object documentation:

For security reasons the History object doesn't allow the non-privileged code to access the URLs of other pages in the session history, but it does allow it to navigate the session history.


As to an alternate approach, this answer provides a technique for listening for the last 2 NavigationEnd events.

added 1104 characters in body
Source Link
chuckx
  • 7k
  • 1
  • 26
  • 24

I'm assuming location.backIn the browser environment location.back() is wrapper around the window.history object (for a partial path through the source, see here, here, here and here).

The contents of within the History object are purposefully not accessible.

From the HTML History interface documention:

The actual entries are not accessible from script.

From windowMDN the window.history object documentation. From that documentation:

For security reasons the History object doesn't allow the non-privileged code to access the URLs of other pages in the session history, but it does allow it to navigate the session history.

 

So the contents of the history are opaque are on purposeAs to an alternate approach, this answer provides a technique for listening for the last 2 NavigationEnd events.

I'm assuming location.back is wrapper around the window.history object. From that documentation:

For security reasons the History object doesn't allow the non-privileged code to access the URLs of other pages in the session history, but it does allow it to navigate the session history.

So the contents of the history are opaque are on purpose.

In the browser environment location.back() is wrapper around the window.history object (for a partial path through the source, see here, here, here and here).

The contents of within the History object are purposefully not accessible.

From the HTML History interface documention:

The actual entries are not accessible from script.

From MDN the window.history object documentation:

For security reasons the History object doesn't allow the non-privileged code to access the URLs of other pages in the session history, but it does allow it to navigate the session history.

 

As to an alternate approach, this answer provides a technique for listening for the last 2 NavigationEnd events.

Source Link
chuckx
  • 7k
  • 1
  • 26
  • 24

I'm assuming location.back is wrapper around the window.history object. From that documentation:

For security reasons the History object doesn't allow the non-privileged code to access the URLs of other pages in the session history, but it does allow it to navigate the session history.

So the contents of the history are opaque are on purpose.