“Chrome Apps” webview.executeScript access guest global varibles
问题 I can access a Chrome App Webview HTML with: webview.executeScript( {code: 'document.documentElement.innerHTML'}, function(results) { // results[0] would have the webview's innerHTML. }); But I would like to get the value of global variables in the Guest like so: webview.executeScript( {code: 'window.globalVar'}, function(results) { // results[0] should have the webview's value of "globalVar". }); How can I do this? 回答1: An answer to summarize the steps required. 1) You inject a content