html2canvas-pro 1.6.3 → 1.6.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/html2canvas-pro.esm.js +15 -2
- package/dist/html2canvas-pro.esm.js.map +1 -1
- package/dist/html2canvas-pro.js +15 -2
- package/dist/html2canvas-pro.js.map +1 -1
- package/dist/html2canvas-pro.min.js +2 -2
- package/dist/lib/dom/document-cloner.js +14 -1
- package/dist/lib/dom/document-cloner.js.map +1 -1
- package/package.json +9 -9
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* html2canvas-pro 1.6.
|
|
2
|
+
* html2canvas-pro 1.6.4 <https://yorickshan.github.io/html2canvas-pro/>
|
|
3
3
|
* Copyright (c) 2024-present yorickshan and html2canvas-pro contributors
|
|
4
4
|
* Released under MIT License
|
|
5
5
|
*/
|
|
@@ -6063,7 +6063,20 @@ class DocumentCloner {
|
|
|
6063
6063
|
* */
|
|
6064
6064
|
const baseUri = documentClone.baseURI;
|
|
6065
6065
|
documentClone.open();
|
|
6066
|
-
|
|
6066
|
+
try {
|
|
6067
|
+
// fixing "This document requires 'TrustedHTML' assignment. The action has been blocked." error
|
|
6068
|
+
// @ts-ignore
|
|
6069
|
+
const policy = trustedTypes.createPolicy('my-policy', {
|
|
6070
|
+
createHTML: (string) => string
|
|
6071
|
+
});
|
|
6072
|
+
const rawHTML = serializeDoctype(document.doctype) + '<html></html>';
|
|
6073
|
+
const trustedHTML = policy.createHTML(rawHTML);
|
|
6074
|
+
documentClone.write(trustedHTML);
|
|
6075
|
+
}
|
|
6076
|
+
catch (e) {
|
|
6077
|
+
// if browser does not support trustedTypes
|
|
6078
|
+
documentClone.write(serializeDoctype(document.doctype) + '<html></html>');
|
|
6079
|
+
}
|
|
6067
6080
|
// Chrome scrolls the parent document for some reason after the write to the cloned window???
|
|
6068
6081
|
restoreOwnerScroll(this.referenceElement.ownerDocument, scrollX, scrollY);
|
|
6069
6082
|
/**
|