Greasemonkey 0.6.4 displays a notification bar on all URLs ending in .user.js, without checking the MIME type. If you hack your .htaccess file to serve a specific .user.js file as text/html, you can include Javascript and your browser will execute it. Greasemonkey will still display its notification bar, which can be detected by the Javascript code because it changes self.innerHeight. The rest is just details.
(Note that this only works in Firefox. The SeaMonkey version of Greasemonkey doesn't display a notification bar, so this hack doesn't work.
detect-greasemonkey.html:
detect-greasemonkey.user.js:
.htaccess:
version 0.1 of 2006-07-11 Copyright (c) 2006, Mark Pilgrim Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.