mirror of
https://github.com/fengyuanchen/viewerjs.git
synced 2026-02-01 16:32:50 +00:00
fix: fall back to documentElement is body is not existing
This commit is contained in:
parent
fd4e721ad5
commit
35200de34a
@ -526,7 +526,7 @@ export function getImageNaturalSizes(image, callback) {
|
||||
}
|
||||
|
||||
const newImage = document.createElement('img');
|
||||
const { body } = document;
|
||||
const body = document.body || document.documentElement;
|
||||
|
||||
newImage.onload = () => {
|
||||
callback(newImage.width, newImage.height);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user