Add update-target-url event
This commit is contained in:
parent
1c504ec45d
commit
3c873736d7
6 changed files with 30 additions and 5 deletions
|
@ -389,6 +389,11 @@ void WebContents::ActivateContents(content::WebContents* source) {
|
|||
Emit("activate");
|
||||
}
|
||||
|
||||
void WebContents::UpdateTargetURL(content::WebContents* source,
|
||||
const GURL& url) {
|
||||
Emit("update-target-url", url);
|
||||
}
|
||||
|
||||
bool WebContents::IsPopupOrPanel(const content::WebContents* source) const {
|
||||
return type_ == BROWSER_WINDOW;
|
||||
}
|
||||
|
|
|
@ -182,6 +182,7 @@ class WebContents : public mate::TrackableObject<WebContents>,
|
|||
const gfx::Rect& pos) override;
|
||||
void CloseContents(content::WebContents* source) override;
|
||||
void ActivateContents(content::WebContents* contents) override;
|
||||
void UpdateTargetURL(content::WebContents* source, const GURL& url) override;
|
||||
bool IsPopupOrPanel(const content::WebContents* source) const override;
|
||||
void HandleKeyboardEvent(
|
||||
content::WebContents* source,
|
||||
|
|
|
@ -288,6 +288,15 @@ a meta tag:
|
|||
<meta name='theme-color' content='#ff0000'>
|
||||
```
|
||||
|
||||
### Event: 'update-target-url'
|
||||
|
||||
Returns:
|
||||
|
||||
* `event` Event
|
||||
* `url` String
|
||||
|
||||
Emitted when mouse moves over a link or the keyboard moves the focus to a link.
|
||||
|
||||
### Event: 'cursor-changed'
|
||||
|
||||
Returns:
|
||||
|
|
|
@ -782,6 +782,14 @@ Emitted when a page's theme color changes. This is usually due to encountering a
|
|||
<meta name='theme-color' content='#ff0000'>
|
||||
```
|
||||
|
||||
### Event: 'update-target-url'
|
||||
|
||||
Returns:
|
||||
|
||||
* `url` String
|
||||
|
||||
Emitted when mouse moves over a link or the keyboard moves the focus to a link.
|
||||
|
||||
### Event: 'devtools-opened'
|
||||
|
||||
Emitted when DevTools is opened.
|
||||
|
|
|
@ -36,7 +36,8 @@ var supportedWebViewEvents = [
|
|||
'media-started-playing',
|
||||
'media-paused',
|
||||
'found-in-page',
|
||||
'did-change-theme-color'
|
||||
'did-change-theme-color',
|
||||
'update-target-url'
|
||||
]
|
||||
|
||||
var nextInstanceId = 0
|
||||
|
|
|
@ -27,15 +27,16 @@ var WEB_VIEW_EVENTS = {
|
|||
'crashed': [],
|
||||
'gpu-crashed': [],
|
||||
'plugin-crashed': ['name', 'version'],
|
||||
'media-started-playing': [],
|
||||
'media-paused': [],
|
||||
'did-change-theme-color': ['themeColor'],
|
||||
'destroyed': [],
|
||||
'page-title-updated': ['title', 'explicitSet'],
|
||||
'page-favicon-updated': ['favicons'],
|
||||
'enter-html-full-screen': [],
|
||||
'leave-html-full-screen': [],
|
||||
'found-in-page': ['result']
|
||||
'media-started-playing': [],
|
||||
'media-paused': [],
|
||||
'found-in-page': ['result'],
|
||||
'did-change-theme-color': ['themeColor'],
|
||||
'update-target-url': ['url']
|
||||
}
|
||||
|
||||
var DEPRECATED_EVENTS = {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue