Skip to content

[feature request] PDF detection #5

Description

@ttlns
var script = document.createElement('script');
script.src =
  'https://cdnjs.cloudflare.com/ajax/libs/jspdf/2.5.1/jspdf.umd.min.js';
script.onload = function () {
  const { jsPDF } = window.jspdf;
  const doc = new jsPDF();
  doc.text('test', 10, 20);
  const pdfURL = URL.createObjectURL(doc.output('blob'));
  const iframe = document.createElement('iframe');
  iframe.src = pdfURL;
  document.body.appendChild(iframe);
  iframe.onload = () => console.log(iframe.contentDocument.querySelector('style')?.textContent||'nothing');

};
document.head.appendChild(script)
      body {
        height: 100%;
        width: 100%;
        overflow: hidden;
        margin: 0;
        background-color: rgb(38, 38, 38);
      }

Discovered by @anonymous, thanks a lot!

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestpuppeteerdetection related to puppeteer

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions