From 237e4865895dca698e25c097c9f7122f56007f8b Mon Sep 17 00:00:00 2001 From: "trop[bot]" <37223003+trop[bot]@users.noreply.github.com> Date: Thu, 12 Dec 2024 16:25:14 -0500 Subject: [PATCH] fix: add missing index arg in `navigationHistory.canGoToOffset` (#45006) 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 4ae74f8f9309..4cd68d7c55b4 100644 --- a/lib/browser/api/web-contents.ts +++ b/lib/browser/api/web-contents.ts @@ -514,9 +514,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 b213b031a62d..0f2cc17c2815 100644 --- a/typings/internal-electron.d.ts +++ b/typings/internal-electron.d.ts @@ -93,7 +93,7 @@ declare namespace Electron { _historyLength(): number; _canGoBack(): boolean; _canGoForward(): boolean; - _canGoToOffset(): boolean; + _canGoToOffset(index: number): boolean; _goBack(): void; _goForward(): void; _goToOffset(index: number): void;