2017-11-30 4 views
0

각도 응용 프로그램을 작성 중입니다. 세션 관리를 위해 나는 OpenID Connect 세션 관리를 사용하고 있으며 iframe을 주입하려고합니다. 나는iframe in index.html 각도 2/4

<!doctype html> 
<html> 

<head> 
    <meta charset="utf-8"> 
    <title> Application </title> 
    <base href="/"> 
    <meta name="viewport" content="width=device-width, initial-scale=1"> 
</head> 

<body> 
    <iframe src="./session.html" id="rp_session_iframe" width="0" 
    height="0"></iframe> 
    <div id="app-loader" class="app-loader"></div> 
    <app-root></app-root> 
</body> 
</html> 

로 된 index.html에서 iframe이와 (index.html을 같은 위치)에 session.html의 내용을 포함

<!DOCTYPE html> 
<html> 
<head> 
    <meta charset="utf-8"> 
    <title>iFrame RP Page</title> 
    <script> 
     window.onload = function() 
     { 
      window.parent.alert('iframesomething'); 
     } 

    </script> 
</head> 
<body> 
</body> 
</html> 

처럼 보이는해야하지만 난 어떤을 볼 수 아니다 내 화면에 경고. 난 내 소스를 oberserve 경우 그리고 난 내가 뭘 잘못

enter image description here

처럼 보이는 iframe을의 재귀 주사를 볼 수 있습니까? 도와주세요.

답변

0

속성 값, 속성, 스타일, 클래스 바인딩 또는 보간을 통해 값 (여러분의 경우 script 태그)이 템플리트에서 DOM으로 삽입 될 때 각도 값은 신뢰할 수없는 값을 위조하고 이스케이프합니다. 자신의 documentation in security section에 명시된대로 기본적으로 신뢰할 수 없습니다.

DomSanitizer를 사용하여 신뢰할 수있는 값을 수동으로 설정할 수 있지만 구현 방법에 대한 자세한 내용은 here을 참조하십시오.

희망, 좋은 하루 보내세요. :)

+0

예,하지만 구성 요소에없는 경우 어디에서 위생 처리가됩니까? html은 iframe을 추가하려고하는데 루트 index.html입니다. –