From 5c6d6c1d5ea85a463a68f844af5ee79df3d1cefb Mon Sep 17 00:00:00 2001 From: "trop[bot]" <37223003+trop[bot]@users.noreply.github.com> Date: Thu, 12 Dec 2024 16:21:52 -0500 Subject: [PATCH] fix: add missing index arg in `navigationHistory.canGoToOffset` (#45007) fix: add missing arg Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com> Co-authored-by: alice --- lib/browser/api/web-contents.ts | 4 ++-- typings/internal-electron.d.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/browser/api/web-contents.ts b/lib/browser/api/web-contents.ts index 5b88a463540a..9f82f65006c2 100644 --- a/lib/browser/api/web-contents.ts +++ b/lib/browser/api/web-contents.ts @@ -523,9 +523,9 @@ WebContents.prototype.canGoForward = function () { }; const canGoToOffsetDeprecated = deprecate.warnOnce('webContents.canGoToOffset', 'webContents.navigationHistory.canGoToOffset'); -WebContents.prototype.canGoToOffset = function () { +WebContents.prototype.canGoToOffset = function (index: number) { canGoToOffsetDeprecated(); - return this._canGoToOffset(); + return this._canGoToOffset(index); }; const clearHistoryDeprecated = deprecate.warnOnce('webContents.clearHistory', 'webContents.navigationHistory.clear'); diff --git a/typings/internal-electron.d.ts b/typings/internal-electron.d.ts index 96cfdbdbc258..95e3abb891db 100644 --- a/typings/internal-electron.d.ts +++ b/typings/internal-electron.d.ts @@ -91,7 +91,7 @@ declare namespace Electron { _historyLength(): number; _canGoBack(): boolean; _canGoForward(): boolean; - _canGoToOffset(): boolean; + _canGoToOffset(index: number): boolean; _goBack(): void; _goForward(): void; _goToOffset(index: number): void;