I was able to get it to work, but there are other smaller problems.
Here's what worked:
// ==UserScript==
// @name Dialog Test
// @namespace
http://strd6.com// @description jquery-ui-1.6rc6 Dialog Test
// @include *
//
// @resource jQuery
http://ajax.googleapis.com/ajax/libs/jquery/1.3.1/jquery.min.js// @resource jQueryUI
http://strd6.com/stuff/jqui/jquery-ui-personalized-1.6rc6.min.js// ==/UserScript==
// Inject jQuery into page... gross hack... for now...
(function() {
var head = document.getElementsByTagName('head')[0];
var script = document.createElement('script');
script.type = 'text/javascript';
var jQuery = GM_getResourceText('jQuery');
var jQueryUI = GM_getResourceText('jQueryUI');
script.innerHTML = jQuery + jQueryUI;
head.appendChild(script);
$ = unsafeWindow.$;
})();
$(document).ready(function() {
$('<div title="Test">SomeText</div>').dialog();
});
The problems I'm having now stem from $ being in the unsafeWindow
context, so I can't call certain GM methods from the unsafe context
(like inside $.each). I can 'learn to deal', but there's got to be a
way to get to the root of this and have jQueryUI work from within
Greasemonkey. Maybe in a couple of weeks when I'm more familiar with
both jQuery and GM I'll be able to go in and patch it. I'm now also
90% certain that it's an XPCNativeWrapper issue, so there should be an
simple workaround by changing some code in the dialog plugin.