<!--
{
  "availability" : [
    "macOS: 10.4.0 - 10.14.0"
  ],
  "documentType" : "symbol",
  "framework" : "WebKit",
  "identifier" : "/documentation/WebKit/WebBackForwardList/add(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "WebKit"
    ],
    "preciseIdentifier" : "c:objc(cs)WebBackForwardList(im)addItem:"
  },
  "title" : "add(_:)"
}
-->

# add(_:)

Inserts an item into the back-forward list, immediately after the current item.

```
func add(_ item: WebHistoryItem!)
```

## Parameters

`item`

A web history item that represents a visited webpage. If `item` is `nil`, an <doc://com.apple.documentation/documentation/Foundation/NSExceptionName/invalidArgumentException> exception is raised.

## Discussion

Any items following `item` in the back-forward list are removed. This method also removes items if the capacity of the receiver is exceeded.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)