Uploaded image for project: 'Apache Cordova'
  1. Apache Cordova
  2. CB-3319

[weinre] Chrome is setting window properties which now breaks Weinre

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: cordova-weinre
    • Labels:

      Description

      The weinre page cannot be displayed in Chrome, an exception is thrown in 'InspectorBackendImpl.amd.js' on line 27. This happens across the debug.phonegap.com page, the node package as well as some of the test builds.

      intfNames = ["ApplicationCache", "BrowserDebugger", "CSS", "Console", "DOM", "DOMStorage", "Database", "Debugger", "InjectedScript", "Inspector", "Network", "Profiler", "Runtime"];
      _results = [];
      for (_i = 0, _len = intfNames.length; _i < _len; _i++) {
      intfName = intfNames[_i];
      proxy = Weinre.messageDispatcher.createProxy(intfName);
      if (window[intfName])

      { throw new Ex(arguments, "backend interface '" + intfName + "' already created"); Uncaught #<Ex> }

      Chrome is actually setting a 'CSS' interface on the window object. Could these be prefixed for the weinre proxy names?

        Activity

        Show
        pmuellr Patrick Mueller added a comment - fixed in commit: https://git-wip-us.apache.org/repos/asf?p=cordova-weinre.git;a=commit;h=e1370bae3e067a7c23ae91fdfc337d45644d4dde
        Hide
        pmuellr Patrick Mueller added a comment -

        If you can inspect/modify CSS in weinre with the assignment to the CSS global commented out, then my guess was right that this is old, unused code. Thanks for investigating.

        In terms of other files, if you mean files from Web Inspector itself - like files for JavaScript debugging support that weinre doesn't use - then the bad news is that it's hard to figure out what to not include. And it would be another modification to the Web Inspector source (the .html file) we'd have to sync. Never seemed worth the bother to me.

        Show
        pmuellr Patrick Mueller added a comment - If you can inspect/modify CSS in weinre with the assignment to the CSS global commented out, then my guess was right that this is old, unused code. Thanks for investigating. In terms of other files, if you mean files from Web Inspector itself - like files for JavaScript debugging support that weinre doesn't use - then the bad news is that it's hard to figure out what to not include. And it would be another modification to the Web Inspector source (the .html file) we'd have to sync. Never seemed worth the bother to me.
        Hide
        unbug unbug added a comment - - edited

        Yes,Mueller,I added a comment and it works,but I am not sure what gonna happend since Canary got it's own window.CSS property,everything seems fine by now.Do you mind to take a over look of the whole weinre client?As you say,maybe some of the JS files really dont necessary to load.Thanks.

        web/weinre/client/InspectorBackendImpl.amd.js
        comment line 27

        intfNames = ["ApplicationCache", "BrowserDebugger", "CSS", "Console", "DOM", "DOMStorage", "Database", "Debugger", "InjectedScript", "Inspector", "Network", "Profiler", "Runtime"];
        _results = [];
        for (_i = 0, _len = intfNames.length; _i < _len; _i++) {
        intfName = intfNames[_i];
        proxy = Weinre.messageDispatcher.createProxy(intfName);
        if (window[intfName])

        { //throw new Ex(arguments, "backend interface '" + intfName + "' already created");//commented }
        Show
        unbug unbug added a comment - - edited Yes,Mueller,I added a comment and it works,but I am not sure what gonna happend since Canary got it's own window.CSS property,everything seems fine by now.Do you mind to take a over look of the whole weinre client?As you say,maybe some of the JS files really dont necessary to load.Thanks. web/weinre/client/InspectorBackendImpl.amd.js comment line 27 intfNames = ["ApplicationCache", "BrowserDebugger", "CSS", "Console", "DOM", "DOMStorage", "Database", "Debugger", "InjectedScript", "Inspector", "Network", "Profiler", "Runtime"] ; _results = []; for (_i = 0, _len = intfNames.length; _i < _len; _i++) { intfName = intfNames [_i] ; proxy = Weinre.messageDispatcher.createProxy(intfName); if (window [intfName] ) { //throw new Ex(arguments, "backend interface '" + intfName + "' already created");//commented }
        Hide
        pmuellr Patrick Mueller added a comment -

        Yah, that's weird. Doesn't seem like the global should need to be set. However, perhaps the Web Inspector source needs it for some reason. Or maybe it needed a long time ago, and now no longer does, and the code just never got removed.

        Did you try just uncommenting the offending code, to see if things still worked?

        Show
        pmuellr Patrick Mueller added a comment - Yah, that's weird. Doesn't seem like the global should need to be set. However, perhaps the Web Inspector source needs it for some reason. Or maybe it needed a long time ago, and now no longer does, and the code just never got removed. Did you try just uncommenting the offending code, to see if things still worked?

          People

          • Assignee:
            Unassigned
            Reporter:
            mattgaunt Matt Gaunt
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development