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
1
vote
1 answer
Unable to bypass angular sanitize security
I have a wysiwyg editor (angular-editor):
Below the editor I'm trying to use ngx-highlightjs:
So, when I type in…
Pierre D
- 327
- 1
- 2
- 7
1
vote
1 answer
How to play Video coming in HTML String in IONIC 4
I've HTML string coming from API and inside HTML String I am getting youtube video into
I want to display this video along with HTML.
export class BlogDetailsPage implements OnInit {
detail = {};
constructor(public…

Ubiquitous Developers
- 3,637
- 6
- 33
- 78
1
vote
0 answers
domsanitizer give safe html content but anchor tag not clickable after sanitization
I'm using DomSanitizer in angular 6. I want to sanitize my content which contains iframes hyperlinks videos content etc. After sanitization I'm getting all the content its just anchor tags are not clickable now. Kindly help me with this.
I've tried…

Ali Haider
- 11
- 4
1
vote
1 answer
Angular: Prevent DomSanizer from updating on DOM Events
I'm facing an issue with DomSanitizer.
I've created a StackBlitz that replicate this issue.
Every time the button is clicked, the iframe A is reloaded. The button does absolutely nothing - so it is not related to the iframe.
iframe A has a dynamic…

chris01
- 10,921
- 9
- 54
- 93
1
vote
1 answer
Angular 4 - Sanitized image url keeps being requested
I have an image as below:
And the imgSource is always same after retrieved once. However, it keeps requesting the image again and again from the network (see ).
However, if I don't…

Bünyamin Sarıgül
- 3,031
- 4
- 30
- 55
1
vote
2 answers
Best way to pass angular routerLink URL's in an HTML string
I have a notification service in my angular app, typically you call it like
this.notificationsService.showError('My Title', 'My Message...');
I'd like to have the ability to to pass app links in the messages as well, and I know I need to allow…

Chris Barr
- 29,851
- 23
- 95
- 135
1
vote
2 answers
Angular dom sanitize not working correctly
I used angular dom sanitizer to get html from a text area. It works perfectly for the first time after rendering the whole project, but the second time after revisit the component I got this message:
SafeValue must use [property]=binding: My text…

Dhia
- 51
- 2
- 13
1
vote
1 answer
Iframe loading infinitely angular 2
I am trying to create really simple Iframe in Angular 2 project.
Code
If I use raw url in iframe src, get an error unsafe value used in a resource URL context
1
vote
1 answer
DomSanitizer throwing an error
I am trusting the URL with.. DomSanitizer as below:
myFunction(videoLoc:any):void {
videoLoc = this.sanitizer.bypassSecurityTrustResourceUrl(videoLoc);
}
but getting an error on console:
GET…

N Sharma
- 33,489
- 95
- 256
- 444
1
vote
1 answer
Is it possible to include and emit an event in the string that is sanitized using DomSanitizer pipe in Angular?
I tried to pass an click event to a button that is rendered using DomSanitizer.
But the bounded method is not getting called when the button is clicked.
component.ts
export class MyComponent {
htmlElement = '
1
vote
1 answer
How to contain styles injected with innerHTML to the DOM element and its children?
I have one HTML page which I am getting from the third party.
The issue is HTML comes with CSS inside style tag. That CSS is kind of generic where they are adding their own font and own font size on body.
I am using dom sanitizer with…

Nitish
- 651
- 1
- 7
- 14
1
vote
0 answers
Angular5 / Firebase Storage are not working when using third-part libraries to zoom images
I'm building an e-commerce using Angular5 and Google Cloud Firestore as Database. In the products page, I want to zoom a photo when the mouse hover the picture. Here's the problem:
As a zoom library, I'm using angular2-image-zoom. It works fine with…

lucianokrebs
- 831
- 1
- 12
- 15
1
vote
1 answer
Angular 5: Display html AND xml from server response
I have a scenario where I need to display html and xml from the same string sent from the server.
The reply from the server looks like this:
This is sample text with bold text and also some xml like this…

Thibs
- 8,058
- 13
- 54
- 85
1
vote
0 answers
Angular2 undefined DomSanitizer within Pipe
I'm trying to use DomSanitizer to make my URL safe. I've followed these steps as you can see below:
import { Pipe, PipeTransform } from '@angular/core';
import { DomSanitizer } from '@angular/platform-browser';
@Pipe({
name: 'youtube',
})
export…

Rob
- 2,243
- 4
- 29
- 40
1
vote
1 answer
Angular, DomSanitizer, bypassSecurity script
I'm playing with bypassSecurityTrust* functions of Angular. Goal is to get a script tag to execute on the page. But it either keeps sanitizing with the message
WARNING: sanitizing HTML stripped some content
or I see in the console a
SafeHtmlImpl…

user857990
- 1,140
- 3
- 14
- 29