1
0
Fork 0
mirror of synced 2024-06-26 10:00:19 +12:00

fix snapshot_live iframe scrollTo not working due to origin sandbox rules

This commit is contained in:
Nick Sweeting 2024-06-02 19:15:12 -07:00
parent 11a24d9640
commit 729f05ab93
No known key found for this signature in database

View file

@ -435,12 +435,14 @@
this.src = this.src + '#toolbar=0'
}
this.onload = function() {
this.contentWindow.scrollTo(0, 0);
// this.src = this.src
if (this.src.endsWith('.pdf')) {
this.removeAttribute('sandbox')
this.src = this.src + '#toolbar=0'
}
try {
// doesnt work if frame origin rules prevent accessing its DOM via JS
this.contentWindow.scrollTo(0, 0);
} catch(err) {}
}
})