WPF Internet Sandbox Feature List (XBAPS & Loose XAML)

Two main types of WPF content is sandboxed today:

  • XAML Browser Applications (XBAPs).  XBAPs are online-only ClickOnce applications that are cached & run in the browser.
  • Loose XAML.  Loose XAML are XAML-only files that can be navigated to in the browser.

I’ve gotten questions about the specific feature list for the WPF sandbox.  Below is the high level list.   Other great resources about the sandbox include:

If you’re interested in why something was including/excluding from the sandbox, check the above whitepaper.  If you can’t find an answer here, feel free to post a comment on this blog entry.

V1 Internet Sandbox Features

These features are available in the WPF Internet sandbox:

Category

Features

General

Browser Window
Site of Origin (SOO) Access
IsolatedStorage (512KB Limit)
UIAutomation Providers
Commanding
Input Method Editors (IMEs)
Tablet Stylus/Ink
Simulated drag/drop via MouseCapture/MouseMove
OpenFileDialog
XAML Deserialization (via XamlWriter.Load)

Web Integration

Browser Download Dialog
TopLevel User-Initiated Navigation
mailto:links
URI Parameters
ASMX Web Services
HTTPWebRequest to Site of origin
XBAP/Loose XAML Hosted in IFRAME
Hosting of Site of Origin HTML pages

Visuals

2D/3D
Animations
Media (Site of Origin & Cross Domain)
Imaging/Audio/Video

Reading

FlowDocuments
XPS Documents
Embedded & System Fonts
CFF & TrueType Fonts

Editing

Spell Check
RichTextBox
Plaintext/Ink Clipboard Support
Partial XAML Clipboard Support
User Initiated Paste
Copy of Selected Content

Controls

All basic controls
Popups bound to Window

 

V1 Features Excluded from Internet Sandbox

The features are disabled in the WPF Internet sandbox.  Some these features were excluded from the sandbox for inherent security reasons.  Others were the result of V1 timeline/resource constraints. 

Category

Features

General

Window class (includes app-defined dialogs)
Launching of New Windows
SaveFileDialog
Cross Domain Access
File System & Registry Access
Drag & Drop
XAML Serialization (via XamlWriter.Save)
UI Automation Clients

Web Integration

Windows Communication Foundation (“Indigo”)
Windows Workflow Foundation
Scripting
Document Object Model (DOM) exposure/access

General Integration

HwndHost
Full Speech Support
WindowsForms Interop (“Crossbow”)

Visuals

BitmapEffects
Image Encoding

Editing

RTF Clipboard
Full XAML Clipboard Support

 

Vocabulary/Drill Downs

  • Site of Origin or Same Site Access.
  • Simulated Drag/Drop
    • OLE Drag/Drop is not enabled in V1.
    • App developers can simulate INTRA-app drag/drop using MouseCapture & MouseMove.
  • Browser Download Dialog
    • Browser-specific download dialog shown when navigating to a file whose HTTP header has ’Content-Disposition: Attachment’
    • As SaveFileDialog is not available in V1 sandbox, Browser Download Dialog is possible workaround.
  • IsolatedStorage
    • Data storage mechanism that provides isolation & safety.  (More details.)
    • Place to store data between sessions.
  • Partial XAML Clipboard Support
    • Copy/paste of content between two Internet XBAPs will copy/paste XAML.
    • Copy from a Internet XBAP in to a full trust WPF application will paste plain text.
    • Copy from a full trust WPF application in to an Internet XBAP will paste XAML.
    • Note: this constraint is to prevent escalation of privilege attacks using the clipboard.
  • User Initiated Paste
    • Programmatic paste is disallowed in the sandbox.
    • Only Ctrl-P & Paste Menus (context menu, browser menu) will result in a paste.
  • User Initiated Top Level Navigation
    • A navigation is top level if it is to content external to the application. 
    • Example:  <Hyperlink NavigateUri=”http://foo.com>Link</Hyperlink>
    • A user initiated navigation is a navigation that results from a user click on a <Hyperlink> element.
  • Media (Site of Origin & Cross Domain)
    • Rendering & bits/pixel access to site of origin images/videos/audio.
    • Rendering (but not bits/pixel access) to cross domain images, with below constraints.

19 Comments

  1. Rob Courtney

    Hi, thanks for that. I was asking Rob Relyea for just such a list at TechEd Europe last week. I assume its just a typo, but you’ve got the Controls listed in both the supported and unsupported table. Slighly off topic but it might be usefull to someone, I also found out from Paul Andrew that the WF rules engine can’t run in partial trust and therefore an XBAP.

  2. Karen

    Hi Rob,

    Yes, the controls in both places is a typo (and should most definitely only be in the supported table!).

    You also are correct about WF – I’ll also add that to the table for clarity.

    Thanks for the comments,
    Karen

  3. JohnL

    How does an XBAP handle Assembly.Load()?
    We have an app with alot of plugins, all currently instantiated with Assembly.Load().
    Also, does XBAP download the entire app at once or just as assemblies are referenced?

    Thanks
    JL

  4. Great summary, Karen, as usual!

    Can you confirm how the cross-domain media is supposed to work? Specifically, assume I have an xbap at http://www.foo.com/my.xbap.

    It has an Image inside the Page, with Source=http://www.bar.com/other.jpg.

    Should the Image render? What if it’s a MediaElement instead of an Image? From your chart above, it implies it ought to render, but I wanted to confirm.

    Thanks, Rolf

  5. Karen

    Thanks Rolf. :)

    And yes, you’re absolutely right.

    http://www.foo.com/my.xbap can render<Image Source="http://www.bar.com/other.jpg">. Ditto with MediaElement.

    Thanks,
    Karen

  6. Sam Theisens

    Will communication through WCF (at least to WCF Web Services) from the sandbox be supported in future?

  7. Karen

    Yes, the WCF team is currently investigating supporting partial trust in future versions of the .NET Framework.

  8. Brian

    Under the general sections the following items are listed:

    Available
    XAML Serialization (via XamlWriter.Load)

    Unavailable
    XAML Deserialization (via XamlWriter.Save)

    Are these terms used backwards? Shouldn’t Serialization be with XamlWriter.Save and Deserialization be with XamlWriter.Load?

  9. Under Web Integration it shows that the Browser Download Dialog is enabled under the sandbox. What exactly do I run in the xbap to trigger than?

  10. Rob Relyea posted a version of XamlWriter.Save to http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=718928&SiteID=1

    Since it appears the functionality of XamlWriter.Save can be reproduced in a few hundred lines of code, is there really anything gained by having it disabled in the framework?

  11. Karen

    Brian
    - You’re right. It’s a typo. Thanks for the catch!

    Bryan
    - The browser download dialogs is the dialog shown when a user navigates to a file whose content-diposition is set to attachment. (This is set in the HTTP header.) This is useful for scenarios where you’re trying to content from the server to the user’s machine.

    - Excluding XamlWriter.Save from the sandbox came down to a V1 time constraint. If this is something you feel should be in the sandbox, please add it to the feature wiki (http://channel9.msdn.com/wiki/default.aspx/WPF.FeatureSuggestions) and explain your scenario. We appreciate the feedback!

    Thanks both for the comments!

  12. Thanks for the reply Karen, but what I needed to know is what to do inside the XBAP.

    Turns out the only way to do this is to use a hyperlink object. See http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1212612&SiteID=1

    Do you know of another way to “navigate” that will work?

  13. Karen,

    Myself and another fellow have been unable to load a custom mouse cursor in an xbap. (see: http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1536464&SiteID=1&mode=1)

    Is this also a limitation of XBAPS? It doesn’t seem to be mentioned anywhere.

  14. From http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=2057106&SiteID=1&mode=1

    Is Dispatcher.PushFrame not available in partial trust? If so it’s not documented anywhere. I’m getting pretty sick and tired of finding crap that I can’t do and nobody has bothered to make a note of. I’ve invested alot of time into supporting this new platform just to find out that it’s crippled in unexpected ways that are completely undocumented.

  15. Guy

    Hi keren Really your help about “Loose” “Xbat”
    That work only when IE is closed.

    I post my question here :

    http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=2057135&SiteID=1

    You really help me if you could show me how to solve this problem .

    Thank alot.

    Guy.

  16. Sathish

    Hi,

    I need to prevent copy/paste options in sandbox. Can you please suggest me how it can be done. Also please clarify whether sandbox is applicable only for web environment or it can also be used in the windows.

    Thanks

  17. Sathish

    I am using sandboxie for testing sandboxie environment. But currently its allowing to copy/paste contents. I need to copy/paste within sandboxie but out of that environment, it paste option should be denied. Any suggestions for implementing this will be helpful. Currently copying out of the environment & paste inside is prevented & I need the reverse case also.

Leave a Reply

Your email address will not be published.
Required fields are marked:*

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>