Using YUI in GreaseMonkey Scripts
Written by on January 3rd, 2007 in Ajax News.
Carlo Zottmann, a Yahoo! engineer in Munich, is a fan of GreaseMonkey and wanted to use YUI in his user scripts.
His article provides a reusable model for how to make use of YUI in the GM script without stomping on any YUI use already on the page:
In this brief article, I’ll share with you my own effort to reach that goal — a Greasemonkey script that adds calls to external JavaScript libraries and CSS files to a given page and, once they are loaded, passes the YAHOO global object to the code inside the Greasemonkey script. (All YUI components reside within this single single global variable, YAHOO — so, for example, you access the YUI Event Utility by referencing YAHOO.util.Event.) I’m sure that this approach is neither the perfect nor the only solution to achieving YUI/Greasemonkey integration, so suggestions and ideas are welcome! Please sound off in the comments and let me know what approaches you’ve taken to this problem in your own projects.
Source: Ajaxian
Original Article: http://ajaxian.com/archives/using-yui-in-greasemonkey-scripts
