티스토리 뷰

델파이에서 TWebbrowser 콤포넌트를 이용하여 웹 페이지를 보여주려고 했습니다.

그런데, TWebbrowser 콤포넌트를 통해 특정 페이지를 호출하면 Javascript 오류가 연달아 발생하고 해당 웹 페이지가 정상동작 하지 않았습니다.

이 문제는 TWebbrowser 를 통해서 IE7 혹은 IE8 (과거 브라우져) 등 이 실행 되어 브라우져 호환성 때문에 발생한 오류라는 사실을 확인 했습니다.

웹 서핑 결과 아래와 같이 레지스트리에 특정 값을 추가하면 "실행화일 별로 연계되는 브라우져 버전 (IE7, IE8, IE9, IE11 등) 을 선택적으로 지정" 할 수 있습니다.



32/64bit 전용 프로그램

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\MAIN\FeatureControl\FEATURE_BROWSER_EMULATION


64bit OS에서 32bit 프로그램 실행

HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Internet Explorer\MAIN\FeatureControl\FEATURE_BROWSER_EMULATION

 

저는 개인적으로 위 두가지 위치에 레지스트리를 모두 등록한 후에야 원하는대로 실행 되었습니다.

 

마우스 우클릭후 "새로만들기 → DWORD(32비트) 값(D)" 선택

 

ProcessName.exe (제작한 프로그램의 실행화일 명 입력)

 

위 캡쳐이미지 처럼 해당 위치에 새로만들기 선택 하고, 화일명(ProcessName.exe) 을 입력해주면 됩니다.

참고로 DWORD 값에 따라 아래와 같이 브라우져 버전을 지정 할 수 있습니다.

저는 별도로 버전을 지정 할 필요가 없기에 Value 값에 '0' 을 입력하고 문제를 해결 할 수 있었습니다.

값 / 10진수 (16진수) 설명
11001 (0x2EDF) Internet Explorer 11. Webpages are displayed in IE11 edge mode, regardless of the !DOCTYPE directive.
11000 (0x2AF8) IE11. Webpages containing standards-based !DOCTYPE directives are displayed in IE11 edge mode. Default value for IE11.
10001 (0x2AF7) Internet Explorer 10. Webpages are displayed in IE10 Standards mode, regardless of the !DOCTYPE directive.
10000 (0x2710) Internet Explorer 10. Webpages containing standards-based !DOCTYPE directives are displayed in IE10 Standards mode. Default value for Internet Explorer 10.
9999 (0x270F) Windows Internet Explorer 9. Webpages are displayed in IE9 Standards mode, regardless of the !DOCTYPE directive.
9000 (0x2328) Internet Explorer 9. Webpages containing standards-based !DOCTYPE directives are displayed in IE9 mode. Default value for Internet Explorer 9.
8888 (0x22B8) Webpages are displayed in IE8 Standards mode, regardless of the !DOCTYPE directive.
8000 (0x1F40) Webpages containing standards-based !DOCTYPE directives are displayed in IE8 mode. Default value for Internet Explorer 8
7000 (0x1B58) Webpages containing standards-based !DOCTYPE directives are displayed in IE7 Standards mode. Default value for applications hosting the WebBrowser Control.

 


참조링크 : https://stackoverflow.com/questions/17922308/use-latest-version-of-internet-explorer-in-the-webbrowser-control

 

댓글
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크