29.11.2012 Views

2nd USENIX Conference on Web Application Development ...

2nd USENIX Conference on Web Application Development ...

2nd USENIX Conference on Web Application Development ...

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

ti<strong>on</strong> (e.g. topics inferred from browsing history) via<br />

reference-m<strong>on</strong>itored APIs—but neither plug-ins nor<br />

JS extensi<strong>on</strong>s can guarantee the integrity or security<br />

of the mined data as it flows through the browser.<br />

These projects incur development and maintenance costs<br />

well above the inherent complexity of their added functi<strong>on</strong>ality.<br />

Moreover, patching browser sources makes<br />

it difficult to update the projects for new versi<strong>on</strong>s of<br />

the browsers. This overhead obscures the fact that such<br />

research projects are essentially extensi<strong>on</strong>s to the webbrowsing<br />

experience, and would be much simpler to realize<br />

<strong>on</strong> a flexible platform with more powerful extensi<strong>on</strong><br />

mechanisms. Though existing extensi<strong>on</strong> points in mainstream<br />

browsers vary widely in both design and power,<br />

n<strong>on</strong>e can support the research projects described above.<br />

1.1 The extensible future of web browsers<br />

<strong>Web</strong> browsers have evolved from their beginnings as mere<br />

document viewers into web-applicati<strong>on</strong> runtime platforms.<br />

Applicati<strong>on</strong>s such as Outlook <strong>Web</strong> Access or Google<br />

Documents are sophisticated programs written in HTML,<br />

CSS and JS that use the browser <strong>on</strong>ly for rendering and<br />

executi<strong>on</strong> and ignore everything else browsers provide<br />

(bookmarks, navigati<strong>on</strong>, tab management, etc.). Projects<br />

like Mozilla Prism 3 strip away all the browser “chrome”<br />

while reusing the underlying HTML/CSS/JS implementati<strong>on</strong><br />

(in this case, Gecko), letting webapps run like native<br />

apps, outside of the typical browser. Taken to an extreme,<br />

“traditi<strong>on</strong>al” applicati<strong>on</strong>s such as Firefox or Thunderbird<br />

are written using Gecko’s HTML/CSS/JS engine, and<br />

clearly are not themselves hosted within a browser.<br />

While browsers and web apps are growing closer,<br />

they are still mostly separate with no possibility of<br />

tight, customizable integrati<strong>on</strong> between them. Blogging<br />

clients such as WordPress, instant messaging clients such<br />

as Gchat, and collaborative document editors such as<br />

Mozilla Skywriter are three disjoint web applicati<strong>on</strong>s, all<br />

designed to create and share c<strong>on</strong>tent. An author might be<br />

using all three simultaneously, and searching for relevant<br />

web resources to include as she writes. Yet the <strong>on</strong>ly way<br />

to do so is to “escape the system”, copying and pasting<br />

web c<strong>on</strong>tent via the operating system.<br />

1.2 C<strong>on</strong>tributi<strong>on</strong>s<br />

The time has come to rec<strong>on</strong>sider browser architectures<br />

with a focus <strong>on</strong> extensibility. We present C3: a rec<strong>on</strong>figurable,<br />

extensible implementati<strong>on</strong> of HTML, CSS and<br />

JS designed for web client research and experimentati<strong>on</strong>.<br />

C3 is written entirely in C # and takes advantage of .Net’s<br />

libraries and type-safety. Similar to Firefox building atop<br />

3 http://prism.mozillalabs.com/<br />

2<br />

Gecko, we have built a prototype browser atop C3, using<br />

<strong>on</strong>ly HTML, CSS and JS.<br />

By rec<strong>on</strong>figurable, we mean that each of the modules<br />

in our browser—Document Object Model (DOM) implementati<strong>on</strong>,<br />

HTML parser, JS engine, etc.—is loosely coupled<br />

by narrow, typesafe interfaces and can be replaced<br />

with alternate implementati<strong>on</strong>s compiled separately from<br />

C3 itself. By extensible, we mean that the default implementati<strong>on</strong>s<br />

of the modules support run-time extensi<strong>on</strong>s<br />

that can be systematically introduced to<br />

1. extend the syntax and implementati<strong>on</strong> of HTML<br />

2. transform the DOM when being parsed from HTML<br />

3. extend the UI of the running browser<br />

4. extend the envir<strong>on</strong>ment for executing JS, and<br />

5. transform and modify running JS code.<br />

Compared to existing browsers, C3 introduces novel extensi<strong>on</strong><br />

points (1) and (5), and generalizes existing extensi<strong>on</strong><br />

points (2)–(4). These extensi<strong>on</strong> points are treated in<br />

order in Secti<strong>on</strong> 3. We discuss their functi<strong>on</strong>ality and their<br />

security implicati<strong>on</strong>s with respect to the same-origin policy<br />

[13]. We also provide examples of various extensi<strong>on</strong>s<br />

that we and others have built.<br />

The rest of the paper is structured as follows. Secti<strong>on</strong><br />

2 gives an overview of C3’s architecture and highlights<br />

the software engineering choices made to further<br />

our modularity and extensibility design goals. Secti<strong>on</strong> 3<br />

presents the design rati<strong>on</strong>ale for our extensi<strong>on</strong> points and<br />

discusses their implementati<strong>on</strong>. Secti<strong>on</strong> 4 evaluates the<br />

performance, expressiveness, and security implicati<strong>on</strong>s<br />

of our extensi<strong>on</strong> points. Secti<strong>on</strong> 5 describes future work.<br />

Secti<strong>on</strong> 6 c<strong>on</strong>cludes.<br />

2 C3 architecture and design choices<br />

As a research platform, C3’s explicit design goals are<br />

architectural modularity and flexibility where possible,<br />

instead of raw performance. Supporting the various extensi<strong>on</strong><br />

mechanisms above requires hooks at many levels<br />

of the system. These goals are realized through careful<br />

design and implementati<strong>on</strong> choices. Since many requirements<br />

of an HTML platform are standardized, aspects of<br />

our architecture are necessarily similar to other HTML<br />

implementati<strong>on</strong>s. C3 lacks some of the features present in<br />

mature implementati<strong>on</strong>s, but c<strong>on</strong>tains all of the essential<br />

architectural details of an HTML platform.<br />

C3’s clean-slate implementati<strong>on</strong> presented an opportunity<br />

to leverage modern software engineering tools and<br />

practices. Using a managed language such as C # sidesteps<br />

the headaches of memory management, buffer overruns,<br />

and many of the comm<strong>on</strong> vulnerabilities in producti<strong>on</strong><br />

62 <strong>Web</strong>Apps ’11: <str<strong>on</strong>g>2nd</str<strong>on</strong>g> <str<strong>on</strong>g>USENIX</str<strong>on</strong>g> <str<strong>on</strong>g>C<strong>on</strong>ference</str<strong>on</strong>g> <strong>on</strong> <strong>Web</strong> Applicati<strong>on</strong> <strong>Development</strong> <str<strong>on</strong>g>USENIX</str<strong>on</strong>g> Associati<strong>on</strong>

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!