I've successfully connected my iPhone and Android phone to Weinre by following the instructions. However I'm not able to connect my Windows Phone 7.8 to Weinre, even though I've understood it should be possible.
I run Weinre with command 'weinre --boundHost -all- --debug -true'. I've included the script
<script src="http://[my.ip.goes.here]:8080/target/target-script-min.js#anonymous"></script>
to my page head.
I've navigated to http://[my.ip.goes.here]:8080/client/#anonymous
, where all the other phones pop up.
I've tried to run the Windows Phone Internet Explorer in both mobile and desktop -modes.
My terminal doesn't give any messages, not even an error when I refresh the page I want to inspect.
I'm currently working on mobile 4g network, could that affect the Weinre connection?
I'm using Mac.
Is there something I'm missing here?
EDIT:
I ran errors as alerts on Windows Phone and got this:
"Unable to set value of the property '__original': object is null or undefined" on line 1569 from file [my.ip.goes.here]:8080/target/target-script-min.js#anonymous
.
I have no idea yet, where it refers to.
EDIT:
I found and editet the target-script-min.js, located at usr/local/lib/node_modules/weinre/web/target/ folder:
// Lines 1567-1571
RemoteConsole = new Console();
OriginalConsole = window.console;
RemoteConsole.__original = OriginalConsole;
OriginalConsole.__original = OriginalConsole;
require("../common/MethodNamer").setNamesForClass(module.exports);
I added line
alert('window.console: ' + window.console);
On Firefox I get alert saying: window.console: [object Console] On Windows Phone I get window.console: undefined
The reason for this is that IE9 doesn't know such thing as window.console until the developer tools are open and obviously they aren't on Windows Phone. More details here: http://whattheheadsaid.com/2011/04/internet-explorer-9s-problematic-console-object
How do I add window.console object to IE9 without opening developer tools?
EDIT:
To get IE9 window.console object I followed instructions found here: 'console' is undefined error for Internet Explorer
and pasted the code
(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() {};
}
}
})();
On top of the target-script-min.js.
Now I got some object as a console and the alert gives me this: window.console; [object Object].
After that I get more errors:
"Access is denied" on html page line 1.
Is it so that now something is blocking Weinre to get the html page in the first place? I also get following error:
"Unable to get value of the property 'InspectorNotify': object is null or undefined" on target-script-min.js. This error comes twice.