DomSanitizer helps preventing Cross Site Scripting Security bugs (XSS) by sanitizing values to be safe to use in the different DOM contexts. Any questions concerning DomSanitizer package
Questions tagged [angular-dom-sanitizer]
120 questions
2
votes
0 answers
Spotify Embed iFrame only plays previews of songs
On my website, I can only seem to play previews of the tracks in the playlist in Chrome and Safari even though I am logged in to Spotify Premium. However, the full tracks can be played in Firefox. Why might this be the case?
Here is my website :…

Kevin Cai
- 21
- 3
2
votes
2 answers
Add event listener to DOM element in Angular 4
I would like to add an event listener to the iframe load event inside an Angular Component.
I know I could use ViewChild decorator and then access the element.nativeElement.addEventListener
However, in order to comply with best practices when…

Bill
- 2,026
- 9
- 55
- 99
2
votes
1 answer
Jasmine doesn't recognize Angular's DomSanitizer
I am unit testing an Angular 5 app with Jasmine. I got to the point where I need to test a function that relies on the DomSanitizer:
loadImage() {
this.image = this.sanitizer.bypassSecurityTrustStyle(`url(${this.assetUrl})`);
}
I verified that…

Alex Verzea
- 421
- 1
- 11
- 30
2
votes
0 answers
Angular4: SafeUrl in SafeHtml
What I am trying to achieve is a dynamically generated html with some static links in it.
So, in a component, I have an array of objects:
let list = [{
type: 'container',
title: 'SIMPLE LIST'
description: '
- …

ftabaro
- 136
- 11
1
vote
0 answers
Angular DomSanitizer.bypassSecurityTrustHtml not executing script tag inside html content
I tried to use DomSanitizer.bypassSecurityTrustHtml, the html content looks as below:
It is a test div element.