|
@@ -82,7 +82,7 @@ var WebViewImpl = (function () {
|
|
|
|
|
|
// Sets the <webview>.request property.
|
|
|
WebViewImpl.prototype.setRequestPropertyOnWebViewNode = function (request) {
|
|
|
- return Object.defineProperty(this.webviewNode, 'request', {
|
|
|
+ Object.defineProperty(this.webviewNode, 'request', {
|
|
|
value: request,
|
|
|
enumerable: true
|
|
|
})
|
|
@@ -119,7 +119,7 @@ var WebViewImpl = (function () {
|
|
|
}
|
|
|
|
|
|
// Let the changed attribute handle its own mutation
|
|
|
- return this.attributes[attributeName].handleMutation(oldValue, newValue)
|
|
|
+ this.attributes[attributeName].handleMutation(oldValue, newValue)
|
|
|
}
|
|
|
|
|
|
WebViewImpl.prototype.handleBrowserPluginAttributeMutation = function (attributeName, oldValue, newValue) {
|
|
@@ -129,10 +129,9 @@ var WebViewImpl = (function () {
|
|
|
|
|
|
// Track when the element resizes using the element resize callback.
|
|
|
webFrame.registerElementResizeCallback(this.internalInstanceId, this.onElementResize.bind(this))
|
|
|
- if (!this.guestInstanceId) {
|
|
|
- return
|
|
|
+ if (this.guestInstanceId) {
|
|
|
+ guestViewInternal.attachGuest(this.internalInstanceId, this.guestInstanceId, this.buildParams())
|
|
|
}
|
|
|
- return guestViewInternal.attachGuest(this.internalInstanceId, this.guestInstanceId, this.buildParams())
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -157,7 +156,7 @@ var WebViewImpl = (function () {
|
|
|
|
|
|
// Only fire the DOM event if the size of the <webview> has actually
|
|
|
// changed.
|
|
|
- return this.dispatchEvent(webViewEvent)
|
|
|
+ this.dispatchEvent(webViewEvent)
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -177,7 +176,7 @@ var WebViewImpl = (function () {
|
|
|
resizeEvent.newHeight = newSize.height
|
|
|
this.dispatchEvent(resizeEvent)
|
|
|
if (this.guestInstanceId) {
|
|
|
- return guestViewInternal.setSize(this.guestInstanceId, {
|
|
|
+ guestViewInternal.setSize(this.guestInstanceId, {
|
|
|
normal: newSize
|
|
|
})
|
|
|
}
|
|
@@ -190,7 +189,7 @@ var WebViewImpl = (function () {
|
|
|
}
|
|
|
|
|
|
WebViewImpl.prototype.dispatchEvent = function (webViewEvent) {
|
|
|
- return this.webviewNode.dispatchEvent(webViewEvent)
|
|
|
+ this.webviewNode.dispatchEvent(webViewEvent)
|
|
|
}
|
|
|
|
|
|
// Adds an 'on<event>' property on the webview, which can be used to set/unset
|
|
@@ -284,10 +283,9 @@ var registerBrowserPluginElement = function () {
|
|
|
proto.attributeChangedCallback = function (name, oldValue, newValue) {
|
|
|
var internal
|
|
|
internal = v8Util.getHiddenValue(this, 'internal')
|
|
|
- if (!internal) {
|
|
|
- return
|
|
|
+ if (internal) {
|
|
|
+ internal.handleBrowserPluginAttributeMutation(name, oldValue, newValue)
|
|
|
}
|
|
|
- return internal.handleBrowserPluginAttributeMutation(name, oldValue, newValue)
|
|
|
}
|
|
|
proto.attachedCallback = function () {
|
|
|
// Load the plugin immediately.
|
|
@@ -313,10 +311,9 @@ var registerWebViewElement = function () {
|
|
|
proto.attributeChangedCallback = function (name, oldValue, newValue) {
|
|
|
var internal
|
|
|
internal = v8Util.getHiddenValue(this, 'internal')
|
|
|
- if (!internal) {
|
|
|
- return
|
|
|
+ if (internal) {
|
|
|
+ internal.handleWebviewAttributeMutation(name, oldValue, newValue)
|
|
|
}
|
|
|
- return internal.handleWebviewAttributeMutation(name, oldValue, newValue)
|
|
|
}
|
|
|
proto.detachedCallback = function () {
|
|
|
var internal
|
|
@@ -340,9 +337,10 @@ var registerWebViewElement = function () {
|
|
|
internal.elementAttached = true
|
|
|
instance = internal.attributes[webViewConstants.ATTRIBUTE_GUESTINSTANCE].getValue()
|
|
|
if (instance) {
|
|
|
- return internal.attachGuestInstance(instance)
|
|
|
+ internal.attachGuestInstance(instance)
|
|
|
+ } else {
|
|
|
+ internal.attributes[webViewConstants.ATTRIBUTE_SRC].parse()
|
|
|
}
|
|
|
- return internal.attributes[webViewConstants.ATTRIBUTE_SRC].parse()
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -424,7 +422,7 @@ var registerWebViewElement = function () {
|
|
|
createNonBlockHandler = function (m) {
|
|
|
return function (...args) {
|
|
|
const internal = v8Util.getHiddenValue(this, 'internal')
|
|
|
- return ipcRenderer.send.apply(ipcRenderer, ['ELECTRON_BROWSER_ASYNC_CALL_TO_GUEST_VIEW', null, internal.guestInstanceId, m].concat(args))
|
|
|
+ ipcRenderer.send.apply(ipcRenderer, ['ELECTRON_BROWSER_ASYNC_CALL_TO_GUEST_VIEW', null, internal.guestInstanceId, m].concat(args))
|
|
|
}
|
|
|
}
|
|
|
for (j = 0, len1 = nonblockMethods.length; j < len1; j++) {
|
|
@@ -460,7 +458,7 @@ var registerWebViewElement = function () {
|
|
|
delete proto.createdCallback
|
|
|
delete proto.attachedCallback
|
|
|
delete proto.detachedCallback
|
|
|
- return delete proto.attributeChangedCallback
|
|
|
+ delete proto.attributeChangedCallback
|
|
|
}
|
|
|
|
|
|
var useCapture = true
|
|
@@ -471,7 +469,7 @@ var listener = function (event) {
|
|
|
}
|
|
|
registerBrowserPluginElement()
|
|
|
registerWebViewElement()
|
|
|
- return window.removeEventListener(event.type, listener, useCapture)
|
|
|
+ window.removeEventListener(event.type, listener, useCapture)
|
|
|
}
|
|
|
|
|
|
window.addEventListener('readystatechange', listener, true)
|