问题
Is there any way to load my silverlight app in F11 mode directly? I have used
window.open(url, '_self',
'toolbar=no,status=no,location=no,menubar=no,resizable=yes,scrollbars=no,fullscreen=yes',
'true');
HtmlPage.window.invoke("launchPage",url);
But the problem is that two instances of my app are opened. One in normal screen and the other in fullscreen.
I have tried
App.Current.Host.Content.IsFullScreen = true;
in the constructor of the App.xaml
Still its not working. :( Where am I going wrong??
回答1:
running a Silverlight application automatically in full-screen is not possible because of security restriction. It is like the following...
- You have opened your banks login page in a Firefox tab. This is your current tab.
- You are opening a malicious silverlight application on another tab.
- The malicious silverlight application loads and creates a full-screen that exactly matches your bank's login page.
- You are talking to someone while the silverlight application loads. (Your eye is not on screen) So you missed the fullscreen message that pops up.
- Now when you look at the computer screen you see your bank login page that is actually a fullscreen page of the silverlight application that matches your bank's login page.
- You enter your user name and password...and
- When you click login the malicious application has got everything it wanted.
This is not only for Silverlight. It is a restriction that SHOULD BE THERE WITH EVERY ACTIVEX CONTROL UNTIL THIS PROBLEM IS SOLVED.
What you are doing with javascript is you are opening a new pop up window without menubar, addressbar etc. It is not a replacement of F11. And to my experience most of the users hate automatic poping up. And most modern browsers will block them anyway.
The best way is to tell the user she needs to view your application on fullscreen and LET HER DECIDE INSTEAD OF FORCING IT.
来源:https://stackoverflow.com/questions/1164078/to-view-the-silverlight-app-in-fullscreen-modef11