tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

print_iframe.html (887B)


      1 <!doctype html>
      2 <html>
      3  <head>
      4    <meta charset="utf-8" content="width=device-width, height=device-height" />
      5    <title>Print iframes</title>
      6  </head>
      7  <style>
      8    .box {
      9      height: 200vh;
     10      width: 100vw;
     11    }
     12    @media screen {
     13      .background {
     14        background-color: rgb(255, 0, 0);
     15        color-adjust: exact;
     16      }
     17    }
     18    @media print {
     19      .background {
     20        background-color: rgb(0, 255, 0);
     21        color-adjust: exact;
     22      }
     23    }
     24  </style>
     25 
     26  <body>
     27    <div id="content" class="box background"></div>
     28  </body>
     29 
     30  <!-- The window.print should freeze the page before removing the content, so the background should remain present. -->
     31  <button
     32    id="print-button-page"
     33    onclick="window.print(); document.getElementById('content').remove()"
     34  >
     35    Print
     36  </button>
     37 
     38  <iframe id="iframe" src="print_content_change.html"></iframe>
     39 </html>