#include <string>
#include <vector>
-#include <set>
#include "atom/browser/api/event_emitter.h"
#include "brightray/browser/default_web_contents_delegate.h"
domEvent = new Event('will-navigate')
domEvent['url'] = @getValue()
domEvent.cancelable = true
- self = @
- domEvent.preventDefault = () ->
- self.setValueIgnoreMutation ''
+ domEvent.preventDefault = () =>
+ @setValueIgnoreMutation ''
@webViewImpl.webviewNode.dispatchEvent domEvent
unless @webViewImpl.guestInstanceId?
methods = [
"getUrl"
"getTitle"
- "getFavicon"
"isLoading"
"isWaitingForResponse"
"stop"
remote.getGuestWebContents(internal.guestInstanceId)[m] args...
proto[m] = createHandler m for m in methods
+ # Return dataUrl instead of nativeImage.
+ proto.getFavicon = (args...) ->
+ internal = v8Util.getHiddenValue this, 'internal'
+ return unless internal
+ favicon = remote.getGuestWebContents(internal.guestInstanceId)['getFavicon'] args...
+ favicon.toDataUrl()
+
window.WebView = webFrame.registerEmbedderCustomElement 'webview',
prototype: proto
### Event: 'page-favicon-updated'
* `event` Event
-* `favicons` [String]
+* `favicons` Array - Array of Urls
Emitted when page receives favicon urls.
### WebContents.getFavicon()
-Returns the favicon of web page as `nativeImage`.
+Returns the favicon of web page as [NativeImage](native-image.md).
### WebContents.isLoading()
### `<webview>`.getFavicon()
-Returns the favicon of guest page as `nativeImage`.
+Returns the favicon of guest page as dataUrl.
### `<webview>`.isLoading()
### page-favicon-updated
-* `favicons` [String]
+* `favicons` Array - Array of Urls
Fired when page receives favicon urls.