Norway


I have a button input attached to a action that writes an into the DOM. The points to a PHP script that assembles an Excel file for force download.

This button works fine on desktop hardware, but recent versions of Mac OS X for the iPhone cause this script to throw a error into the browser console and appears to be failing to ever insert the iframe into the DOM. I replicated the error on iOS v10.3.3 and v11.0.1.

iOS v10.3.3 throws the following Javascript error:

SecurityError (DOM Exception 18): Sandbox access : Blocked a frame at R;https://www.[REDACTED].com” from accessing a frame at “https://www.[REDACTED].com“. The frame being accessed is sandboxed and lacks the “allow-same-origin” flag. in https://www.[REDACTED].com/path/jquery/jquery.min.js on line 3

iOS v11.0.1 throws the following:

SecurityError (DOM Exception 18): Blocked a frame with origin
https://www.[REDACTED].com” from accessing a frame with origin
“x-apple-ql-id://256b58b2-0821-4779-810b-5493faa49e07”. The frame
requesting access has a protocol of “https”, the frame being accessed
has a protocol of “https”. Protocols must match. in
https://www.[REDACTED].com/modules/jquery/jquery.min.js on line 3

Here is the Javascript I am working with.

var LOCAL = {
    execReport : function()
    {
        // Get form inputs
        var t = $('select[name="t"] option:selected').val();
        var s = $('select[name="s"] option:selected').val();

        // Write the iframe into the DOM
        var iframe = $('<iframe></iframe>', {
            'src' : '//observationsReport.php?gid=' + majGroup.gid + '&season=' + s + '&t=' + t,
            'id' : 'reportIframe',
            'width' : '1',
            'height' : '1',
            'frameborder' : '0',
            'scrolling' : 'no',
            'sandbox' : 'allow-same-origin'
        }).appendTo('body').on('load', function() {
            // Wait for the iframe to finish loading
            var response = $.parseJSON($('#reportIframe').contents().find('body').html());

            // Show any errors that happened
            if (response && response.error)
            {
                // If the report assembly threw an error, display it here
                // This is NOT related to the Javascript error I am experiencing!
            }
        });
    }
};



Source link

LEAVE A REPLY

Please enter your comment!
Please enter your name here