executeJavascript is not a function


I am trying to call executeJavascript method when the webview is ready. I tried the following code below:

function init() {
      webview = document.querySelector('webview');
      webview.addEventListener('dom-ready', () => {

In the console, I’ll get an error message of webview.executeJavascript is not a function. I’ve tried insertCSS method and that works fine but executeJavascript method doesn’t exist even though it’s in the documentation. Any ideas?

I am using Electron 1.7.9 running on MacOS.


according to https://electronjs.org/docs/api/webview-tag#webviewexecutejavascriptcode-usergesture-callback

it is executeJavaScript


Thanks! somehow I had overlooked that.