title: how to get return value from webview.executeJavaScript in electron
body: <p>hi all in my project i have three js files, <strong>main.js</strong>,<strong>browser.js</strong> and <strong>inject.js</strong>, in <strong>browser.js</strong> i have implemented all the click action related to my webview and many functionalities, from this i have a click action to get Username from the webpage which is loaded in webview for that i created a function in <strong>inject.js</strong> to get contents and elements from the page i got the value in <strong>Inject.js</strong> files but in <strong>Browser.js</strong> files i getting undefined values</p>
  
  <p><strong>here my sample code:</strong></p>
  
  <blockquote>
    <p>browser.js</p>
  </blockquote>
  
  <pre><code>var proName = webview.executeJavaScript('__myInjection.profileName()');
  </code></pre>
  
  <blockquote>
    <p>inject.js</p>
  </blockquote>
  
  <pre><code>profileName : function (){
  var recordArray = []
  var url
  var script = document.createElement("script");
  script.src = require('./jquery-3.2.1.min.js');
  
    $(document).ready(function() {
   url = $("[data-control-name='identity_profile_photo']").attr("href");
  alert(url)
    });
  
  return url;
  
  
  },
  </code></pre>
  
  <p>values getting called in inject.js but browser.js returns <strong>Undefined</strong> values</p>