mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-22 16:18:08 +02:00
Refactor the container/viewer checks in the BaseViewer constructor
The previous checks prevented specifying a container/viewer that was in another document/window. Fixes #12385
This commit is contained in:
parent
558d3870d3
commit
d37a445369
1 changed files with 4 additions and 2 deletions
|
@ -150,8 +150,10 @@ class BaseViewer {
|
|||
) {
|
||||
if (
|
||||
!(
|
||||
this.container instanceof HTMLDivElement &&
|
||||
this.viewer instanceof HTMLDivElement
|
||||
this.container &&
|
||||
this.container.tagName.toUpperCase() === "DIV" &&
|
||||
this.viewer &&
|
||||
this.viewer.tagName.toUpperCase() === "DIV"
|
||||
)
|
||||
) {
|
||||
throw new Error("Invalid `container` and/or `viewer` option.");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue