Commit Graph

4 Commits (9c8891b39a2d04898880f4bd0754a52739ada30a)

Author SHA1 Message Date
Matt Hodges 4114a7088a
Embed js height fix ()
* only begin iframe reheight once document state is complete

* format

* lint fixes

* Update public/embed.js to use readystatechange event listener

Co-authored-by: Claire <claire.github-309c@sitedethib.com>

* Call loaded() if ready, otherwise add listenter

* lint fix

Co-authored-by: Claire <claire.github-309c@sitedethib.com>
rinsuki 6e736f2452
fix: embed.js doesn't expands iframes height ()
also including some refactoring:
- add `// @ts-check`
- use Map to completely avoid prototype pollution
- assign random id to each iframe for reduce chance to brute-force attack, and leak of iframe counts
- check iframe.contentWindow and MessageEvent.source to validate message is coming from correct iframe (it works on latest Chrome/Firefox/Safari but I'm not sure this is allowed by spec)

follow-up of 
fix 
Rohan Sharma 4d6d4b43c6
Fixed prototype pollution bug and only allow trusted origin ()
Eugen Rochko 6867681c7c Add script to make embedded iframes autosize ()