enable javascript on webbrowser control win ec 7 - c#

this is my first post in here.
I searched all over the web for a solution to this problem, but i have not found nothing.
I only read that Webbrowser haven't much support for javascript in win ec7.
But my first question is:
-Why a web page with javascript works fine in IE in wec7 and doesn't work in a webbrowser on the same platform?
I enabled all script options from the control panel, but it still not works.
How can I make the page works in webbrowser as it works in ie?
Thanks in advance for the help or the tips.
bennaloz

Q.
-Why a web page with javascript works fine in IE in wec7 and doesn't work in a webbrowser on the same platform?
A.
The compact framework has a much smaller Operating System than full blown Windows, otherwise it would be too large to fit on the device.
To make the compact framework smaller, many features that Microsoft could not foresee a use for were left off.
When Windows CE and Windows Mobile were first introduced, not many people were trying to use these devices to look at online content. A web browser was included, but a lot of things in this web browser were also limited (for the same reasons). Therefore, some JavaScript may work while other JavaScript will not.
Nothing is guaranteed to work with JavaScript, though.

Related

"Google Maps API does not support this browser" in WinForms WebBrowser control

As of last week, users have started getting a script error saying "The Google Maps API does not support this browser" when trying to map directions using the Google Maps API from within an embedded WebBrowser control in our application. I have run into issues like this before, but was able to work around them using IE browser emulation. However, it is now erroring no matter which version of IE I have installed, which version I emulate (including IE11), or whether emulation is turned off completely. Prior to last week, this was working correctly, so I'm assuming Google changed something on their side.
Here is an example URL that gets this error: https://www.google.com/maps/dir/?api=1&origin=123+Main+Street,+Dobbs+Ferry,+NY&destination=123+Main+St,+White+Plains,+NY&travelmode=driving
Does anyone know of any fixes or workarounds other than replacing the terrible WinForms WebBrowser control entirely?
I figured out what was wrong after reading this article. When turning on browser emulation, I was enabling it in ...SOFTWARE\WOW6432Node\Microsoft\Internet Explorer... in the registry instead of ...SOFTWARE\Microsoft\Internet Explorer... because I was running on a 64 bit OS. However, you are only supposed to use the WOW6432Node path if you are running a 32 bit application on a 64 bit OS. I changed it to use the other path for a 64 bit application on a 64 bit OS and it now works. Thanks for the help!

How can I scroll through a webpage in the WebBrowser control?

I'm developing an application for Windows CE with Compact Framework 2.5.
The application I'm developing is basically a WebControl. The customer wants the scrollbars hidden (which I have managed), but still wants to be able to scroll through the loaded webpage using the arrow keys on the PDA. However I cannot find a way to control were in the document the WebBrowser currently is?
Does anyone have any ideas? Or a possible alternative to the WebBrowser control, since I have come to the conclusion that the implementation in the Compact Framework is very poor considering the full framework.
Is this a Windows CE or Windows Mobile device?
For windows mobile there are two rendering engines available since AKU 6.1.4: the 'old' PIE and the new IE6 'compatible' engine (http://www.hjgode.de/wp/2013/11/04/windows-mobile-6-internet-explorer-mobile-modes/). The reg key HKLM/security/internet explorer/mshtml value controls the rendering engine used by "Internet Explorer Mobile" (iexplore.exe). The PIE engine display scrollbars by default, the IE6 one not, it can be navigated by the navigation keys. There is a hotfix for compact framework correcting the navigation keys usage: http://support.microsoft.com/kb/975281
If this is a real Windows CE device: if it is a Windows CE 5 based device then there are examples of using the webbrowser control in C/C++ called iesimple etc (AFAIR). Comapct Framework only implements part of the webbrowser API.
It sounds like you are trying to write yet another kiosk mode browser although there are already many out there. Some are device manufacturer dependent, like Intermec Browser, some are usable on generic Windows Mobile devices, like Naurtech Browser (http://www.naurtech.com/products_em.php). These browsers support a bunch of options to control the kiosk mode and usage. I would only write my own kiosk mode browser for simple usage scenarios.
AFAIK there is no way to know from program code, which part of a web page is shown to the user. And it makes no sense to me for a program to know what is currently rendered to the screen. The html and javascript code controls the workflow and data display and change.
There maybe others but the only html engine supporting a SDK beside the MS webbrowser control is ZetaKey. There webkit engine is available for Windows CE/Mobile and they offer a SDK (I do not know there licensing and pricing model). Some open source initiatives have been discontinued, like MiniMo (Mozilla/Firefox).
Please let us know more details about the device and your intention to write your own kiosk mode browser if you need further assistance.

ASP.NET - Issues with position of controls in IE8

recently I've moved on to testing my web aplication in IE8, however, I've noticed that the position of my controls now all over the place. This was not apparent when I was testing my app with IE7 and Firefox 3.5. I know that there is a suggested "fix" for this issue by including
meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7"
into the HTML source, but I think it might be better if I changed my app to natively support IE8, instead of falling back to Compatibility Mode.
All my controls are positioned by offsetting from normal flow, but I've also noticed that even if they are positioned in normal flow or absolutely positioned, the problem still exists.
I'm developing my app entirely in C# as I have much to no knowledge of CSS, but I have no qualms about changing that if that's the path to solving this issue.
Thanks.
Edit: I'm using Visual Studio 2005 btw
Edit: After more forum diving, I found a link to a nice blog entry # http://blogs.msdn.com/ie/archive/2009/03/12/site-compatibility-and-ie8.aspx which lists some quick differences between IE8 Standard View, IE8 Compatibility View and IE7 which might break a site. Hope it helps other people facing similar issues.
If you are building a website, you'll have to use CSS.
This is a good resource for starting with CSS - http://www.w3.org/Style/CSS/learning
Css will allow you to create a website that works for most modern browsers. Here's a good table for matching CSS version and browser version: http://www.quirksmode.org/css/contents.html
However, there are some browsers - notably IE6 - that haven't implemented the CSS guidlines properly. This results in the need for IE6 specific CSS hacks for anything remotely sophisticated.
This is a good strating point for browser hacks:
http://articles.sitepoint.com/article/browser-specific-css-hacks#
Honestly the issue really lies in your markup and CSS rules. IE8 is much more compliant to the W3c CSS standards. So you most likely have had issues with FireFox, Opera, Chrome and Safari you did not know about. The non-IE browsers will not honor your IE7 tag.
My advice is to make your page work in the new browsers, keep things relatively simple so you can make it work in IE 6 and 7. IE 6 really needs to just go away, but alas too many folks wont upgrade. IE 7 honestly needs to be phased out as well.
I have been writing a series I am calling Thin ASP.NET that sort of focuses on doing things in CSS layouts for ASP.NET sites, http://professionalaspnet.com/archive/tags/Thin+ASP/default.aspx
CSS can be rather daunting when you are first beginning using it, personally I like to use a CSS editor. I use Skybound Stylizer (www.skybound.ca). They offer a free basic version, which is really all that you need to begin and to even publish a website, but at only $79 I upgraded to their Ultimate edition to show my support and I am still loving it :)
I suggest checking it out. It will allow you to make changes and see instantly what happens, it also supports the ability to view the page as you would in IE or Firefox with additional support to make it easy to make conditional CSS comments for separate browsers.
Hope this helps,
David.

Building an Internet Explorer Extension/Add-On?

I would like to build a browser extension for IE 7/8. I would like to do it using .NET. Do you know of any resources or tutorials that I could reference to do this? I haven't found much.
Thanks!
JP,
One of the main issues that makes IE extensions hard to develop is the need to develop with C, or .NET.
On the other side, FF and Chrome use (to some extent) JS, which is easier, and has a much lower entrance barrier (How many C "web developers" do you know?).
This is one of the issues / obstacle Crossrider is here to solve.
You can create your first IE plugin within minutes. It will save you a lot of research and development time, and you can write your code with Javascript.
On top of that, if you plan this plugin/extension to also work for browsers other than IE then you can develop a cross browser extension once, using an extensive unified API, and we will make it work for Chrome and Firefox.
Chrome and Firefox each one gets a a native extension file (CRX and XPI respectively) while IE a special EXE engine to run your app.
(Disclaimer: I'm a co-founder of Crossrider)
The same question that was asked two years later has the necessary answer. Everyone should refer to this question now:
How to get started with developing Internet Explorer extensions?

Is it possible to Embed Gecko or Webkit in a Windows Form just like a WebView?

I'd love to know if there is such a thing as a Gecko.NET ;) I mean, just like we can embed a WebView and that is an "instance" of IE7 inside any Windows Forms application (and tell it to navigateto(fancy_url);). I'd love to use Firefox or WebKit.
Anybody tried this?
UPDATE: Please bear in mind that although it is possible to embed Gecko using the mentioned controls, it is still impossible to print while using Gecko.
UPDATE March 2010: It’s still not possible to print natively using GeckoFX, however a couple of methods exist that may be enough, depending upon what you’re trying to do.
See: http://geckofx.org/viewtopic.php?id=796 for more information.
UPDATE October 2013: I am no longer doing Windows development so I have no interest in this, but seems like the development of Gecko can be found here: https://bitbucket.org/geckofx and it seems to be recently updated. Leaving this here for future Windows devs ;)
UPDATE January 2017: I have gotten an email from a company called TeamDev. They created a Chromium-based .NET browser component called "DotNetBrowser" which can be used to display modern web pages in Windows Forms applications.
To quote the email directly:
Here are some details about the component, which might be helpful:
DotNetBrowser is based on Chromium, thus supporting HTML5, CSS3, JS and the latest web standards. The underlying Chromium version of the library is regularly updated.
The component is suitable for WPF as well as Windows Forms desktop applications, and works both for C# and VB.NET.
The library is licensed commercially, however free licences are provided for Open Source and academic projects.
Disclaimer: I have not used this DotNetBrowser for I no longer do Windows Development but may be worth checking if you're looking for a solution to this.
http://code.google.com/p/geckofx/
This is a nice .NET-wrapped version of Gecko
It certainly is possible. All you need to do is register the Mozilla ActiveX control (mozctlx.dll I believe), and you can drag it onto your form as any ActiveX control. The programming interface is similar (though not identical) to the IE one, and you can even use the Microsoft.MSHTML.dll managed library for control in some cases.
I believe this is packaged with Firefox. If not, you can get just the embeddable bits from Mozilla as well. Just do a Google search for Mozilla ActiveX control or Mozilla Embedding C# and that should take you down the right path.
GeckoFX is no longer being updated. The alternative is the MozNet XulRunner wrapper by Se7en Soft. MozNet has a ton of features that GeckoFX doesn't and is being actively updated and maintained.
I'd just like to point out, to all looking to embed Gecko into their applications, that the GeckoFX project appears to have been abandoned by its creators (Skybound Software). MozNET, while previously based on GeckoFX, sorta' picked up the ball and ran with it. It has the full ability to print, do print previews and allows you to set it all up via the native Windows print dialog, even - and a whole lot more.
OpenWebKitSharp is a wrapper arount the WebKit engine (nightly) and is very advanced. Take a look at here (OpenWebKitSharp section): http://code.google.com/p/open-webkit-sharp/
Update 2016:
BrowseEmAll.Gecko
A .Net component which can be used to integrate the Firefox engine into your .Net application. This is based on Geckofx but unlike the current version of Geckofx this will work with a normal release build of Firefox. To use Geckofx you will need to build Firefox yourself. Again commercial support is available but the component itself is fully open source.
(Full disclosure: I work for this company so take everything I say with a grain of salt)
#Martin: Yes, the Adam Locke version is outdated. But that's because a separate distribution is not necessary. It's built with the rest of the Mozilla codebase now.
If you download Prism (ie XulRunner), that will give you a base that you can customize to your needs, and this includes the most recent version of the control (in the \Prism\xulrunner directory, you'll find mozctlx.dll).
#Greg: Actually, it is an ActiveX control. Incidentally, all ActiveX controls are COM controls. ActiveX is built on COM.
As of October 30, 2011, there is new information to add since the time of the previous posts. Specifically, while Skybound stopped maintaining their version, there is at least one actively maintained, free, open-source fork available.
I'm using Hindle's fork at BitBucket, which, by virtue of his tool which parses XpCom idls and creates c# wrappers, is rapidly updated with support for each new version of Firefox/Gecko.
See this post for an overview of other choices.
Additionally, if you find yourself using Gtk instead of Windows.Forms, there is a tarball of webkit-sharp available that allows for easy embedding of WebViews into Gtk# applications.
I Belive "Gecko FX"[1] is the thing you need.
To Quote from the web site
"""
GeckoFX is a Windows Forms control written in clean, commented C# that embeds the Mozilla Gecko browser control in any Windows Forms Application. It also contains a simple class model providing access to the HTML and CSS DOM.
"""
1) I can't post a link as "new users aren't allowed to add hyperlinks" Search for "geckofx" on google code.

Categories

Resources