Shindig
  1. Shindig
  2. SHINDIG-1287

Firefox bug affects RPC communication from gadget containers to gadgets

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Javascript
    • Labels:
      None
    • Environment:
      Firefox 3+ (all platforms)

      Description

      When iframes are re-created in Firefox, window.frames[id] fetches the dead iframe instead of the new one.
      See https://bugzilla.mozilla.org/show_bug.cgi?id=498904

      One of the effects of this bug is that RPCs sent from a container to gadget iframes do not reach their destination because the RPC library fetches the frame reference from window.frames[id]. This is the code fragment from Shindig:

      getTargetWin(id)
      ............
      // Try window.frames first
      var target = window.frames[id];
      if (target)

      { return target; }

      // Fall back to getElementById()
      target = document.getElementById(id);
      if (target && target.contentWindow)

      { return target.contentWindow; }

      ............

      document.getElementById(id) is not affected by this Firefox bug. Would you consider always fetching the target using getElementById to avoid this Firefox issue?

        Activity

        Hide
        Jacky Wang added a comment -

        Hi Vadim,

        Which version of Shindig are u using? On PHP one, we have a known issue opened there - the RPC communication between container and gadget will fail because of a javascript inclusion problem.

        If it's the case, you may like to apply the patch on SHINDIG-1260: https://issues.apache.org/jira/secure/attachment/12435197/shindig-1260-revised.patch

        Hope it helps.

        Regards,
        Jacky

        Show
        Jacky Wang added a comment - Hi Vadim, Which version of Shindig are u using? On PHP one, we have a known issue opened there - the RPC communication between container and gadget will fail because of a javascript inclusion problem. If it's the case, you may like to apply the patch on SHINDIG-1260 : https://issues.apache.org/jira/secure/attachment/12435197/shindig-1260-revised.patch Hope it helps. Regards, Jacky
        Hide
        John Hjelmstad added a comment -

        I'm exceedingly leery of inverting this logic, mostly out of personal experience that any change to the rpc setup API causes odd and unfortunate breaks. That said, I wouldn't be opposed to adding a method that opts in a library user to this behavior eg:

        gadgets.rpc.useIdOverFrameName();
        --> all subsequent requests use document.getElementById(...) first.

        Show
        John Hjelmstad added a comment - I'm exceedingly leery of inverting this logic, mostly out of personal experience that any change to the rpc setup API causes odd and unfortunate breaks. That said, I wouldn't be opposed to adding a method that opts in a library user to this behavior eg: gadgets.rpc.useIdOverFrameName(); --> all subsequent requests use document.getElementById(...) first.
        Hide
        Vadim Gerasimov added a comment -

        I agree that adding gadgets.rpc.useIdOverFrameName(); would be a good solution. getElementById may have unexpected side effects in other browsers and could be slower.

        Show
        Vadim Gerasimov added a comment - I agree that adding gadgets.rpc.useIdOverFrameName(); would be a good solution. getElementById may have unexpected side effects in other browsers and could be slower.
        Hide
        Zhenhua (Gerald) Guo added a comment -

        Yes, I encountered the same issue.

        Show
        Zhenhua (Gerald) Guo added a comment - Yes, I encountered the same issue.

          People

          • Assignee:
            Unassigned
            Reporter:
            Vadim Gerasimov
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:

              Development