skip to main content
research-article

Supporting dynamic, third-party code customizations in JavaScript using aspects

Published:17 October 2010Publication History
Skip Abstract Section

Abstract

Web sites and web browsers have recently evolved into platforms on top of which entire applications are delivered dynamically, mostly as JavaScript source code. This delivery format has sparked extremely enthusiastic efforts to customize both individual web sites and entire browsers in ways the original authors never expected or accommodated. Such customizations take the form of yet more script dynamically injected into the application, and the current idioms to do so exploit arcane JavaScript features and are extremely brittle. In this work, we accept the popularity of extensions and seek better linguistic mechanisms to support them.

We suggest adding to JavaScript aspect-oriented features that allow straightforward and declarative ways for customization code to modify the targeted application. Compared to most prior aspect-related research, our work has a different motivation and a different target programming environment, both of which lead to novel design and implementation techniques. Our aspect weaving is entirely integrated into a new dynamic JIT compiler, which lets us properly handle advice to first-class functions in the presence of arbitrary aliasing, without resorting to whole-program code transformations. Our prototype demonstrates that an aspect-oriented approach to web-application customization is often more efficient than current idioms while simplifying the entire process.

References

  1. }}Adsafe, Nov. 2009. http://www.adsafe.org/.Google ScholarGoogle Scholar
  2. }}J. Aldrich. Open modules: Modular reasoning about advice. In European Conference on Object-Oriented Programming, volume 3586 of Lecture Notes in Computer Science, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. }}P. Avgustinov, A. S. Christensen, L. Hendren, S. Kuzins, J. Lhotak, O. Lhotak, O. de Moor, D. Sereni, G. Sittampalam, and J. Tibble. Optimising AspectJ. In ACM SIGPLAN conference on Programming Language Design and Implementation, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. }}M. Bebenita, F. Brandner, M. Fahndrich, F. Logozzo, W. Schulte, N. Tillmann, and H. Venter. SPUR: A trace-based JIT compiler for CIL. In 25th ACM SIGPLAN conference on Object-Oriented Programming Systems, Languages and Applications, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. }}R. Chugh, J. A. Meister, R. Jhala, and S. Lerner. Staged information flow for JavaScript. In ACM SIGPLAN conference on Programming Language Design and Implementation, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. }}J. Clements. Portable and high-level access to the stack with Continuation Marks. PhD thesis, Northeastern University, 2005.Google ScholarGoogle Scholar
  7. }}J. Clements, A. Sundaram, and D. Herman. Implementing continuation marks in JavaScript. In 9th Scheme and Functional Programming Workshop, 2008.Google ScholarGoogle Scholar
  8. }}D. S. Dantas, D. Walker, G. Washburn, and S. Weirich. AspectML: A polymorphic aspect-oriented functional programming language. ACM Trans. Program. Lang. Syst., 30(3):1--60, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. }}C. Dutchyn, D. B. Tucker, and S. Krishnamurthi. Semantics and scoping of aspects in higher-order languages. Sci. Comput. Program., 63(3):207--239, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. }}ECMA International. ECMAScript language specification, 5th edition, Sept. 2009. http://www.ecmascript.org/.Google ScholarGoogle Scholar
  11. }}U. Erlingsson, B. Livshits, and Y. Xie. End-to-end web application security. In 11th USENIX workshop on Hot topics in Operating Systems, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. }}M. Flatt, G. Yu, R. B. Findler, and M. Felleisen. Adding delimited and composable control to a production programming environment. In 12th ACM SIGPLAN International Conference on Functional Programming, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. }}A. Gal, B. Eich, M. Shaver, D. Anderson, D. Mandelin, M. R. Haghighat, B. Kaplan, G. Hoare, B. Zbarsky, J. Orendorff, J. Ruderman, E. W. Smith, R. Reitmaier, M. Bebenita, M. Chang, and M. Franz. Trace-based just-in-time type specialization for dynamic languages. In ACM SIGPLAN conference on Programming Language Design and Implementation, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. }}G. Kiczales, E. Hilsdale, J. Hugunin, M. Kersten, J. Palm, and W. G. Griswold. An overview of AspectJ. In 15th European Conference on Object-Oriented Programming, 2001. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. }}L. Meyerovich and B. Livshits. ConScript: Specifying and enforcing fine-grained security policies for Javascript in the browser. In IEEE Symposium on Security and Privacy, May 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. }}J. Scott. How many Firefox users use add-ons?, Aug. 2009. http://blog.mozilla.com/addons/2009/08/11/ how-many-firefox-users-use-add-ons/.Google ScholarGoogle Scholar
  17. }}J. M. Siskind and B. A. Pearlmutter. First-class nonstandard interpretations by opening closures. In 34th ACM SIGPLAN-SIGACT symposium on Principles of Programming Languages, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. }}The AspectJ Team. The AspectJ programming guide, 2003. http://www.eclipse.org/aspectj/doc/released/ progguide/index.html.Google ScholarGoogle Scholar
  19. }}The AspectJ Team. The AspectJ 5 development kit developer's notebook, 2005. http://www.eclipse.org/ aspectj/doc/next/adk15notebook/.Google ScholarGoogle Scholar
  20. }}The Caja Team. Caja, Nov. 2009. http://code.google.com/p/google-caja/.Google ScholarGoogle Scholar
  21. }}R. Toledo, P. Leger, and E. Tanter. AspectScript: expressive aspects for the web. In 8th International Conference on Aspect-Oriented Software Development, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. }}D. S. Wallach, A. W. Appel, and E. W. Felten. SAFKASI: a security mechanism for language-based systems. ACM Trans. Softw. Eng. Methodol., 9(4):341--378, 2000. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. }}G. Washburn and S. Weirich. Good advice for type-directed programming: aspect-oriented programming and extensible generic functions. In ACM SIGPLAN Workshop on Generic Programming, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. }}H. Washizaki, A. Kubo, T. Mizumachi, K. Eguchi, Y. Fukazawa, N. Yoshioka, H. Kanuka, T. Kodaka, N. Sugimoto, Y. Nagai, and R. Yamamoto. AOJS: Aspect-oriented JavaScript programming framework for web development. In 8th workshop on Aspects, Components, and Patterns for Infrastructure Software, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Supporting dynamic, third-party code customizations in JavaScript using aspects

    Recommendations

    Comments

    Login options

    Check if you have access through your login credentials or your institution to get full access on this article.

    Sign in

    Full Access

    • Published in

      cover image ACM SIGPLAN Notices
      ACM SIGPLAN Notices  Volume 45, Issue 10
      OOPSLA '10
      October 2010
      957 pages
      ISSN:0362-1340
      EISSN:1558-1160
      DOI:10.1145/1932682
      Issue’s Table of Contents
      • cover image ACM Conferences
        OOPSLA '10: Proceedings of the ACM international conference on Object oriented programming systems languages and applications
        October 2010
        984 pages
        ISBN:9781450302036
        DOI:10.1145/1869459

      Copyright © 2010 ACM

      Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

      Publisher

      Association for Computing Machinery

      New York, NY, United States

      Publication History

      • Published: 17 October 2010

      Check for updates

      Qualifiers

      • research-article

    PDF Format

    View or Download as a PDF file.

    PDF

    eReader

    View online with eReader.

    eReader