none
Browser Launch

    Question

  • Hi,

    I`m using HtmlPage.Window.Navigate to launch a web browser from my Silverlight Sidebar Gadget.

    Unfortunately this is not respecting the default browser setting in the operating system.  Tested with FF as my default, but IE opens.

    Are there any alternative browser launch options that will respect the default browser of the OS?  I get quite a few complaints about this!

    Thanks

    Fraser

    Tuesday, November 25, 2008 8:54 AM

Answers

  • Its probably more a SideBar issue rather than a Silverlight issue - but it would be nice to have the option to natively respect the default when launching a browser from a Silverlight Gadget.

    In the meantime, for others with similar issues, I had to resort to the JavaScript Beast using the following in the containing Java-script:

    function openBrowser(link)
    {
     window.location.href = link;
    }

    Then invoking it from the Silverlight code:

    HtmlPage.Window.Invoke("openBrowser", "http://www.dailysnooze.com");

    That call respects browser defaults.

    Tuesday, November 25, 2008 10:26 AM

All replies

  • actually, it should keep the browser context.  if your app calls window.navigate with "_blank" in IE, it'll open a new IE window.  in FF, a new tab.  at least thats the experience i'm having, which i would expect.

     can we see your navigate call?

    Tuesday, November 25, 2008 9:05 AM
  • Hi - just to double confirm, did you see the bit about this running as a Sidebar Gadget?  The problem is probably exactly that - its keeping the browser context! :-)

    The exact call I`m using:

    HtmlPage.Window.Navigate(new Uri(http://www.dailysnooze.com), "_blank", "toolbar=1,titlebar=1,status=1,resizable=1,scrollbars=1,menubar=1,top=40,left=40");

    Cheers

    Fraser

    Tuesday, November 25, 2008 9:16 AM
  •  yeah, if your gadget is running in IE, it'll open the window in IE.  if its running in FF, it'll open the window in FF.  window.navigate is essentially like clicking a hyperlink.  just like when you're viewing a straight html page and you click a link, it only opens windows for the browser you're using.  i doubt that will ever change.

    Tuesday, November 25, 2008 10:02 AM
  • Its probably more a SideBar issue rather than a Silverlight issue - but it would be nice to have the option to natively respect the default when launching a browser from a Silverlight Gadget.

    In the meantime, for others with similar issues, I had to resort to the JavaScript Beast using the following in the containing Java-script:

    function openBrowser(link)
    {
     window.location.href = link;
    }

    Then invoking it from the Silverlight code:

    HtmlPage.Window.Invoke("openBrowser", "http://www.dailysnooze.com");

    That call respects browser defaults.

    Tuesday, November 25, 2008 10:26 AM