greasemonkey/greasemonkey — Issue #1466: Adding an @require breaks Greasemonkey
Author: john-sanders-2
Created: 2011-11-10 20:18:23+00:00
State: open

I'm using Firefox 8.0, Greasemonkey 0.9.12, on Windows 7 (all latest updates).

I've been using a hand rolled Greasemonkey script to update parts of an Intranet page I use all the time. I changed the require tag to use the latest jQuery and the script stopped executing.

After a lot of testing, I've broken the problem down to the smallest parts possible to see if I was doing something wrong. I have:

1. Created a new profile.
2. Installed Greasemonkey, and created a new script for the page.
3. The only code added was: alert('working');
4. Verified the script worked, and it does.
5. Edited the script again (GM icon->manage scripts->edit), and added a require tag to bring in jQuery 1.7 (although any version I've tried causes the same problem). The script fails to run.

My entire script reads as follows (domain name changed):

```javascript
// ==UserScript==
// @name Helper Scripts
// @namespace w
// @include http://example.com/*
// @require http://ajax.googleapis.com/ajax/libs/jquery/1.7.0/jquery.min.js
// ==/UserScript==

alert('working');
```

The script stops working. Does not kick any errors or warnings in the Javascript console. I did notice the config.xml does get updated, but not correctly (i presume). Here's the result of the config.xml after I load the test page:

```xml

```

I'm assuming that the GM adding the tag with the empty filename attribute is messing things up. If you edit the XML directly, and reload, GM will wipe it out and revert it back to an empty attribute again.

I'm perplexed, and would love to have my GM scripts back. Any help would be appreciated.

John Sanders