Skip to content

"Error calling method on NPObject!" #243

@peterbe

Description

@peterbe

I sometimes get this error when using Flashsocket in Firefox. It's quite strange (stinks of Flash "brittleness") because I think a restart of the browser will fix the problem.

Error calling method on NPObject!
[Break On This Error] WebSocket.__flash.setCallerUrl(location.href); 

The line where is happens is this:

  /**
   * Called by Flash to notify JS that it's fully loaded and ready
   * for communication.
   */
  WebSocket.__onFlashInitialized = function() {
    // We need to set a timeout here to avoid round-trip calls
    // to flash during the initialization process.
    setTimeout(function() {
      WebSocket.__flash = document.getElementById("webSocketFlash");
      WebSocket.__flash.setCallerUrl(location.href);
      WebSocket.__flash.setDebug(!!window.WEB_SOCKET_DEBUG);
      for (var i = 0; i < WebSocket.__tasks.length; ++i) {
        WebSocket.__tasks[i]();
      }
      WebSocket.__tasks = [];
    }, 0);
  };

I guess it means that document.getElementById("webSocketFlash") returns null. But why?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions