hi all in my project i have three js files, main.js,browser.js and inject.js, in browser.js 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 inject.js to get contents and elements from the page i got the value in Inject.js files but in Browser.js files i getting undefined values
here my sample code:
browser.js
var proName = webview.executeJavaScript('__myInjection.profileName()');
inject.js
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;
},
values getting called in inject.js but browser.js returns Undefined values