mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-09-09 11:13:57 +08:00
Merge pull request #5699 from rhysd/github-electron/fix-loadUrl
Added missing optional parameter of WebContents.loadUrl()
This commit is contained in:
@@ -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()
|
||||
|
||||
Vendored
+8
-2
@@ -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.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user