mirror of
https://github.com/niklasvh/html2canvas.git
synced 2023-08-10 21:13:10 +03:00
fix: Fix documentClone.fonts.ready not resolved even though documentClone.fonts.status is 'loaded' in IOS 13.6
This commit is contained in:
parent
181d1b1103
commit
33aa7ff161
@ -113,7 +113,24 @@ export class DocumentCloner {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (documentClone.fonts && documentClone.fonts.ready) {
|
if (documentClone.fonts && documentClone.fonts.ready) {
|
||||||
await documentClone.fonts.ready;
|
// Fix documentClone.fonts.ready not resolved even though documentClone.fonts.status is 'loaded' in IOS 13.6
|
||||||
|
|
||||||
|
if (documentClone.fonts.status !== 'loaded') {
|
||||||
|
await Promise.race([
|
||||||
|
documentClone.fonts.ready,
|
||||||
|
new Promise((resolve) => {
|
||||||
|
const check = () => {
|
||||||
|
if (documentClone.fonts.status === 'loaded') {
|
||||||
|
resolve(null);
|
||||||
|
} else {
|
||||||
|
setTimeout(check, 100);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
setTimeout(check, 100);
|
||||||
|
})
|
||||||
|
]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (/(AppleWebKit)/g.test(navigator.userAgent)) {
|
if (/(AppleWebKit)/g.test(navigator.userAgent)) {
|
||||||
|
Loading…
Reference in New Issue
Block a user