[CLOSED] [#496] DocumentReady in iframe of two different domain does not work in Firefox 29.x.x

  1. #1

    [CLOSED] [#496] DocumentReady in iframe of two different domain does not work in Firefox 29.x.x

    DocumentReady event is not raised when a IFrame is being called in by a page in another domain. The problem occurs on FireFox, version 29.


    Domain 1 [example1.com/Home/Index]:

    <%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage<dynamic>" %>
     <!DOCTYPE html>
    <html>
    <head runat="server">
        <title>Index</title>
        <script type="text/javascript">
            var onReady = function global_onReady() {
                var iframe = document.createElement("iframe");
                iframe.id = "iframe1";
                iframe.name = "iframe1";
                iframe.style.display = "none";
     
                document.body.appendChild(iframe);
     
                var form = document.createElement("form");
                form.name = "form1";
                form.action = "http://localhost:11415/Home/Index";
                form.target = iframe.name;
                form.method = "post";
                form.style.display = "none";
     
                var fields = { fld1: "1", fld2: "2", fld3: "3" };
     
                for (var fld in fields) {
                    var input = document.createElement("input");
                    input.name = fld;
                    input.value = fields[fld];
     
                    form.appendChild(input);
                }
     
                document.body.appendChild(form);
     
                form.submit();
            };
        </script>
        >
    </head>
    <body>
        <ext:ResourceManager CleanRequestUrl="false" runat="server">
            <Listeners>
                <DocumentReady Handler="onReady();" />
            </Listeners>
        </ext:ResourceManager>
    </body>
    </html>


    Domain 2 [localhost:11415/Home/Index]:

    <%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage<dynamic>" %>
    <!DOCTYPE html>
    <html>
    <head runat="server">
        <title>Index</title>
    </head>
    <body>
        <ext:ResourceManager CleanRequestUrl="true" runat="server">
            <Listeners>
                <DocumentReady Handler="alert('This alert dont occurs in Firefox 29!');" />
            </Listeners>
        </ext:ResourceManager>
    </body>
    </html>
    Last edited by Daniil; Jan 30, 2015 at 12:20 PM. Reason: [CLOSED]
  2. #2
    Hi Raphael,

    Do you mean that it is OK in other browsers except FireFox?

    Could you ensure that an iframe is loaded correctly? Maybe, it cannot load Ext.NET resources, for example.
  3. #3
    Quote Originally Posted by Daniil View Post
    Do you mean that it is OK in other browsers except FireFox?
    Yes, on IE and on Chrome it works as expected.


    Quote Originally Posted by Daniil View Post
    Could you ensure that an iframe is loaded correctly? Maybe, it cannot load Ext.NET resources, for example.
    Yes, the i frame was loaded correctly.
  4. #4
    Ok, I've reproduced that. A JavaScript error occurs in FireFox.
    view.getComputedStyle(...) is null
    Evan suggest a workaround here.
    http://www.sencha.com/forum/showthre...=1#post1015588

    Created an Issue to track this defect.
    https://github.com/extnet/Ext.NET/issues/496
  5. #5
    Any update?
  6. #6
    Please try this (just add into a page's <head>).
    Ext.Array.each(Ext.feature.tests, function(test) {
        if (test.name === "RightMargin") {
            test.fn = function(doc, div) {
                var view = doc.defaultView;
    
                if (Ext.isGecko) {
                    return true;
                } else {
                    return !(view && view.getComputedStyle(div.firstChild.firstChild, null).marginRight != '0px');
                }
    
                return true;
    
            }
        }
    
        if (test.name === "TransparentColor") {
            test.fn = function(doc, div) {
                var view = doc.defaultView;
    
                if (Ext.isGecko) {
                    return true;
                } else {
                    return !(view && view.getComputedStyle(div.lastChild, null).backgroundColor != 'transparent');
                }
    
                return true;
            }
        }
    });
  7. #7
    Thank you daniil
  8. #8
    Decided to apply the fix in the revision 6293 (trunk). It goes to 3.1.0 beta.
  9. #9
    Decided to apply the fix in the revision 6293 (trunk). It goes to 3.1.0 beta.
    Thank you Daniil

Similar Threads

  1. [CLOSED] MessageBus thru iFrame via hosted Domain
    By VirtualArtists in forum 2.x Legacy Premium Help
    Replies: 1
    Last Post: Dec 15, 2013, 4:49 PM
  2. [CLOSED] iframe onFocus failing w/Chrome & Firefox
    By randy85253 in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Apr 12, 2012, 8:08 AM
  3. [CLOSED] Swf does not work using FireFox.
    By flormariafr in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: May 21, 2010, 2:03 PM
  4. FitLayout and doesn't work in Firefox
    By moth1 in forum 1.x Help
    Replies: 1
    Last Post: Mar 30, 2010, 9:50 PM
  5. GridPanel Add Record does not work in FireFox
    By r_honey in forum 1.x Help
    Replies: 2
    Last Post: Apr 13, 2009, 1:44 AM

Posting Permissions