【问题标题】:Finding out my User Agent on Node Webkit在 Node Webkit 上找到我的用户代理
【发布时间】:2016-06-07 09:49:44
【问题描述】:

在 Node-Webkit 中使用浏览器上下文时,有没有办法从 Node-Webkit 中找出用于外部请求的确切用户代理?

示例:如果 Node-Webkit 从某个远程加载一个 HTML 格式的图像,我想知道这个远程会看到什么用户代理。

使用嗅探器(Fiddler/Wireshark)很简单,但我正在寻找一种方法来直接获取这些信息。

谢谢。

【问题讨论】:

    标签: javascript node.js user-agent node-webkit


    【解决方案1】:

    好吧,既然你绝对可以这样做:

    iframeID.setAttribute('nwUserAgent', 'Super Browser');
    

    那我不明白为什么你也不能这样做:

    Agent = iframeID.getAttribute('nwUserAgent');
    

    【讨论】:

    • 感谢您的回答。您能否详细说明如何获取浏览器窗口的 iframeID? document.createElement('iframe').getAttribute('nwUserAgent'); 返回null
    猜你喜欢
    • 1970-01-01
    • 2016-02-09
    • 2016-07-26
    • 2013-07-06
    • 1970-01-01
    • 2017-11-13
    • 2011-04-02
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多