Skip to content

[Bug]: Using viewer html in iframe [srcdoc] makes viewer always cause "Setting up fake worker" #20445

@Luxusio

Description

@Luxusio

Attach (recommended) or Link to PDF file

Not a pdf file related bug

Web browser and its version

Chromium 142.0.7444.162

Operating system and its version

macOS Sequoia 15.6.1

PDF.js version

5.4.149

Is the bug present in the latest PDF.js version?

Not tested

Is a browser extension

No

Steps to reproduce the problem

  1. Copy & Paste entire viewer html into iframe
  2. Warning message occurs

What is the expected behavior?

Warning message not occurs

What went wrong?

in iframe's srcdoc, windows.location is always about:srcdoc.
then api.js decides it has different origin.

Image Image

and then, api.js tries to create a URL object, but it fails. Then pdf.js always setup fake worker.js

Link to a viewer

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions