{"issue":{"milestone":null,"user":{"id":45797,"login":"john-sanders-2","url":"https://api.github.com/users/john-sanders-2","avatar_url":"https://secure.gravatar.com/avatar/de3a2504d39df7ed5137e0cc3dee95c1?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"de3a2504d39df7ed5137e0cc3dee95c1"},"title":"Adding an @require breaks Greasemonkey","created_at":"2011-11-10T20:18:23Z","updated_at":"2011-12-19T01:11:54Z","labels":[{"name":"worksforme","url":"https://api.github.com/repos/greasemonkey/greasemonkey/labels/worksforme","color":"f29513"}],"state":"open","id":2202218,"html_url":"https://github.com/greasemonkey/greasemonkey/issues/1466","closed_at":null,"pull_request":{"patch_url":null,"html_url":null,"diff_url":null},"body":"I'm using Firefox 8.0, Greasemonkey 0.9.12, on Windows 7 (all latest updates).\r\n\r\nI'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.\r\n\r\nAfter 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:\r\n\r\n1. Created a new profile.\r\n2. Installed Greasemonkey, and created a new script for the page.\r\n3. The only code added was: alert('working');\r\n4. Verified the script worked, and it does.\r\n5. 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.\r\n\r\nMy entire script reads as follows (domain name changed):\r\n\r\n```javascript\r\n// ==UserScript==\r\n// @name           Helper Scripts\r\n// @namespace      w\r\n// @include        http://example.com/*\r\n// @require        http://ajax.googleapis.com/ajax/libs/jquery/1.7.0/jquery.min.js\r\n// ==/UserScript==\r\n\r\nalert('working');\r\n```\r\n\r\nThe 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:\r\n\r\n```xml\r\n<UserScriptConfig>\r\n\t<Script filename=\"helper_scripts.user.js\" name=\"Helper Scripts\" namespace=\"w\" description=\"\" version=\"\" enabled=\"true\" runAt=\"document-end\" basedir=\"helper_scripts\" modified=\"1320954850701\" dependhash=\"30ee872c576e6e700ef9c9ad7e01f8605a750f52\" updateAvailable=\"\" lastUpdateCheck=\"\">\r\n\t\t<Include>http://example.com/*</Include>\r\n\t\t<Require filename=\"\"/>\r\n\t</Script>\r\n</UserScriptConfig>\r\n```\r\n\r\nI'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.\r\n\r\nI'm perplexed, and would love to have my GM scripts back.  Any help would be appreciated.\r\n\r\nJohn Sanders","number":1466,"url":"https://api.github.com/repos/greasemonkey/greasemonkey/issues/1466","comments":4,"assignee":null},"comment":{"user":{"id":84729,"login":"arantius","url":"https://api.github.com/users/arantius","avatar_url":"https://secure.gravatar.com/avatar/a2055b3cfede02feaa68ee43fe66d6cf?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"a2055b3cfede02feaa68ee43fe66d6cf"},"created_at":"2011-12-19T01:11:54Z","updated_at":"2011-12-19T01:11:54Z","id":3198205,"body":"Interesting!  Thanks for that report, zewt.  What platform are you running vim on that locks files?  On both Linux and Windows (cygwin) I can delete the .swp file.\r\n\r\nThe right fix is probably to find require/resource/icon entries for the old version of the script, and just deleting those files.  Detecting and warning for failure (rather than breaking like this) if even that fails, while we're at it, is probably good too.","url":"https://api.github.com/repos/greasemonkey/greasemonkey/issues/comments/3198205"},"action":"created"}