WebBackForwardList object maintains a list of visited pages used to go back and forward to the most recent page. A
WebBackForwardList object maintains only the list data—it does not perform actual page loads (in other words, it does not make any client requests). If you need to perform a page load, see the
load(_:) method in
WebFrame to find out how to do this.
- macOS 10.10+
Items are typically inserted in a back-forward list in the order they are visited. A
WebBackForwardList object also maintains the notion of the current item (which is always at index
0), the preceding item (which is at index
-1), and the following item (which is at index
goForward() methods move the current item backward or forward by one. The
go(to:) method sets the current item to the specified item. All other methods that return
WebHistoryItem objects do not change the value of the current item, they just return the requested item or items. You can also limit the number of history items stored in the back-forward list using
WebBackForwardList objects also control the number of pages cached. You can turn page caching off by setting the page cache size to
0 using the
pageCacheSize() method, or limit the number of pages cached by passing a value greater than 0.