diff --git a/lib/browser/api/web-contents.ts b/lib/browser/api/web-contents.ts index cc5f376e9369a..2e37f439175d1 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 b213b031a62d0..0f2cc17c28155 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;