From b8e6260a199f35e6aefa933aa5ce5b446b95944c Mon Sep 17 00:00:00 2001 From: rhysd Date: Sat, 5 Sep 2015 23:07:35 +0900 Subject: [PATCH] Add missing optional parameter of WebContents.loadUrl() --- github-electron/github-electron-main-tests.ts | 2 ++ github-electron/github-electron.d.ts | 10 ++++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/github-electron/github-electron-main-tests.ts b/github-electron/github-electron-main-tests.ts index a849295b6..995c79daa 100644 --- a/github-electron/github-electron-main-tests.ts +++ b/github-electron/github-electron-main-tests.ts @@ -43,6 +43,8 @@ app.on('ready', () => { // and load the index.html of the app. mainWindow.loadUrl(`file://${__dirname}/index.html`); + mainWindow.loadUrl('file://foo/bar', {userAgent: 'cool-agent', httpReferrer: 'greateRefferer'}); + mainWindow.webContents.loadUrl('file://foo/bar', {userAgent: 'cool-agent', httpReferrer: 'greateRefferer'}); mainWindow.openDevTools() var opened: boolean = mainWindow.isDevToolsOpened() diff --git a/github-electron/github-electron.d.ts b/github-electron/github-electron.d.ts index fb0980520..ca95dd85e 100644 --- a/github-electron/github-electron.d.ts +++ b/github-electron/github-electron.d.ts @@ -400,7 +400,10 @@ declare module GitHubElectron { /** * Same with webContents.loadUrl(url). */ - loadUrl(url: string): void; + loadUrl(url: string, options?: { + httpReferrer?: string; + userAgent?: string; + }): void; /** * Same with webContents.reload. */ @@ -537,7 +540,10 @@ declare module GitHubElectron { * Loads the url in the window. * @param url Must contain the protocol prefix (e.g., the http:// or file://). */ - loadUrl(url: string): void; + loadUrl(url: string, options?: { + httpReferrer?: string; + userAgent?: string; + }): void; /** * @returns The URL of current web page. */