feat: duplicate navigation related APIs to contents.navigationHistory (#41752)

* refactor: move navigation related api to navigationHistory

* docs: add deprecation messages to old web content methods

* fix: add deprecation warnings to webcontents

* fix: add deprecation warnings and make existing naviagation apis internal

* Update docs/api/web-contents.md

Co-authored-by: Sam Maddock <samuel.maddock@gmail.com>

* Update docs/api/web-contents.md

Co-authored-by: Sam Maddock <samuel.maddock@gmail.com>

* Update docs/api/web-contents.md

Co-authored-by: Sam Maddock <samuel.maddock@gmail.com>

* Update docs/api/web-contents.md

Co-authored-by: Sam Maddock <samuel.maddock@gmail.com>

* docs: fix links

* docs: add breaking change to 31

* docs: move breaking change to 32

* chore: re-run pipeline

---------

Co-authored-by: Sam Maddock <samuel.maddock@gmail.com>
This commit is contained in:
Alice Zhao 2024-06-05 09:34:47 -07:00 committed by GitHub
parent 5fb117a7d7
commit 406f644d26
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 239 additions and 17 deletions

View file

@ -1124,44 +1124,60 @@ Reloads the current web page.
Reloads current page and ignores cache.
#### `contents.canGoBack()`
#### `contents.canGoBack()` _Deprecated_
Returns `boolean` - Whether the browser can go back to previous web page.
#### `contents.canGoForward()`
**Deprecated:** Should use the new [`contents.navigationHistory.canGoBack`](navigation-history.md#navigationhistorycangoback) API.
#### `contents.canGoForward()` _Deprecated_
Returns `boolean` - Whether the browser can go forward to next web page.
#### `contents.canGoToOffset(offset)`
**Deprecated:** Should use the new [`contents.navigationHistory.canGoForward`](navigation-history.md#navigationhistorycangoforward) API.
#### `contents.canGoToOffset(offset)` _Deprecated_
* `offset` Integer
Returns `boolean` - Whether the web page can go to `offset`.
#### `contents.clearHistory()`
**Deprecated:** Should use the new [`contents.navigationHistory.canGoToOffset`](navigation-history.md#navigationhistorycangotooffsetoffset) API.
#### `contents.clearHistory()` _Deprecated_
Clears the navigation history.
#### `contents.goBack()`
**Deprecated:** Should use the new [`contents.navigationHistory.clear`](navigation-history.md#navigationhistoryclear) API.
#### `contents.goBack()` _Deprecated_
Makes the browser go back a web page.
#### `contents.goForward()`
**Deprecated:** Should use the new [`contents.navigationHistory.goBack`](navigation-history.md#navigationhistorygoback) API.
#### `contents.goForward()` _Deprecated_
Makes the browser go forward a web page.
#### `contents.goToIndex(index)`
**Deprecated:** Should use the new [`contents.navigationHistory.goForward`](navigation-history.md#navigationhistorygoforward) API.
#### `contents.goToIndex(index)` _Deprecated_
* `index` Integer
Navigates browser to the specified absolute web page index.
#### `contents.goToOffset(offset)`
**Deprecated:** Should use the new [`contents.navigationHistory.goToIndex`](navigation-history.md#navigationhistorygotoindexindex) API.
#### `contents.goToOffset(offset)` _Deprecated_
* `offset` Integer
Navigates to the specified offset from the "current entry".
**Deprecated:** Should use the new [`contents.navigationHistory.goToOffset`](navigation-history.md#navigationhistorygotooffsetoffset) API.
#### `contents.isCrashed()`
Returns `boolean` - Whether the renderer process has crashed.