WPF 4 provides the means for direct communication between an
XBAP and script in the host HTML page (where the XBAP is loaded in an HTML
frame or IFRAME element). The XBAP can get deep access to the HTML DOM,
including to any ActiveX controls embedded in the containing HTML page and
including handling of DOM events.
WPF exposes the main script object from the host frame. This
is a dynamic object that represents the frame’s window object plus any custom
script functions and global variables from script in the HTML page. From it, an
application can invoke script functions directly or “dot into” the HTML DOM.
The functionality is available in partial-trust XBAPs and under all supported
versions of Internet Explorer and Firefox.