function createWebView(props) {
  var webview = document.createElement('webview');
  webview.id = props.id;
  webview.partition = props.partition;
  webview.addEventListener('permissionrequest', function(e) {
    console.log("Permission request for " + e.permission);
    if (e.permission === 'download') {
      e.request.allow();
    };
  });
  webview.addEventListener('consolemessage', function(e) {
    console.log(props.id + " : " + e.message);
  });
  document.getElementById('container').appendChild(webview);

  return new Promise(function(accept, reject) {
    webview.addEventListener('loadstop', function() {
      console.log('loadstop received with src=' + webview.src);
      accept(true);
    });
    webview.src = props.url.href;
  });
}
// the 'loadstop' event is observed for the WebView.
the 'loadstop' event is observed for the WebView.
the ' loadstop ' event is observed for the WebView .
function createWebView(props) {
  var webview = document.createElement('webview');
  webview.id = props.id;
  webview.partition = props.partition;
  webview.addEventListener('permissionrequest', function(e) {
    console.log("Permission request for " + e.permission);
    if (e.permission === 'download') {
      e.request.allow();
    };
  });
  webview.addEventListener('consolemessage', function(e) {
    console.log(props.id + " : " + e.message);
  });
  document.getElementById('container').appendChild(webview);
  return new Promise(function(accept, reject) {
    webview.addEventListener('loadstop', function() {
      console.log('loadstop received with src=' + webview.src);
      accept(true);
    });
    webview.src = props.url.href;
  });
}
function createWebView ( props ) { var webview = document . createElement ( 'webview' ) ; webview . id = props . id ; webview . partition = props . partition ; webview . addEventListener ( 'permissionrequest' , function ( e ) { console . log ( "Permission request for " + e . permission ) ; if ( e . permission === 'download' ) { e . request . allow ( ) ; } ; } ) ; webview . addEventListener ( 'consolemessage' , function ( e ) { console . log ( props . id + " : " + e . message ) ; } ) ; document . getElementById ( 'container' ) . appendChild ( webview ) ; return new Promise ( function ( accept , reject ) { webview . addEventListener ( 'loadstop' , function ( ) { console . log ( 'loadstop received with src=' + webview . src ) ; accept ( true ) ; } ) ; webview . src = props . url . href ; } ) ; }
the 'loadstop' event is observed for the WebView.
the ' loadstop ' event is observed for the WebView .