Silverlight app disappears on page refresh in IE10 - silverlight

UPDATE: There is a workaround to the problem. It is to force IE10 into compatibility mode by including one of the following meta tags:
<meta http-equiv="x-ua-compatible" content="IE=7" />
<meta http-equiv="x-ua-compatible" content="IE=8" />
This is not really a perfect solution for various reasons, but it eliminates the problem at least.
ORIGINAL QUESTION:
I realised a couple of months ago that there is a problem with our Silverlight application in IE10 on Windows 8 (I have not tried the IE10 preview for Windows 7). When the asp.net page hosting our SL app first loads everything works fine and the application loads as expected. If I refresh the page immediately, it also reloads as expected. But: If I focus the Silverlight application by clicking in it and THEN hit F5, it just goes blank. It is like the plugin disappears completely. If I trace the requests using Fiddler I can see that no request is issued for the xap file. I have been hoping that this would be fixed in a patch release for IE10, but so far nothing has changed. I cannot find any information about this when I try googling it. It seems highly unlikely that I should be the first person to discovered it and I am quite surprised that I am not finding more information. To reproduce the issue:
Create a new Silverlight application
Add some sort of content to MainPage.xaml, like a Button or whatever
Run the app in IE10 (on Win8)
Click anywhere within the Silverlight application. This is just to focus the plugin.
Refresh the page (F5)
Result: The Silverlight application does not load and the page is blank.
A few observations:
After the steps above, no amount of refreshing will bring the application back.
After the steps above, if I re-enter the url into the address bar and hit Enter, the application loads as expected.
If I enable Compatibility View in IE, the app also loads as expected. Nothing I do will reproduce the bug when compatibility view is enabled.
Now to my questions:
Has anyone else observed this behaviour?
If so, have you found a workaround?

I'm seeing the same issue with my Silverlight application in IE 10.
I've tried adding the IE 8 compatibility meta tag suggested above, but this does not resolve the problem consistently. It seems to work only intermittently, after say every 5th refresh attempt?!
The only way I can see to work around this consistently is to force the Browser Mode into "IE 10 Compatibility View", and I don't think this can be done via page content (meta tag, etc.)? I've had to remove the IE 8 compatibility meta tag so that the "Compatibility View" button is available in the address bar, and then ask users to click the compatibility button, which is then remembered for the site. This results in the browser entering Browser Mode: "IE 10 Compat View" and Document Mode: "IE7 Standards". The refresh behaviour then works consistently as expected and as it used to.
This is a big problem for us. We've built our Silverlight app such that the browser refresh button is used to refresh pages/content within the app (the users stays logged in, etc.). It's really bad that we have to ask users to set our site to run in compatibility mode for the refresh functionality to work as expected.
Note that this still works as expected in Chrome. It seems silly that we might need to recommend that our users use Chrome because of this issue!
UPDATE:
A workaround for this seems to be to always load the Silverlight object into its hosting page dynamically using JavaScript.
E.g.
function onLoad() {
var silverlightControlHost = document.getElementById("silverlightControlHost");
silverlightControlHost.innerHTML = "<object ...
UPDATE 2:
Here is the latest code I use to work around this issue:
...
function unloadSilverlight() {
document.getElementById("silverlightControlHost").innerHTML = "";
}
function focusOnSilverlight() {
document.getElementById("silverlightObject").focus();
}
function onLoad() {
window.onbeforeunload = unloadSilverlight;
setTimeout(focusOnSilverlight);
}
</script>
</head>
<body onload=" onLoad() ">
...

I still had issues with the solution presented by Chris.
This works perfectly for me though:
window.onbeforeunload = function () {
var silverlightControlHost = document.getElementById("silverlightControlHost");
silverlightControlHost.innerHTML = "";
}

I solved the problem in a very easy way. I Wrote a javascript code at the end of the page (or after the object tag in where is your silverlight app) and set the focus to another element, for example, a link. Example:
<object id="silverlightHostControl">...bla bla bla</object>
<script type="text/javascript" language="javascript">
var shc = document.getElementById("silverlightHostControl");
document.getElementById("myLink").focus();
</script>
The shc var is useless, I put just for clarify. Remember: your javascript code must set the focus to another (but focusable) object AFTER the silverlight app object tag was parsed, which means your js code is writen after silverlight app object.

In answer to your question #1, this is happening with our Silverlight apps as well. The only workarounds are 1) restart the browser or 2) switch to compatibiity mode.
It apparently is a bug in ie10.

Thanks for all workarounds solution but this is obviously a bug with Silverlight plugin.
We have raised few tickets directly with Internet explorer development team and they said the issue is from an external problem. It is not a good answer from Microsoft.
Anyway, this time our developers raised ticket through Silverlight development team which still waiting for their response. To get a good response from them, we need to get more people who are facing this issue.
You can vote this issue from Connect website which is Microsoft's official bug reporting platform.
The link to our ticket is: http://connect.microsoft.com/VisualStudio/feedback/details/789004/ie10-shows-blank-page-upon-refreshing-silverlight-app
Cheers
Moh

Yeah i am also facing same issue with one my application. If i opens help of my application in IE 10 then i have to refresh the page each time to view the contents.
I have two workaround for this issue:
1. Press ALT key once
2. Open IE in compatible mode

Related

Angularjs vs IE 8 vs IE 11

I'm trying to make my web application based on Angularjs work in IE8 and IE11.
After a lot of search, i am asking my question here: is it possible to make an Angularjs application work in IE11? and into IE11 ?
Thanks for advice
I had a problem while loading a angularjs file on IE. It worked perfeclty as expected on Chrome and Firefox but was giving error as angular not defined and what not. After searching on Internet I applied following fix to my code
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
and now it displays the page.
It should work and how you achieve that will depend on the application you are writing. Basically, you have to add extra codes to handle IE8. The AngularJS guide on IE should be a good place to start.
However, there could be situations where you run into problems. For example, when you want to use the "X-UA-Compatible" meta tag. An option could be to use the Google Frame plugin but Google has stopped updates on it from January 2014.
I think your question needs to be more precise about What is wrong with IE11?
I have personally created angularjs applications that works from IE8+ and on all other browsers like chrome, safari, firefox, opera. With all these browsers angular worked just fine.
It is important to mentioned that Microsoft broke the "Internet Explorer" inheritance meaning that internally IE11 is completely different from all other previous versions of IE but being the most advance version of Internet Explorer Angular does not need any particular "adaptation" to work with this browser.
If there is anything you should be worry it is IE8 :) and I am not saying this because of angular but because of IE8 itself.

AngularJS app is not loading on Safari (iOS 5.1.1) back button. Any suggestions?

I've ran into an issue with Safari on iOS 5.1.1 and Angular where I am doing paginated results. After I decide to leave the page that is hosting the app, and then come back to the page by using the browser's history back button.
The application is not initialized so as I scroll again, the pagination functionality is not triggered.
Since 5.1.1 doesn't provide a web inspector, I had to rely on console.log to print events that I want to see that it's executing. On initial load, I see everything ok, but when I am back through the back button nothing fires.
My usual ways of fixing this are not working. Here are the things I've tried:
Used manual bootstrapping of Angular app
Made the page not support caching and expire the page as soon as it's rendered.
Neither of these helped, which is why I am here asking for some suggestions. Unfortunately it's not a very easy thing to replicate through a Fiddle or a hosted HTML file so I am unable to provide one. Hoping that some of you may have experienced this before.
Thanks in advance for any help.
Answer is quite late and I hope you found a solution already but it might be useful for others.
Unfortunately I won't be able to answer why the app is not initialized (due to the lack of code) but I can give you some tools/tips to ease the debugging (assuming you have the iOS simulator).
Debuging on mobile safari can be done either :
with weinre and get the features of the web concole,
or by enabling remote debugging in Mobile Safari itself, see here
Yea, same problem here with iOS 7. It must send the DOM structure over before running any javascript. Kinda pointless...
Since the problem is with mobile safari and since it supports popstate event, you can use this event to detect when the user is back in combination with $location.path(), for example:
$(window).bind("popstate", function () {
alert(location.pathname + $location.path());
});

Silverlight 5 app from iframe not closing in IE9

I am developing a web application using Dojo v1.8 and my target machine runs IE9 and Silverlight 5.1.20125. In this web app, the user can select a tool from a toolbar at the top of the page that will open up in a content pane (or an IFrame if it is an external tool) below the toolbar (only one tool can run at a time).
The bug I am encountering is that one of the external tools that opens in an IFrame runs a Silverlight app, and if the user tries to select another tool, the new tool won't open and the Silverlight application stays there. After checking the DOM Tree, all references to the Silverlight application have been wiped, and the new tool is there instead (which is the desired behavior).
So my question is, why is the Silverlight Application still being viewed even when it is gone from the DOM Tree, and is there a way to programmatically close it from Javascript? Also, I do NOT have access to the source code of the Silverlight Application.
Well I did not manage to solve this issue directly. However, there was another bug that I ran into which involved the java swing library not working on the production machine. The solution was to add the following tag as the first element of head:
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8>
This forces IE to use IE8 instead of IE9. This trick solved this other issue, but inadvertently solved this issue as well. Here are several links that helped lead me to the solution (amongst others):
http://sourceforge.net/p/djproject/discussion/671154/thread/d7662f61
http://msdn.microsoft.com/en-us/ie/ff959805.aspx#_Compatibility_issues_with_1

IBM worklight and Dojo mobile

I am new to IBM worklight.I have created a application using Dojo mobile,Dragged and dropped the widgets into Rich Page Editor but when I run the app or check the result in preview,the widgets are not getting displayed
Technically it shouldn't create any issue unless until something goes wrong, try to open the browser console, there must be something fishy which creating the issue.
If possible share the code to debug the issue otherwise it's tough to provide any pointers without having use case.
Open your mobile app in a JavaScript Debug Environment (Firebug) and look for errors!!!
It could also be possible that the dojo.parser is not running. You can trigger that manually by doing the following:
Configure your application that dojo-parser wont get invoked automatically.
<script type="text/javascript" src="dojo/dojo.js"
data-dojo-config="parseOnLoad: false">
</script>
Trigger parser after dom-ready event got fired.
require(["dojo/parser", "dojo/ready"], function(parser, ready){
ready(function(){
parser.parse();
});
});
In dojo, it won't render in the preview (not correctly if it does). Try to download the Android SDK and run it on the emulator. I have had the same issue with the browser simulator and Dojo mobile in a few apps. I don't use it often, but I haven seen the issue.

Can't exit Salesforce Development Mode

When I have the Development mode enabled for my profile, and I open a custom VisualForce page, the code-editing window/frame appears on the bottom of the screen.
Problem: for 7-8 months now, this window does not disappear when I am done with the custom VF page and go on to strandard pages. It's just sitting there, and displays the code for the original VF page. In addition to that, it's keeping the custom VF's URL up in the address bar of the browser, which interferes with other VF pages which take a use of the URL data.
I have submitted this as an issue to SF Support, who had pounded on it for months, and did not resolve.
Have you experienced this problem before, or know how to fix?
I've had this problem before and found the Development Mode toolbar at the bottom of pages particularly annoying. It doesn't work with some of the Firefox plugins that I use. So, I turned it off.
To edit a page without Development Mode turned on, go to Setup > Develop > Pages (or Apex Classes for controllers).
If you'd rather keep Development Mode on you may want to try updating your browser, or try using a different browser (Internet Explorer, Firefox, Chrome).
You can also use the url parameter
core.apexpages.devmode.url=1
in the address of any VF page to temporarily disable the development Mode toolbar.

Resources