Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » SWT Browser doesn't use system's default.
SWT Browser doesn't use system's default. [message #634315] Thu, 21 October 2010 09:02 Go to next message
gon  is currently offline gon Friend
Messages: 1
Registered: October 2010
Junior Member
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 14:27 Go to previous message
Grant Gayed is currently offline Grant GayedFriend
Messages: 2151
Registered: July 2009
Senior Member
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.
>
>
Previous Topic:Hide an SWT composite
Next Topic:set proxy for swt browser need user and pass?
Goto Forum:
  


Current Time: Thu Aug 22 04:33:01 GMT 2019

Powered by FUDForum. Page generated in 0.03583 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top