Add a <dialog>
polyfill for the generic-legacy
build
Please note that this patch is purposely quite basic, e.g. it doesn't add the polyfill-CSS in order to simplify the build process, and things such as `::backdrop` thus isn't working. However, this patch does ensure that older browsers can at least still *access* all of the previous overlays and that things like e.g. opening of password-protected documents respectively printing still works.
This commit is contained in:
parent
b3d58e1000
commit
c9f262c480
13
package-lock.json
generated
13
package-lock.json
generated
@ -21,6 +21,7 @@
|
||||
"canvas": "^2.9.1",
|
||||
"core-js": "^3.21.1",
|
||||
"cross-env": "^7.0.3",
|
||||
"dialog-polyfill": "^0.5.6",
|
||||
"dommatrix": "^0.0.24",
|
||||
"es-module-shims": "1.4.7",
|
||||
"eslint": "^8.11.0",
|
||||
@ -4350,6 +4351,12 @@
|
||||
"kuler": "1.0.x"
|
||||
}
|
||||
},
|
||||
"node_modules/dialog-polyfill": {
|
||||
"version": "0.5.6",
|
||||
"resolved": "https://registry.npmjs.org/dialog-polyfill/-/dialog-polyfill-0.5.6.tgz",
|
||||
"integrity": "sha512-ZbVDJI9uvxPAKze6z146rmfUZjBqNEwcnFTVamQzXH+svluiV7swmVIGr7miwADgfgt1G2JQIytypM9fbyhX4w==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/dir-glob": {
|
||||
"version": "3.0.1",
|
||||
"resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz",
|
||||
@ -21951,6 +21958,12 @@
|
||||
"kuler": "1.0.x"
|
||||
}
|
||||
},
|
||||
"dialog-polyfill": {
|
||||
"version": "0.5.6",
|
||||
"resolved": "https://registry.npmjs.org/dialog-polyfill/-/dialog-polyfill-0.5.6.tgz",
|
||||
"integrity": "sha512-ZbVDJI9uvxPAKze6z146rmfUZjBqNEwcnFTVamQzXH+svluiV7swmVIGr7miwADgfgt1G2JQIytypM9fbyhX4w==",
|
||||
"dev": true
|
||||
},
|
||||
"dir-glob": {
|
||||
"version": "3.0.1",
|
||||
"resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz",
|
||||
|
@ -14,6 +14,7 @@
|
||||
"canvas": "^2.9.1",
|
||||
"core-js": "^3.21.1",
|
||||
"cross-env": "^7.0.3",
|
||||
"dialog-polyfill": "^0.5.6",
|
||||
"dommatrix": "^0.0.24",
|
||||
"es-module-shims": "1.4.7",
|
||||
"eslint": "^8.11.0",
|
||||
|
@ -37,6 +37,15 @@ class OverlayManager {
|
||||
}
|
||||
this.#overlays.set(dialog, { canForceClose });
|
||||
|
||||
if (
|
||||
typeof PDFJSDev !== "undefined" &&
|
||||
PDFJSDev.test("GENERIC && !SKIP_BABEL") &&
|
||||
!dialog.showModal
|
||||
) {
|
||||
const dialogPolyfill = require("dialog-polyfill/dist/dialog-polyfill.js");
|
||||
dialogPolyfill.registerDialog(dialog);
|
||||
}
|
||||
|
||||
dialog.addEventListener("cancel", evt => {
|
||||
this.#active = null;
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user