[
https://issues.apache.org/jira/browse/CB-6991?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14038761#comment-14038761
]
Joshua Walsh edited comment on CB-6991 at 6/20/14 1:08 PM:
-----------------------------------------------------------
Hi, sorry for not making this clear. I was referring to platforms that don't
have an inbuilt JS console. All the platforms I tested have a working Weinre
console once I had applied my fix.
I don't think I explained the issue well at all, so I'll try again:
Weinre overrides window.console.log(). It does not first check that
window.console exists. This results in an "Unable to set property of undefined"
error. Setting window.console to an empty array if it doesn't already exist
fixes the issue, and allows Weinre's console to function perfectly.
was (Author: ym_industries):
Hi, sorry for not making this clear. I was referring to platforms that don't
have an inbuilt JS console. All the platforms have a working Weinre console.
I don't think I explained the issue well at all, so I'll try again:
Weinre overrides window.console.log(). It does not first check that
window.console exists. This results in an "Unable to set property of undefined"
error. Setting window.console to an empty array if it doesn't already exist
fixes the issue, and allows Weinre's console to function perfectly.
> Weinre doesn't fails to load in browsers without a development console
> ----------------------------------------------------------------------
>
> Key: CB-6991
> URL: https://issues.apache.org/jira/browse/CB-6991
> 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
(v6.2#6252)