mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-19 22:58:07 +02:00
Merge pull request #15418 from Snuffleupagus/pr-15319-followup
Don't listen for window resolution changes in old browsers (PR 15319 follow-up)
This commit is contained in:
commit
a21ce7ac8b
1 changed files with 7 additions and 0 deletions
|
@ -1971,6 +1971,13 @@ const PDFViewerApplication = {
|
|||
const mediaQueryList = window.matchMedia(
|
||||
`(resolution: ${window.devicePixelRatio || 1}dppx)`
|
||||
);
|
||||
if (
|
||||
typeof PDFJSDev !== "undefined" &&
|
||||
PDFJSDev.test("GENERIC && !SKIP_BABEL") &&
|
||||
typeof mediaQueryList.addEventListener !== "function"
|
||||
) {
|
||||
return; // Not supported in Safari<14.
|
||||
}
|
||||
mediaQueryList.addEventListener("change", addWindowResolutionChange, {
|
||||
once: true,
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue