SWT Browser doesn't use system's default. [message #634315] |
Thu, 21 October 2010 05:02  |
Eclipse User |
|
|
|
I wonder which version of ie are used when I create SWT Browser object,
like below.
Browser ieBrowser = new Browser(parent, SWT.NONE);
I expect that the version of browser be ie8, because ie8 is default
browser of my system, window xp with sp2.
But when I checked out the version using javascript below, I found that
ieBrowser's version is ie7.
------------------------------------------------------------ ------------
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<script>
window.onload = function(){
var _print = document.getElementById('printDiv');
var attr_edit = document.getElementById("myEdit").attributes;
var _innerhtml;
for(var i= 0; i<attr_edit.length; i++){
_innerhtml += ("<br>" + attr_edit[i].nodeName + ", " +
attr_edit[i].nodeValue);
}
_print.innerHTML = _innerhtml;
}
</script>
</head>
<body>
<input type='edit' id='myEdit' name='myEdit' >
<div id='printDiv'></div>
</body>
</html>
------------------------------------------------------------ ----------------
In ie7, browser shows so many attributes which are not coded in input
tag, directly.
Of course, I can force it to parse like ie8 using meta tag - <meta
http-equiv="X-UA-Compatible" content="IE=Edge">
But I'm finding the way to create system's default version of browser.
|
|
|
Re: SWT Browser doesn't use system's default. [message #635054 is a reply to message #634315] |
Mon, 25 October 2010 10:27  |
Eclipse User |
|
|
|
Hi,
The Browser uses whichever embeddable WebBrowser object (this is what IE
embeds) is pointed at in the registry at HKEY_CLASSES_ROOT\Shell.Explorer\.
Now that I try it I see that navigator.userAgent is indicating that IE7's
control is being used on my Vista, even though it has IE8 installed, so I've
logged https://bugs.eclipse.org/bugs/show_bug.cgi?id=328609 to investigate
this. It's possible that IE8 still embeds the IE7 WebBrowser control and
changes its userAgent to "IE8" to reflect other changes that it bolts on top
of it, but it's also possible that the above registry key can no longer be
counted on to point at the newest available WebBrowser version.
Grant
"isungkon" <isungkon@gmail.com> wrote in message
news:i9ovd9$1il$1@news.eclipse.org...
>I wonder which version of ie are used when I create SWT Browser object,
> like below.
>
>
> Browser ieBrowser = new Browser(parent, SWT.NONE);
>
>
> I expect that the version of browser be ie8, because ie8 is default
> browser of my system, window xp with sp2.
>
> But when I checked out the version using javascript below, I found that
> ieBrowser's version is ie7.
>
> ------------------------------------------------------------ ------------
> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
> "http://www.w3.org/TR/html4/loose.dtd">
> <html>
> <head>
> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
> <title>Insert title here</title>
> <script>
>
> window.onload = function(){
> var _print = document.getElementById('printDiv');
> var attr_edit = document.getElementById("myEdit").attributes;
> var _innerhtml;
>
> for(var i= 0; i<attr_edit.length; i++){
> _innerhtml += ("<br>" + attr_edit[i].nodeName + ", " +
> attr_edit[i].nodeValue);
> }
> _print.innerHTML = _innerhtml;
>
> }
>
> </script>
> </head>
> <body>
>
> <input type='edit' id='myEdit' name='myEdit' >
> <div id='printDiv'></div>
> </body>
> </html>
> ------------------------------------------------------------ ----------------
> In ie7, browser shows so many attributes which are not coded in input
> tag, directly.
>
>
>
> Of course, I can force it to parse like ie8 using meta tag - <meta
> http-equiv="X-UA-Compatible" content="IE=Edge">
>
>
> But I'm finding the way to create system's default version of browser.
>
>
|
|
|
Powered by
FUDForum. Page generated in 0.03119 seconds