title: Flutter webview with javascript enable
body: <p>Flutter plugin <a href="https://pub.dartlang.org/packages/flutter_webview_plugin" rel="nofollow noreferrer">webview</a> and use javascript to print the web page, but only the javascript is not working in webview. Please kindly help to solve this issue.</p>
  
  <p>Flutter code:</p>
  
  <pre><code>Future&lt;Null&gt; _launchInWebViewWithJavaScript(String url) async {
      if (await canLaunch(url)) {
        await launch(
          url,
          forceSafariVC: true,
          forceWebView: false,
          enableJavaScript: true,
        );
      } else {
        throw 'Could not launch $url';
      }
    }
  </code></pre>
  
  <p>Webpage code (php, javascript and html):</p>
  
  <pre><code>&lt;?php
      $qrString = $_GET['qrString'];
      $tableNumber = $_GET['tableNumber'];
  ?&gt;
  
  &lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;head&gt;
    &lt;meta charset="utf-8"&gt;
    &lt;title&gt;receipt&lt;/title&gt;
    &lt;link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/3.0.3/normalize.css"&gt;
    &lt;link rel="stylesheet" href="../paper.css"&gt;
    &lt;style&gt;
      @page { size: 75mm 100mm } /* output size */
      body.receipt .sheet { width: 58mm; height: 100mm } /* sheet size */
      @media print { body.receipt { width: 58mm } } /* fix for Chrome */
    &lt;/style&gt;
  
    &lt;script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"&gt;&lt;/script&gt;
  
  &lt;/head&gt;
  
  &lt;body class="receipt"&gt;
    &lt;section class="sheet padding-10mm"&gt;
          &lt;?php echo '&lt;h1&gt;檯號: '.$tableNumber. '&lt;/h1&gt;&lt;br&gt;' ?&gt;
  
  
        &lt;img id='barcode' 
              src=&lt;?php echo 'https://api.qrserver.com/v1/create-qr-code/?data=' .$qrString. '&amp;amp;size=300x300' ?&gt;
              alt="" 
              title="HELLO" 
              width="300" 
              height="300" /&gt;
    &lt;/section&gt;
  &lt;/body&gt;
  
  &lt;script type="text/javascript"&gt;
  &lt;!--
  window.print();
  &lt;/script&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>The webpage is working fine with browser Chrome and Safari.
  <a href="https://i.stack.imgur.com/m5Zei.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/m5Zei.png" alt="enter image description here"></a></p>