Commit Graph

3 Commits (14dff49f92db0c9ad22575920fc8f00bd201ce42)

Author SHA1 Message Date
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 ()