Use old PLUGIN_METHOD_ATTACH for webview
This commit is contained in:
parent
a22a5c67bd
commit
81599f1535
1 changed files with 15 additions and 5 deletions
|
@ -6,6 +6,10 @@ webView = require 'web-view'
|
||||||
nextId = 1
|
nextId = 1
|
||||||
getNextId = -> nextId++
|
getNextId = -> nextId++
|
||||||
|
|
||||||
|
# FIXME
|
||||||
|
# Discarded after Chrome 39
|
||||||
|
PLUGIN_METHOD_ATTACH = '-internal-attach'
|
||||||
|
|
||||||
# Attributes.
|
# Attributes.
|
||||||
WEB_VIEW_ATTRIBUTE_ALLOWTRANSPARENCY = 'allowtransparency'
|
WEB_VIEW_ATTRIBUTE_ALLOWTRANSPARENCY = 'allowtransparency'
|
||||||
WEB_VIEW_ATTRIBUTE_AUTOSIZE = 'autosize'
|
WEB_VIEW_ATTRIBUTE_AUTOSIZE = 'autosize'
|
||||||
|
@ -283,11 +287,13 @@ class WebView
|
||||||
@partition.fromAttribute newValue, @hasNavigated()
|
@partition.fromAttribute newValue, @hasNavigated()
|
||||||
|
|
||||||
handleBrowserPluginAttributeMutation: (name, oldValue, newValue) ->
|
handleBrowserPluginAttributeMutation: (name, oldValue, newValue) ->
|
||||||
if name is 'internalinstanceid' and !oldValue and !!newValue
|
# FIXME
|
||||||
@browserPluginNode.removeAttribute 'internalinstanceid'
|
# internalbindings => internalInstanceid after Chrome 39
|
||||||
@internalInstanceId = parseInt newValue
|
if name is 'internalbindings' and !oldValue and !!newValue
|
||||||
|
@browserPluginNode.removeAttribute 'internalbindings'
|
||||||
|
# FIXME
|
||||||
|
# @internalInstanceId = parseInt newValue
|
||||||
|
|
||||||
console.log 'internalinstanceid', @internalInstanceId
|
|
||||||
if !!@guestInstanceId and @guestInstanceId != 0
|
if !!@guestInstanceId and @guestInstanceId != 0
|
||||||
isNewWindow = if @deferredAttachState then @deferredAttachState.isNewWindow else false
|
isNewWindow = if @deferredAttachState then @deferredAttachState.isNewWindow else false
|
||||||
params = @buildAttachParams isNewWindow
|
params = @buildAttachParams isNewWindow
|
||||||
|
@ -297,6 +303,7 @@ class WebView
|
||||||
# @guestInstanceId,
|
# @guestInstanceId,
|
||||||
# params,
|
# params,
|
||||||
# (w) => @contentWindow = w
|
# (w) => @contentWindow = w
|
||||||
|
@browserPluginNode[PLUGIN_METHOD_ATTACH] @guestInstanceId, params
|
||||||
|
|
||||||
onSizeChanged: (webViewEvent) ->
|
onSizeChanged: (webViewEvent) ->
|
||||||
newWidth = webViewEvent.newWidth
|
newWidth = webViewEvent.newWidth
|
||||||
|
@ -348,7 +355,9 @@ class WebView
|
||||||
|
|
||||||
# Returns if <object> is in the render tree.
|
# Returns if <object> is in the render tree.
|
||||||
isPluginInRenderTree: ->
|
isPluginInRenderTree: ->
|
||||||
!!@internalInstanceId && @internalInstanceId != 0
|
# FIXME
|
||||||
|
# !!@internalInstanceId && @internalInstanceId != 0
|
||||||
|
'function' == typeof this.browserPluginNode[PLUGIN_METHOD_ATTACH]
|
||||||
|
|
||||||
hasNavigated: ->
|
hasNavigated: ->
|
||||||
not @beforeFirstNavigation
|
not @beforeFirstNavigation
|
||||||
|
@ -458,6 +467,7 @@ class WebView
|
||||||
@deferredAttachState = null
|
@deferredAttachState = null
|
||||||
# FIXME
|
# FIXME
|
||||||
# guestViewInternalNatives.AttachGuest @internalInstanceId, @guestInstanceId, params, (w) => @contentWindow = w
|
# guestViewInternalNatives.AttachGuest @internalInstanceId, @guestInstanceId, params, (w) => @contentWindow = w
|
||||||
|
@browserPluginNode[PLUGIN_METHOD_ATTACH] @guestInstanceId, params
|
||||||
|
|
||||||
# Registers browser plugin <object> custom element.
|
# Registers browser plugin <object> custom element.
|
||||||
registerBrowserPluginElement = ->
|
registerBrowserPluginElement = ->
|
||||||
|
|
Loading…
Reference in a new issue