Skip to content
This repository has been archived by the owner on Jan 4, 2019. It is now read-only.

Commit

Permalink
Expose NavigationController::IsInitialBlankNavigation
Browse files Browse the repository at this point in the history
  • Loading branch information
ayumi authored and bridiver committed Sep 16, 2016
1 parent a0d64cd commit 0e574b0
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 0 deletions.
5 changes: 5 additions & 0 deletions atom/browser/api/atom_api_web_contents.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1088,6 +1088,10 @@ base::string16 WebContents::GetTitle() const {
return web_contents()->GetTitle();
}

bool WebContents::IsInitialBlankNavigation() const {
return web_contents()->GetController().IsInitialBlankNavigation();
}

bool WebContents::IsLoading() const {
return web_contents()->IsLoading();
}
Expand Down Expand Up @@ -1876,6 +1880,7 @@ void WebContents::BuildPrototype(v8::Isolate* isolate,
.SetMethod("downloadURL", &WebContents::DownloadURL)
.SetMethod("getURL", &WebContents::GetURL)
.SetMethod("getTitle", &WebContents::GetTitle)
.SetMethod("isInitialBlankNavigation", &WebContents::IsInitialBlankNavigation)
.SetMethod("isLoading", &WebContents::IsLoading)
.SetMethod("isLoadingMainFrame", &WebContents::IsLoadingMainFrame)
.SetMethod("isWaitingForResponse", &WebContents::IsWaitingForResponse)
Expand Down
1 change: 1 addition & 0 deletions atom/browser/api/atom_api_web_contents.h
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ class WebContents : public mate::TrackableObject<WebContents>,
void DownloadURL(const GURL& url);
GURL GetURL() const;
base::string16 GetTitle() const;
bool IsInitialBlankNavigation() const;
bool IsLoading() const;
bool IsLoadingMainFrame() const;
bool IsWaitingForResponse() const;
Expand Down
4 changes: 4 additions & 0 deletions docs/api/web-contents.md
Original file line number Diff line number Diff line change
Expand Up @@ -542,6 +542,10 @@ Returns a Boolean, whether the web page is destroyed.

Returns a Boolean, whether the web page is focused.

#### `contents.isInitialBlankNavigation()`

Returns a boolean, whether the web page has not yet committed a navigation.

#### `contents.isLoading()`

Returns whether web page is still loading resources.
Expand Down
4 changes: 4 additions & 0 deletions docs/api/web-view-tag.md
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,10 @@ Returns URL of guest page.

Returns the title of guest page.

### `<webview>.isInitialBlankNavigation()`

Returns a boolean, whether guest page has not yet committed a navigation.

### `<webview>.isLoading()`

Returns a boolean whether guest page is still loading resources.
Expand Down
1 change: 1 addition & 0 deletions lib/renderer/web-view/web-view.js
Original file line number Diff line number Diff line change
Expand Up @@ -392,6 +392,7 @@ var registerWebViewElement = function () {
'getURL',
'loadURL',
'getTitle',
'isInitialBlankNavigation',
'isLoading',
'isLoadingMainFrame',
'isWaitingForResponse',
Expand Down

0 comments on commit 0e574b0

Please sign in to comment.