[Webkit-unassigned] [Bug 192585] New: iFrame printing works in desktop Safari, but not mobile...
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Tue Dec 11 03:08:50 PST 2018
https://bugs.webkit.org/show_bug.cgi?id=192585
Bug ID: 192585
Summary: iFrame printing works in desktop Safari, but not
mobile...
Product: WebKit
Version: Safari 12
Hardware: Unspecified
OS: Unspecified
Status: NEW
Severity: Normal
Priority: P2
Component: Frames
Assignee: webkit-unassigned at lists.webkit.org
Reporter: l.mazz at verizon.net
Printing. Works for me on desktop Safari. Same code won’t work on iOS Safari.
Not a lot of code:
===================================
//"Print" order button on orderItemList page
$('#orderItemList .toolbar .printButton').live('click', function(event) {
//test for pending (Submit) or actual
if ($('#orderItemList .tabbar li').last().text() == "Submit") url = "printableOrderHTML.php?u="+dopeArray[0]+"&c="+dopeArray[1]+"&o="+dopeArray[2];
else url = "../ReceiveIt/printableOrderHTML.php?u="+username+"&c="+dopeArray[1]+"&o="+orderNo;
bPrint(url);
});
//Print function caller
// SAFARI VERSION DEPENDENT - assumes "sVersion" has correct Safari version
var iframe;
function bPrint(url) {
if (sVersion > "5.0.6")
if ($('iframe').html() != null) $('iframe').remove(); // newer Safaris require this done here
iframe = document.createElement("iframe"); // create an iframe so that no window pops up
document.body.appendChild(iframe); // insert the element to the DOM
aSp = 0;
$.ajax({
url: url,
success: printCallback
});
}
function printCallback(data) {
var error=/Error:/g;
if (error.test(data) == true) {
$('#error #results').html(data);
jQT.goTo('#error','slideleft');
}
else {
iframe.contentWindow.document.write(data); // write the HTML to be printed
iframe.contentWindow.print(); // print it
if (sVersion <= "5.0.6")
$('iframe').remove(); // older Safaris get this done here, where it should be
return true;
}
}
==============================
…as I said, desktop Safari likes this just fine.
In iOS, I get a blank preview page.
Apparently I’m not the only one:
https://github.com/mozilla/pdf.js/issues/7597
All iOS12 simulator devices give me a blank page.
--
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20181211/a19d90d9/attachment.html>
More information about the webkit-unassigned
mailing list