是否可以为单个 window 更改 user-agent?
is it possible change user-agent for a single window?
我像这样打开第二个 window...它可能会更改 user-agent 或此 window 的其他值??
var new_win = gui.Window.open('http://google.com', {
position: 'center',
width: 300,
height: 300
//,show: false
});
我需要随机更改此参数 (headers) 以便我的应用程序正常工作。
我正在使用:
node-webkit v0.11.4
node.js v0.11.13-pre
Chromium 38.0.2125.104
commit hash: fa7a807-d8ecacd-e98a5c7-f2f89e2-d9a9d39-cdd879e
我在 Window.open
中找不到任何更改用户代理的解决方案。
但您可以使用 iframe#nwUserAgent 来更改它。
例如:
index.html
var new_win = gui.Window.open('iframe.html', {
position: 'center',
width: 300,
height: 300
//,show: false
});
iframe.html
<iframe src="http://google.com" nwUserAgent="test" style="width:100%;height:100%"></iframe>
我像这样打开第二个 window...它可能会更改 user-agent 或此 window 的其他值??
var new_win = gui.Window.open('http://google.com', {
position: 'center',
width: 300,
height: 300
//,show: false
});
我需要随机更改此参数 (headers) 以便我的应用程序正常工作。
我正在使用:
node-webkit v0.11.4
node.js v0.11.13-pre
Chromium 38.0.2125.104
commit hash: fa7a807-d8ecacd-e98a5c7-f2f89e2-d9a9d39-cdd879e
我在 Window.open
中找不到任何更改用户代理的解决方案。
但您可以使用 iframe#nwUserAgent 来更改它。
例如:
index.html
var new_win = gui.Window.open('iframe.html', {
position: 'center',
width: 300,
height: 300
//,show: false
});
iframe.html
<iframe src="http://google.com" nwUserAgent="test" style="width:100%;height:100%"></iframe>