cordova-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Joshua Walsh (JIRA)" <>
Subject [jira] [Commented] (CB-6991) Weinre fails to load in browsers without a built-in development console
Date Sat, 21 Jun 2014 00:23:26 GMT


Joshua Walsh commented on CB-6991:

"hmmm, last I remember, you could certainly use `console.log()` in iOS and Android"
Perhaps I'm using an older version of those then, because I hooked window.onerror and that
was the error I was getting.

"the console object may well be injected into the global scope, and not available as a property
of the "window" object"
In JavaScript, the window object IS the global scope.
testVariable = "test";
console.log(window.testVariable); //Logs "test" in the console

"Could you only get weinre to work on iOS and Android and wp8 by modifying that code? If so,
that's a weird regression since weinre has worked in the past on those platforms."
Yep, that's what happened, and yes, it's a weird regression.

And as for not needing Weinre on Android or iOS, I like the way Weinre does debugging, and
I like having the same debugging interface on all of my platforms. It's also easier to set
up Weinre, or it would have been if I didn't have to spend hours tracking down this bug. 

> Weinre fails to load in browsers without a built-in development console
> -----------------------------------------------------------------------
>                 Key: CB-6991
>                 URL:
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: weinre
>         Environment: Windows Phone 8.0, iOS, Android
>            Reporter: Joshua Walsh
>            Assignee: Patrick Mueller
>            Priority: Blocker
>              Labels: easyfix, javascript
>   Original Estimate: 10m
>  Remaining Estimate: 10m
> I couldn't work out where to submit a pull request, so I'm doing an issue report instead.
Additionally, this issue applies to version 2.0.0-pre-HH0SN197 of Weinre, but I don't know
which version of Cordova that maps to.
> This issue has been a massive pain to debug, as the issue is not present on desktop computers
and there are no debugging tools on mobile devices, hence why I need Weinre in the first place!
In fact, the issue is even more specific than that: The issue affects all browsers WITHOUT
debugging tools.
> The error is: "Unable to set property __original of undefined or null reference." The
issue occurs on line 172 of Console.amd.js. In order to fix it, I added the following lines
of code above line 168:
> if(!window.console)
> {
> 	window.console = {};
> }
> I'm sure there's a more elegant way of solving this, but it does the trick.
> Good luck!

This message was sent by Atlassian JIRA

View raw message