Silverlight Tip of the Day #79 – How to Disable HTML DOM Access from your Silverlight Application.
If you would like to disable your Silverlight application from having access to your browser DOM you can do so through the parameter called EnableHtmlAccess. For example, to disable the access in your HTML page that hosts your Silverlight component you would add this parameter to your Silverlight control in your HTML file:
<param name="enablehtmlaccess" value="false"/>
If your Silverlight application tried to call the following method to set a cookie:
private void SetCookie(string key, string value, double daysToExpire)
{ DateTime expireDate = DateTime.Now + TimeSpan.FromDays(daysToExpire);
string newCookie = key + "=" + value + ";expires=" + expireDate.ToString("R"); HtmlPage.Document.SetProperty("cookie", newCookie);}
You would get this error stating the DOM/scripting bridge is disabled:

Thank you,
--Mike Snow
Subscribe in a reader