Skip to main content
Filter by
Sorted by
Tagged with
1 vote
1 answer
231 views

I thought that I can use an URL as input Signal in my preview.component like hrefLink = input.required<SafeValue>(); and in the .html use it like <img [src]="hrefLink"/> I have ...
LeO's user avatar
  • 5,401
0 votes
0 answers
146 views

I'm creating a carousel with help of the ngx-slick-carousel. Each of the slides contains a Material Card and within each card there are Material icons. When the carousel is not infinite, everything ...
Martin's user avatar
  • 66
1 vote
1 answer
139 views

I need to sanitize the external url value to dynamically load script and remove script for specific component alone. used following approch private getUrl(): SafeResourceUrl { // declared value in ...
Aayushi's user avatar
  • 15
1 vote
1 answer
441 views

Using Angular in html I need to add title attribute on <a> tag, the value of the title will have text and special characters. The attribute should render tooltip on the anchor, but it is not ...
Kate's user avatar
  • 349
1 vote
1 answer
319 views

When I create a text node inside Angular with a sanitized string I unexpectedly got html entities in the output. I commonly sanitize all my input before using it inside the Renderer2. const text = '€£'...
Wilt's user avatar
  • 44.9k
2 votes
0 answers
78 views

Let's consider that I am getting a response (as below) from api Response { embedEmail: "\n<div style='text-align:left'>\n <input \n type=\"email\" \n id=\"...
Angular animal's user avatar
1 vote
0 answers
148 views

I am bit confused about DomSanitizer of Angular. As far as I read it should strip away all the html tags from the input. But Please check the stackblitz attached it doesnt remove all the tags. Am I ...
JSR246's user avatar
  • 11
0 votes
1 answer
1k views

I need help on how to add sanitization to the url and alt text of this code. What is the best way to do this as this is something I'm not very familiar with. I tried researching but not able to find a ...
developer8492's user avatar
0 votes
1 answer
456 views

I am trying to Make an image file display on the Html of ionic(angular) component. The image file is fetched from the device itself and converted to file format for processing. I am using ionic(...
Harsh Sharma's user avatar
1 vote
1 answer
597 views

Is Angular's DomSanitizer just a glorified text-replacer? If it is, I'd like to know if it's feasible to implement my own sanitizer, because the Angular one is replacing special characters like "&...
the_overflowing_stack's user avatar
2 votes
0 answers
310 views

I tried to use DomSanitizer.bypassSecurityTrustHtml, the html content looks as below: <div> <div id="test-div"> It is a test div element. </div> <script> ...
Harpreet's user avatar
  • 1,607
1 vote
2 answers
7k views

Using Angular 13, I have a dynamic URL that loads into an iframe's SRC attribute. I need to sanitize this url (of course) before hand. I tried the following (pseudo code): DomSanitizer.sanitize(...
Steve Rogers's user avatar
  • 1,123
0 votes
1 answer
2k views

I have a simple component, which does not inject the DomSanitizer. Let's say it is export class ExampleComponent { @Input() public safeHtml: SafeHtml | undefined; } How can I use the ...
MojioMS's user avatar
  • 1,703
0 votes
0 answers
171 views

Let's say I have a strings: data = "<style> p { margin-bottom: 0; } ul{ margin-top: 0; } .indent-1{ margin-left: 20px; } .indent-2{ margin-left: 40px; }</style> <ul> <li ...
Ahmad Mansouri's user avatar
0 votes
1 answer
3k views

I'm having this sanitize URL error in Angular, I've seen many solutions, but I've not been able to use them in my scenario, that's why I'm asking the question. Here is my function: @Input() ...
Code Haven's user avatar
0 votes
0 answers
231 views

I'm writing unit tests for a component that uses [innerHTML] to display content from backend. In the browser when the component is loaded, this warning "WARNING: sanitizing HTML stripped some ...
user19294155's user avatar
4 votes
2 answers
6k views

I'm trying to construct an url to pass it inside the src attributes of an iframe. But I always get the exception unsafe value used in a resource URL context and I'm struggling to understand how to ...
ylerjen's user avatar
  • 4,308
0 votes
0 answers
706 views

) I've already spent 4h+ searching the web for this, so I decided to ask the community... What is the exact use case for angular's DomSanitizer.bypassSecurityTrustScript method? I know, that this ...
Markus Windhager's user avatar
0 votes
2 answers
2k views

I am making an angular project and one of my links must redirect to another website. In my dev environment this is a localhost url such as locahost:4210. Because this is an unsafe operation to angular ...
Kevin Heirich's user avatar
1 vote
1 answer
4k views

I need to sanitize an unsafe URL on my site. Trying to use the DomSanitizer's sanitize method, but am getting unexpected results. The docs seem clear that some kind of sanitization should be taking ...
Cam's user avatar
  • 15
1 vote
0 answers
503 views

I am trying to upload an audio file in Angular. The purpose is to be able to reproduce it and do some little work on it such as play,stop, get timestamp of pause marker ecc... I can upload through the ...
angelo de santis's user avatar
0 votes
2 answers
343 views

How to calculate each and every page height from top to bottom in angular ? This syntax work in JavaScript but give error in angular console.log( (document.height !== undefined) ? document.height : ...
Zia Khan's user avatar
  • 471
0 votes
1 answer
3k views

I'm trying to render an image which I have converted to base64 data:image/vnd.microsoft.icon;base64,AAABAAIAICAAA..... Now, whatever I do, I always get { changingThisBreaksApplicationSecurity: '...
Jeanluca Scaljeri's user avatar
0 votes
1 answer
410 views

I have a code where I need to send HTML with inner Html but my code is not passing the security testing it showing Cross-site Scripting (XSS) warning. how to use innerHtml with out Cross-site ...
freelanceing mindset's user avatar
0 votes
2 answers
2k views

Getting XSS vulnerabilities while accessing API call and accessing in HTML page. Tried with DOM sanitizer with url and Sanitized html as well, still getting XSS Cross site scripting issues. Tried with ...
Rajasekhar's user avatar
  • 2,475
1 vote
1 answer
3k views

Getting XSS vulnerabilities while calling the API for fetching the data. So trying to add DOMSANITIZER, but its failing. Tried below code, please suggest me the solution. this.http.get(this....
Rajasekhar's user avatar
  • 2,475
2 votes
1 answer
1k views

I wanted to create a component that handles all YouTube embeded video. However passing the src as a variable will not work at all. No matter what I do. Anyone has an idea what's the problem or is it a ...
webicy's user avatar
  • 1,624
0 votes
1 answer
3k views

I've just updated an application I'm working on from angular 11 to 12. (also updated typscript from 4.0.5 to 4.3.5). We noticed a difference in the application, when before I had an empty value I now ...
JustinZ's user avatar
  • 41
0 votes
2 answers
2k views

I am trying to bind a byte array to an image tag in angular. I know the byte array is correct, because I can download it and view it from my API. I created an image like this: <img [src]="src&...
r3plica's user avatar
  • 13.5k
0 votes
1 answer
1k views

i have a node api(localhost:5000/ ) which returns html type response. when i run localhost:5000/ in browser it execute the scripts from returned response from my api.below is my app.js file. const ...
Jagadeesh's user avatar
  • 2,127
0 votes
1 answer
819 views

I am trying to resolve the checkmarx issue which says application embeds untrusted data in the generated output.This untrusted data is embedded straight into the output without proper sanitization or ...
mohit_basantani's user avatar
0 votes
1 answer
2k views

My application front end uses Angular. I am trying to display an html document (in my case a preview of a document generated using user input data). I can successfully display the Html and inline CSS ...
Dhaneja's user avatar
  • 27
0 votes
1 answer
2k views

Below is the HTML: <a [href]= "message.messagelinkHere ? sanitize(message.messagelinkHere) : message.messagelink" in ts file import { DomSanitizer } from '@angular/platform-browser'; ...
user1498069's user avatar
1 vote
0 answers
568 views

I am working on an angular application, where I am receiving HTML content from API which is created by CKEditor. content includes iframe & other HTML data. I have tried to santize the content ...
Dakshita Sharma's user avatar
0 votes
1 answer
343 views

I'm trying to test my component in which I use a presigned URL to render a PDF file from S3 and then i use a bypassSecurityTrustResourceUrl, and this works well, but just when I'm trying to test this ...
Luis Montes's user avatar
0 votes
2 answers
4k views

I am getting a response from the server in the form of image, which I am accepting as a blob and converting it to image template: <img [src]="imgSrc" alt="Loading...."> ts ...
Stackboi's user avatar
1 vote
0 answers
289 views

I'm using Quill Editor inside an angular project and I need multiline placeholders. Since Quill renders the placeholders via ::before I thought it should be straight forward to implement this, as ...
cloned's user avatar
  • 6,915
0 votes
1 answer
3k views

i am tring to parse images using bypassSecurityTrustResourceUrl but in output I am getting SafeValue must use [property]=binding: data:image/jpeg;base64,(actual data) (see http://g.co/ng/security#xss)...
VJain's user avatar
  • 1,069
-1 votes
1 answer
828 views

I want to build a common class for the frequently used statements in function. and i am getting error if i use this keyword within a function. import {Component} from '@angular/core'; import { ...
VJain's user avatar
  • 1,069
2 votes
1 answer
318 views

I have a recursive Angular template using Pipe for deeply nested array of objects where I have data and children. My problem is it only that when using search function I'm using pipe that highlights ...
Bozhinovski's user avatar
  • 2,986
5 votes
1 answer
3k views

I am using Angular 10. I have a scenario to get html string (value returned by rich text editor) and display it in my Application (using innerHtml). I'll be getting all kinds of styles, like ...
Ganesh's user avatar
  • 1,919
0 votes
1 answer
1k views

I have a mat-table: <ng-container matColumnDef="quantity"> <th mat-header-cell *matHeaderCellDef> Operation </th> <td mat-cell *matCellDef="...
gyozo kudor's user avatar
  • 6,374
0 votes
0 answers
1k views

I am attempting to sanitize a url to use as the data attribute for an object tag to display an svg. my.page.html <object [id]="'chr'+index" [data]="SVGToView[0] | safe" type=&...
Ray Andison's user avatar
0 votes
1 answer
4k views

I'm having a problem where DomSanitizer.bypassSecurityTrustResourceUrl is not working as expected. I have created the following pipe as found in many sources online: import { DomSanitizer, ...
dilemma's user avatar
0 votes
0 answers
43 views

I have application in Angular 9 and use DomSanitazer to build img url. I get error: Not allowed to load local resource: file:///C:/MyApp/Images/uploads/fbf8152f-ccea-45a2-b9a9-150cd4c421a5/mmm_3424....
Robert's user avatar
  • 403
0 votes
1 answer
2k views

I have HTML data stored in a field in my Firebase database, some of which contains <img src='[myImageUrl]'>. When displaying the field in my HTML file, the image has been blocked and I get the ...
Remy Bartolotta's user avatar
0 votes
2 answers
906 views

I need to render a string on the page with double backslash "\\" but Angular removes one from the temaplte, treating it like a regular expression. An example of the issue is here: https://...
Ben Taliadoros's user avatar
1 vote
1 answer
709 views

I am creating a dynamic angular web app and when reading information from my database, whilst I have accommodated html by replacing all occurrences of \n to <br />, angular 8 will just render ...
Mr Man's user avatar
  • 93
0 votes
2 answers
1k views

When I pass a remote url through DomSanitizer, http://localhost:4200 is being prefixed to the url and I get a 404 as a consequence. GET http://localhost:4200/.cs.uic.edu/~i101/SoundFiles/Fanfare60....
Tadhg's user avatar
  • 23
3 votes
2 answers
4k views

Since upgrading my Angular application from version 8 to version 9 I've got a new error appearing when I run my Jest unit test: unsafe value used in a resource URL context (see http://g.co/ng/...
Ewan's user avatar
  • 568