I'm getting from API strings of html code which may contain embedded videos from the following services:
- youtube.com,
- vimeo.com,
- dailymotion.com,
- prezi.com
If I'm sure it is secure enough I can convert them to trusted SafeHtml (to bypass Angular's sanitizer):
this.safeHtml = this._sanitizer.bypassSecurityTrustHtml(this.htmlFromApi);
And then place it on a page like this:
<div [innerHtml]="safeHtml"></div>
Questions:
Which checks I have to perform to be sure this string is safe enough? (it doesn't contain embedded scripts and leads only to one of these four sites without any tricky redirections)?
Does it make sense to add somehow these sites to exceptions of Angular's sanitizer? And how to do it if yes?
Thanks in advance!
p.s. I saw this similar question: How to check if string of HTML is safe? But I hope there is something more fresh and relevant to Angular best practices