2012-08-17 4 views
0

금지 된 URL에 대한 액세스를 거부하는 BHO를 개발 중입니다. 그래서 일부 대상 URL을 찾으면 탐색을 취소하고 다른 denied.html에 iframe을 엽니 다. 그러나 어떤 이유로이 iframe의 높이가 100 %가 아닙니다. 그것은 페이지의 20 %처럼 보입니다. iframe에서 작성하는 코드는 다음과 같습니다 제가 테스트 목적 live.com을 사용하고높이가 100 %가 아닌 이유는 무엇입니까?

if pos('live.com', URL) > 0 then 
    begin 
     Cancel:= true; 
     Document:= IE.Document as IHTMLDocument2; 
     Document.body.innerHTML:= ''; 
     Document.body.style.height:= '100%'; 
     iFrame:= Document.createElement('iframe'); 
     iFrame.setAttribute('src', 'denied.html', 0); 
     iFrame.setAttribute('position', 'absolute', 0); 
     iFrame.style.height:= '100%'; 
     iFrame.style.width:= '100%'; 
     iFrame.style.left:= '0px'; 
     iFrame.style.top:= '0px'; 
     iFrame.style.border:= '0px'; 
     (Document.body as IHTMLDomNode).appendChild(iFrame as IHTMLDomNode); 
    end; 

. 및 라인 : 이미 html로 100 % 높이에 있지 않기 때문에이 문제가 어쩌면 것을 인터넷에서 읽은, 내가 시험을했지만 작동하지 계속 때문에

Document.body.style.height:= '100%'; 

이다. 누군가 나를위한 해결책이 있습니까 ??

+0

SIDE 참고 : 사이트가 foobarlive.com 인 경우, 여전히 통과 할 것인가? – epascarello

+0

'iframe'오버레이 대신 리디렉션을 사용하는 것이 더 나을 것이라고 생각합니다. 'iframe'은 아마'body'와'html' 엘리먼트의 높이를 취합니다; 'min-height : 100 %;를 설정하면 IE에서 작동하지 않을 수도 있습니다. –

답변

0

를 설정 HTML과 몸 100 % 모두

html, body { height : 100% } 
+0

나는 이것이 min-height : 100 %를 요구할 것이라고 생각했지만, 틀릴 수도있다. IE의 모든 "지원 가능한"버전이 해당 속성을 지원하는지 확실하지 않습니다. –

+0

IHTMLDocument2에서이 작업을 수행하는 방법 ?? 도울 수 있니? – HwTrap

관련 문제