<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>192585</bug_id>
          
          <creation_ts>2018-12-11 03:08:50 -0800</creation_ts>
          <short_desc>iFrame printing works in desktop Safari, but not mobile...</short_desc>
          <delta_ts>2018-12-12 15:45:34 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>Frames</component>
          <version>Safari 12</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>CONFIGURATION CHANGED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Lou Mazz">l.mazz</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>bfulgham</cc>
    
    <cc>cying</cc>
    
    <cc>dbates</cc>
    
    <cc>simon.fraser</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1486907</commentid>
    <comment_count>0</comment_count>
    <who name="Lou Mazz">l.mazz</who>
    <bug_when>2018-12-11 03:08:50 -0800</bug_when>
    <thetext>Printing.  Works for me on desktop Safari.  Same code won’t work on iOS Safari.

Not a lot of code:

===================================

	    //&quot;Print&quot; order button on orderItemList page
            $(&apos;#orderItemList .toolbar .printButton&apos;).live(&apos;click&apos;, function(event) {
				//test for pending (Submit) or actual
				if ($(&apos;#orderItemList .tabbar li&apos;).last().text() == &quot;Submit&quot;) url = &quot;printableOrderHTML.php?u=&quot;+dopeArray[0]+&quot;&amp;c=&quot;+dopeArray[1]+&quot;&amp;o=&quot;+dopeArray[2];	
				else url = &quot;../ReceiveIt/printableOrderHTML.php?u=&quot;+username+&quot;&amp;c=&quot;+dopeArray[1]+&quot;&amp;o=&quot;+orderNo;
				bPrint(url);			
			});
            
                             
            //Print function caller
            //        SAFARI VERSION DEPENDENT - assumes &quot;sVersion&quot; has correct Safari version
			var iframe;
            function bPrint(url) {
                if (sVersion &gt; &quot;5.0.6&quot;)
                    if ($(&apos;iframe&apos;).html() != null) $(&apos;iframe&apos;).remove();       // newer Safaris require this done here
            
                iframe = document.createElement(&quot;iframe&quot;);						// 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) {
					$(&apos;#error #results&apos;).html(data);
					jQT.goTo(&apos;#error&apos;,&apos;slideleft&apos;);
				}
				else {
					iframe.contentWindow.document.write(data);						// write the HTML to be printed
					iframe.contentWindow.print();                                   // print it
					if (sVersion &lt;= &quot;5.0.6&quot;) 
						$(&apos;iframe&apos;).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.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1487312</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2018-12-12 13:19:34 -0800</bug_when>
    <thetext>&lt;rdar://problem/46673189&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1487370</commentid>
    <comment_count>2</comment_count>
    <who name="Lou Mazz">l.mazz</who>
    <bug_when>2018-12-12 15:42:35 -0800</bug_when>
    <thetext>Stupid programmer error - variable &quot;sVersion&quot; test was wrong.
Fixed test - printing works.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1487371</commentid>
    <comment_count>3</comment_count>
    <who name="Lou Mazz">l.mazz</who>
    <bug_when>2018-12-12 15:43:46 -0800</bug_when>
    <thetext>Stupid programmer error - xVersion test was wrong, so iFrame was being
deleted.  Fixed test - printing works.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1487372</commentid>
    <comment_count>4</comment_count>
    <who name="Simon Fraser (smfr)">simon.fraser</who>
    <bug_when>2018-12-12 15:45:34 -0800</bug_when>
    <thetext>Great!</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>