为什么Windows Phone 7.8没有连接到Weinre?

时间:2014-07-24 23:19:51

标签: javascript internet-explorer debugging windows-phone-7 weinre

我已按照说明将我的iPhone和Android手机成功连接到Weinre。但是我无法将我的Windows Phone 7.8连接到Weinre,尽管我已经知道它应该是可能的。

我用命令运行Weinre' weinre --boundHost -all- --debug -true'。 我已经包含了剧本

<script src="http://[my.ip.goes.here]:8080/target/target-script-min.js#anonymous"></script>

到我的页面头部。 我已导航到http://[my.ip.goes.here]:8080/client/#anonymous,其他所有手机都会弹出。{1}} 我试图在移动和桌面模式下运行Windows Phone Internet Explorer。 当我刷新我要检查的页面时,我的终端没有给出任何消息,甚至没有错误。 我目前正在开发移动4g网络,这会影响Weinre连接吗? 我正在使用Mac。

我在这里找不到什么东西?

编辑:

我在Windows Phone上将错误作为警报运行并得到了这个:

&#34;无法在文件[my.ip.goes.here]:8080/target/target-script-min.js#anonymous的第1569行设置属性&#39; __原始&#39;:对象为空或未定义&#34; 。< / p>

我还不知道它指的是什么。

编辑:

我找到并编辑了位于 usr / local / lib / node_modules / weinre / web / target / 文件夹中的target-script-min.js:

// Lines 1567-1571

RemoteConsole = new Console();
OriginalConsole = window.console;
RemoteConsole.__original = OriginalConsole;
OriginalConsole.__original = OriginalConsole;
require("../common/MethodNamer").setNamesForClass(module.exports);

我添加了行

alert('window.console: ' + window.console);

在Firefox上我得到警告说: window.console:[object Console] 在Windows Phone上,我得到 window.console:undefined

原因是IE9在开发人员工具打开之前并不知道window.console这样的事情,显然他们不在Windows Phone上。更多详情:http://whattheheadsaid.com/2011/04/internet-explorer-9s-problematic-console-object

如何在不打开开发人员工具的情况下将window.console对象添加到IE9?

编辑:

要获取IE9 window.console对象,我按照此处的说明进行操作:'console' is undefined error for Internet Explorer

并粘贴代码

(function() {
  if (!window.console) {
    window.console = {};
  }
  // union of Chrome, FF, IE, and Safari console methods
  var m = [
    "log", "info", "warn", "error", "debug", "trace", "dir", "group",
    "groupCollapsed", "groupEnd", "time", "timeEnd", "profile", "profileEnd",
    "dirxml", "assert", "count", "markTimeline", "timeStamp", "clear"
  ];
  // define undefined methods as noops to prevent errors
  for (var i = 0; i < m.length; i++) {
    if (!window.console[m[i]]) {
      window.console[m[i]] = function() {};
    }    
  } 
})();

在target-script-min.js之上。

现在我把一些对象作为控制台,警报给了我这个: window.console; [object Object]

之后我得到更多错误:

&#34;访问被拒绝&#34; 在html第1行。

现在有什么东西阻止Weinre首先获取html页面吗?我也得到以下错误:

&#34;无法获取属性的值&#39; InspectorNotify&#39;:对象为null或未定义&#34; 在target-script-min.js上。这个错误来了两次。

0 个答案:

没有答案