Web object maintains a list of visited pages used to go back and forward to the most recent page. A
Web 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
Web to find out how to do this.
- macOS 10.4–10.14Deprecated
Items are typically inserted in a back-forward list in the order they are visited. A
Web 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
go 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
Web 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
Web objects also control the number of pages cached. You can turn page caching off by setting the page cache size to
0 using the
page method, or limit the number of pages cached by passing a value greater than 0.