We have a thin client business app, and we are heading to use HTML5 on client side (first only for specific tasks, like some SVG drag'n'drop UI and Canvas image generating).
I know, I can't call a HTML5 page in an iframe on a non-HTML5 page in Internet Explorer, because it will displayed as non-HTML5 page, like its parent.
I tought i can call it to a new window, via javascript.
But it isn't work too.
In the base app there is an
open.window('HTML5.asp','_blank')
function, where the HTML5.asp uses SVG and Canvas. And yes, it's tested, it's works, when called from a HTML5 environment.
There are any solution or workaround to make it work?
Thank you guys!
UPDATE
Thank you for your help, finally i found the mistake.
I've tried to create a simplified code for you, but i couldn't reproduce the bug, so i went over our algorithm again, first block by block, then line by line.
We have a function dictonary, what should be the same in all systems, but it doesn't :)
And i've used a formatting function from there, and the HTML5 page has crased, due to it.
Thank you, again :)
That's quite a coincidence: I was just, by chance, reading about the Google Chrome Frame IE plugin that apparently allows you to use Webkit and the V8 JS engine in IE.
In the web page, we add the tag:
<meta http-equiv="X-UA-Compatible" content="chrome=1" />
(Of course, Chrome Frame needs to be installed. If it's not, perhaps a redirection to an installer might be an option...)
As I said, I just happened to be reading about this a few minutes before I saw your question, so I don't know if this would be of any use to you (nor do I have experience using it).
Good luck!
Related
I've "upgraded" to IE 11 for the browser inside a c# application using the webbrowser control.
When I load my web page into the IE 11 browser natively everything works properly on the map.
When I'm in the c# application everything loads without error except that I can not click on the map and drag it.
All of my map click events will also not fire.
I can use the arrow keys to move the map, and the wheel mouse also works.
I have noticed that when I use IE 11 natively, and use the developer tools with "Break on all exceptions", I get an error in ol3 when its checking if PointerEvent.HAS_BUTTONS is supported, saying Object doesn't support this action.
error is on line 44619 of ol-debug.js, using ol-3.4.0
Note: Yes, I've set the proper registry values for the browser_emulation for both the 32 bit and 64 bit keys for my application name, and the one for the vhost.exe version of the application.
UPDATE:
I should also note that if I use
map.on('click', function(e) {
//do stuff
});
there is nothing fired... However, if I use jquery and do
$(map.getViewport().on('click', function(e) {
//do stuff
});
... then my click events work....
I know this is a bit of a late post, but hopefully it might help others if they stumble across it.
I was in exactly the same boat: using a WebBrowser control with compatibility set to IE11 was causing OpenLayers 3 to ignore mouse button clicks when displaying 2D maps. I tried CefSharp 3, and sure enough it resolves the problem, but there are other reasons why that can't be used for me. After lots of trial and error, I stumbled across this as a workable solution:
<meta http-equiv="X-UA-Compatible" content="IE=11" />
<script>
if (navigator.appVersion.indexOf("MSIE 7.") !== -1)
{
delete window.PointerEvent;
window.navigator.msPointerEnabled = false;
}
</script>
This needs to be on the page before the inclusion of ol.js.
It's a crude test of whether the page is running in a WebBrowser control admittedly, but should suffice now that IE7 is no longer supported. The only real instance of "MSIE 7." in the user agent string will be from a default WebBrowser control.
I've not found any other OpenLayers problems as yet.
So, I decided to roll back to IE10. Everything works in both the native browser and in the WebBrowser control.
IE11 breaks too much stuff, and isn't worth the "upgrade" at this point in time.
I will be checking out CefSharp in the future, just not enough time to put into upcoming release.
I was in the same situation than you a few months ago. The non working mouse events, are just the first symptom. I strongly recommend you to use Chromium for that, because at the end, you are not using an IE11 (Webbrowser control is based on a IE9 kernel), and you just can influence "a bit" how it works, BUT: if you have a complex problem you have no way to really update your browser, to debug, etc.
Chromium works really fine and you can embed it completely in your solution, star it separately to debug or test, and it's based on a modern chrome.
To integrate it on a .net solution, you can use:
https://github.com/cefsharp/CefSharp
Regards
The problem is related to the legacy input model, which is enabled by default for WebBrowser Controls hosted by an application.
To get your OpenLayers3 application working you have to disable it in the registry. To do this you have to set FEATURE_NINPUT_LEGACYMODE to 0 for your application. If this key doesn't exist in your FeatureControl branch, you have to create it manually.
For more information about the legacy input model read this.
I had a lot of issues with ol3 / WebBrowser in winforms, like a lot of features not working well;
After I added this in the HTML header, it was perfect :
<head>
<meta http-equiv="X-UA-Compatible" content="IE=10,chrome=1" />
I know that there already is a question like this: Force IE9 into browser compatibility view
But since adding:
<meta http-equiv="X-UA-Compatible" content="IE=9">
to the the head section and reloading the page with ctrl+F5 didn't help there must be another way.
On my website is also a bxslider and according to this: bxslider not working in IE9 I replaced the elements (which had empty href attribute) with tags - still not effect. The images of the slider are displayed in full size one below the other. After activating compatibility mode the site works perfect.
I don't wanna rebuild my application from the scratch so what could I do to force the compatibility-view? Or is there at least a good free debugging tool for that? I downloaded the firefox addon IE Tab which has a debugbar but to use it you have to buy a premium version. I just don't know what is causing the error...
I found what was causing the error: Why does JavaScript only work after opening developer tools in IE once?
So frustrating and so simple. It was caused by the console.logs in the script. Without them it works like a charm.
If you use this code at the start of your JS (I use it in all my projects) https://gist.githubusercontent.com/elijahmanor/7884984/raw/console-monkey-patch.js it will override the console.log function so you avoid errors in IE but still get logging in modern browsers like chrome.
I need to disable fullscreen message ("you've gone fullscreen") coming on the top when chrome fullscreen mode is activated .
i need to do it through javascript . but it's one of the default functionality of chrome.
can any one help me out ?
It's not possible. As you pointed you it's one of the default functionality of chrome.
and I agree with the comment by mic You can't it's there for security
That message is, if you it can be disabled at all, likely a user preference. I have had my fair share of changing that kind of things for a custom "layer" over windows with an integrated browser and I can tell you it's impossible with javascript without some listener app. We created a C# listener app for that kind of thing that keeps checking a certain text file. We made javascript edit the text file and then let C# work it's hacking magic in some of the user's settings.
You could take a look at Chromium, the stripped down version of Chrome, if that would be of any help ;)
ps: To all the people going mental over changing user settings like that, our customers were old people that were unable to use a computer, and our application's purpose was to do as much as possible for them.
You cannot possibly do that as suggested by these links.
https://superuser.com/questions/398945/disable-the-youve-gone-full-screen-notification-in-chrome
https://groups.google.com/forum/#!topic/chromebook-central/h1crbhOy-7U
On the other note, why exactly would you want to do that?
the site link is http://www.kosfan.com (korean site)
in some web browser (IE 7 and 8), the site suddenly stop and turn off in not only main pages but also other pages.
i have tried to find the reason why it happens, but i cannot.
i thought that possible reasons are javascript error, onload(ready) function and ajax-load something like that.
is there any one who can solve this problem? help me!
thanks :)
I've had similar issues with IE and JQuery - it is definitely bug of the IE browser. You need to go debug the code and find where the crash happens. In my case it was a problem of accessing an element by id in JQuery way. When I replaced $("#id") for document.getElementById it stopped crashing :-)
I have the following javascript being called to request a focus when page is loaded.
This code works 100% OK with Firefox and IE7, but Chrome and Safari do not seem to move the focus at all. How to make it work with all browsers?
document.getElementById("MyFlashFile").focus();
It took me hours searching the Internet, but finally I found a solution that works on the lastest versions of IE, Firefox, Chrome and Safari.
The following code solves the problem for good:
<head>
<script type="text/javascript" src="swfobject.js"></script>
<script>
function setFocusOnFlash() {
var f=swfobject.getObjectById('myFlashObjectId');
if (f) { f.tabIndex = 0; f.focus(); }
}
</script>
</head>
<body onload="setFocusOnFlash()">
This example assumes the flash is embedded using the SWFObject library. If not, you should set the f variable to the Object or Embed tag which holds the flash movie.
Edited on 5 May 2012: Well, unfortunately it seems that the tabIndex workaround no longer works for all combinations of browser (Chrome/Safari) and operating system.
For instance, currently Chrome 18 on Windows fails.
See the link below, provided by Christian Junk, to get the status of the problem's resolution.
Unfortunately there is no way to ensure that you can set focus to a flash file that works in all browsers. IE and Firefox have solved this problem (for the most part), but Chrome and Safari are both based off of Webkit which does not have a solution.
If you ever notice on YouTube or other video / flash site that the first thing you see is something to entice you to click on the player, that is due to this problem.
One developer came up with a clever workaround, but it does involve adding some ActionScript to your flash file, this can be a pain in the ass if you are building a generic player.
Gary Bishop: Fixing Firefox Flash Foolishness
Another sort of solution is to set your wmode to opaque. I've heard this works in some situations, but will screw up cursors in text areas. I haven't had much luck with this either, but you can give it a shot.
You can find more information about the no focus bug on bugzilla.
It seems that there is a bug in Chrome:
"window.document.getElementById('swfID').focus() not working for flash objects"
http://code.google.com/p/chromium/issues/detail?id=27868
I've tried to find a workaround but I was not able to find one ;(
Regards,
Christian
In addition to Cláudio Silva answer , you need to set wmode="opaque"
Ensure this code is being called after the entire page has been rendered. It's probably being called above the HTML it refers to, so the element will not exist yet.
Various JavaScript frameworks have utilities to tell you when the DOM is ready.