C3: an Experimental, Extensible, Reconfigurable Platform for HTML

C3: an Experimental, Extensible, Reconfigurable Platform for HTML

C3: An Experimental, Extensible, Reconfigurable Platform for HTML-based Applications Benjamin S. Lerner Brian Burg Herman Venter Wolfram Schulte University of Washington Microsoft Research Abstract and sprawling C/C++ code—and this requirement of deep domain knowledge poses a high barrier to entry, correct- The common conception of a (client-side) web applica- ness, and adoption of research results. tion is some collection of HTML, CSS and JavaScript Of course, this is a simplified depiction: browsers are (JS) that is hosted within a web browser and that interacts not entirely monolithic. Modern web browsers, such with the user in some non-trivial ways. The common as Internet Explorer, Firefox or Chrome, support exten- conception of a web browser is a monolithic program sions, pieces of code—usually a mix of HTML, CSS and that can render HTML, execute JS, and gives the user a JavaScript (JS)—that are written by third-party develop- portal to navigate the web. Both of these are misconcep- ers and downloaded by end users, that build on top of the tions: nothing inherently confines webapps to a browser’s browser and customize it dynamically at runtime.1 To page-navigation idiom, and browsers can do far more date, such customizations focus primarily on modifying than merely render content. Indeed, browsers and web the user interfaces of browsers. (Browsers also support apps are converging in functionality, but their underlying plug-ins, binary components that provide functionality, technologies are so far largely distinct. such as playing new multimedia file types, not otherwise We present C3, an implementation of the available from the base browser. Unlike extensions, plug- HTML/CSS/JS platform designed for web-client ins cannot interact directly with each other or extend each research and experimentation. C3’s typesafe, modular other further.) architecture lowers the barrier to webapp and browser Extensions are widely popular among both users and extensibil- research. Additionally, C3 explores the role of developers: millions of Firefox users have downloaded ity throughout the web platform for customization and thousands of different extensions over two billion times2. research efforts, by introducing novel extension points Some research projects have used extensions to imple- and generalizing existing ones. We discuss and evaluate ment their ideas. But because current extension mecha- C3’s design choices for flexibility, and provide examples nisms have limited power and flexibility, many research of various extensions that we and others have built. projects still must resort to patching browser sources: 1. XML3D [14] defines new HTML tags and renders 1 Introduction them with a 3D ray-tracing engine—but neither HTML nor the layout algorithm are extensible. We spend vast amounts of time using web browsers: ca- sual users view them as portals to the web, while power 2. Maverick [12] permits writing device drivers in JS users enjoy them as flexible, sophisticated tools with and connecting the devices (e.g., webcams, USB countless uses. Researchers of all stripes view browsers thumb drives, GPUs, etc.) to web pages—but JS and the web itself as systems worthy of study: browsers cannot send raw USB packets to the USB root hub. are a common thread for web-related research in fields 3. RePriv [5] experiments with new ways to securely such as HCI, security, information retrieval, sociology, expose and interact with private browsing informa- software engineering, and systems research. Yet today’s production-quality browsers are all monolithic, complex 1Opera supports widgets, which do not interact with the browser or systems that do not lend themselves to easy experimenta- content, and Safari recently added small but slowly-growing support for extensions in a manner similar to Chrome. We ignore these browsers in tion. Instead, researchers often must modify the source the following discussions. code of the browsers—usually tightly-optimized, obscure, 2https://addons.mozilla.org/en-US/statistics/ 1 tion (e.g. topics inferred from browsing history) via Gecko, we have built a prototype browser atop C3, using reference-monitored APIs—but neither plug-ins nor only HTML, CSS and JS. JS extensions can guarantee the integrity or security By reconfigurable, we mean that each of the modules of the mined data as it flows through the browser. in our browser—Document Object Model (DOM) imple- mentation, HTML parser, JS engine, etc.—is loosely cou- These projects incur development and maintenance costs pled by narrow, typesafe interfaces and can be replaced well above the inherent complexity of their added func- with alternate implementations compiled separately from tionality. Moreover, patching browser sources makes C3 itself. By extensible, we mean that the default imple- it difficult to update the projects for new versions of mentations of the modules support run-time extensions the browsers. This overhead obscures the fact that such that can be systematically introduced to research projects are essentially extensions to the web- browsing experience, and would be much simpler to real- 1. extend the syntax and implementation of HTML ize on a flexible platform with more powerful extension 2. transform the DOM when being parsed from HTML mechanisms. Though existing extension points in main- stream browsers vary widely in both design and power, 3. extend the UI of the running browser none can support the research projects described above. 4. extend the environment for executing JS, and 1.1 The extensible future of web browsers 5. transform and modify running JS code. Web browsers have evolved from their beginnings as mere Compared to existing browsers, C3 introduces novel ex- document viewers into web-application runtime platforms. tension points (1) and (5), and generalizes existing exten- Applications such as Outlook Web Access or Google sion points (2)–(4). These extension points are treated in Documents are sophisticated programs written in HTML, order in Section 3. We discuss their functionality and their CSS and JS that use the browser only for rendering and security implications with respect to the same-origin pol- execution and ignore everything else browsers provide icy [13]. We also provide examples of various extensions (bookmarks, navigation, tab management, etc.). Projects that we and others have built. like Mozilla Prism3 strip away all the browser “chrome” The rest of the paper is structured as follows. Sec- while reusing the underlying HTML/CSS/JS implementa- tion 2 gives an overview of C3’s architecture and high- tion (in this case, Gecko), letting webapps run like native lights the software engineering choices made to further apps, outside of the typical browser. Taken to an extreme, our modularity and extensibility design goals. Section 3 “traditional” applications such as Firefox or Thunderbird presents the design rationale for our extension points and are written using Gecko’s HTML/CSS/JS engine, and discusses their implementation. Section 4 evaluates the clearly are not themselves hosted within a browser. performance, expressiveness, and security implications While browsers and web apps are growing closer, of our extension points. Section 5 describes future work. they are still mostly separate with no possibility of Section 6 concludes. tight, customizable integration between them. Blogging clients such as WordPress, instant messaging clients such as Gchat, and collaborative document editors such as 2 C3 architecture and design choices Mozilla Skywriter are three disjoint web applications, all As a research platform, C3’s explicit design goals are designed to create and share content. An author might be architectural modularity and flexibility where possible, using all three simultaneously, and searching for relevant instead of raw performance. Supporting the various ex- web resources to include as she writes. Yet the only way tension mechanisms above requires hooks at many levels to do so is to “escape the system”, copying and pasting of the system. These goals are realized through careful web content via the operating system. design and implementation choices. Since many require- ments of an HTML platform are standardized, aspects of 1.2 Contributions our architecture are necessarily similar to other HTML implementations. C3 lacks some of the features present in The time has come to reconsider browser architectures mature implementations, but contains all of the essential with a focus on extensibility. We present C3: a reconfig- architectural details of an HTML platform. urable, extensible implementation of HTML, CSS and C3’s clean-slate implementation presented an opportu- JS designed for web client research and experimentation. nity to leverage modern software engineering tools and C3 is written entirely in C# and takes advantage of .Net’s practices. Using a managed language such as C# sidesteps libraries and type-safety. Similar to Firefox building atop the headaches of memory management, buffer overruns, 3http://prism.mozillalabs.com/ and many of the common vulnerabilities in production 2 Assembly frontend, or JS engine without modifying the DOM im- JS Engine Class plementation or layout algorithm. To make such drop-in Interface replacements feasible, C3 shares no data structures be- Communication DOM implementation Implementation tween modules when possible (i.e., each module is heap- IHtmlParser Threads disjoint). This design decision also simplifies threading Event loop HtmlParser disciplines, and is further discussed in Section

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    13 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us