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

Commit

Permalink
implement executeJavaScript on new webview
Browse files Browse the repository at this point in the history
  • Loading branch information
bridiver committed Nov 30, 2016
1 parent 05b368f commit 271383a
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions atom/common/api/resources/web_view_api_bindings.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ const WebViewInternal = require('webViewInternal').WebViewInternal;
const TabViewInternal = require('tabViewInternal').TabViewInternal;
const WebViewImpl = require('webView').WebViewImpl;
const remote = require('remote')
const webFrameNatives = requireNative('webFrame')
const GuestViewInternal = require('guest-view-internal').GuestViewInternal

const asyncMethods = [
Expand Down Expand Up @@ -91,6 +92,8 @@ var WEB_VIEW_API_METHODS = [

// Changes the zoom factor of the page.
'setZoom',

'executeJavaScript',
].concat(asyncMethods).concat(syncMethods)

asyncMethods.forEach((method) => {
Expand Down Expand Up @@ -139,6 +142,10 @@ WebViewImpl.prototype.getTabID = function (instanceId, cb) {
}
}

WebViewImpl.prototype.executeJavaScript = function (code) {
return webFrameNatives.executeJavaScript(code)
}

const attachWindow = WebViewImpl.prototype.attachWindow$
WebViewImpl.prototype.attachWindow$ = function(opt_guestInstanceId) {
let attached = attachWindow.bind(this)(opt_guestInstanceId)
Expand Down

0 comments on commit 271383a

Please sign in to comment.