I have a button input attached to a jQuery action that writes an iframe to the DOM. The IFrame points to a PHP script that compiles an Excel file to load strength.
This button works fine on desktop hardware, but the latest Mac OS X versions for iPhone cause this script to throw a Javascript error in the browser console and doesn't seem to insert an iframe in the DOM. I replicated the bug in iOS v10.3.3 and v11.0.1.
iOS v10.3.3 throws the following Javascript error:
SecurityError (DOM Exception 18): violation of access to the sandbox: the frame is locked at https: // www. [REDACTED] .com "from access to the frame with the value https: // www. [REDACTED] .com ". Access to the frame is sandboxed and the flag "allow-same-origin" is missing. at https: // www. [REDACTED] .com / path / jquery / jquery.min.js on line 3
iOS v11.0.1 throws the following:
SecurityError (DOM Exception 18): the frame with the source " https: // www. [REDACTED] .com " from accessing the frame with the source "X-apple-QL identifier: // 256b58b2-0821-4779-810b-5493faa49e07 is blocked " The access request frame has the https protocol, the frame that is accessed has the https protocol. The protocols must match. at https: // www. [REDACTED] .com / modules / jquery / jquery.min.js on line 3
Here is the Javascript I'm 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' : '/xls/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 share