NW.jsとwebviewを使用して外部のウェブサイトを制御したいが、いつでもこれを試してみるとエラーがある - 角度は定義されていない。 NW.js - webview - 角度が定義されていないエラー
マイソース:index.htmlを
html...head...body...
<webview id="webview" name="webview" src="https://google.com/" allownw></webview>
<script src="../js/script.js"></script>
...body...html
script.js
(function() {
var gui = require('nw.gui');
var win = gui.Window.get();
var webview = document.getElementById("webview");
var tray = new gui.Tray({
icon : 'assets/icon.png'
});
var menu = new gui.Menu();
menu.append(new gui.MenuItem({
type: 'normal',
label: '▶️ Play',
click: function() {
webview.executeScript({code:"var player=angular.element(document.body).injector().get('player'); player.play();"});
}
}));
tray.menu = menu;
}());
私のためにこのコードプロデュースエラー:にReferenceError:角度を
注定義されていません。ウェブサイトgoogle.comはほんの一例です。 nw.js
docsから