I've tried it without the anonymous function, didn't change a thing. Digging further into it, I've now pasted the content of the prototype.js into the script.user.js, however it truly does need heavy modifying. (Actually, when pasting the code, an anonymous function breaks the whole thing again...)
I am not at a point where at least the Prototype code will load and I can use some basic functions, however many other don't seem to work correctly (Ajax, new Element, update, etc). The posting below brought me on the right direction I suppose. Greasemonkey seems to do some funky things to prototypes in general, it is not limited to the Prototype framework. https://mootools.lighthouseapp.com/projects/2706/tickets/149-greasemonkey-support Not sure I can fix this thing at all. :( On 24 Jul., 21:24, qufighter <[email protected]> wrote: > Try:http://mark.biek.org/blog/2009/03/using-prototypejs-with-greasemonkey/http://jimbojw.com/wiki/index.php?title=Using_Prototype_and_Scriptacu... > > I don't think you can do it using require, not exactly sure why, but > you shouldn't need to add an anonymous function wrapper unless you are > using @unwrap (or try pasting the source into your script to avoid re- > download although it may need some modification) > > On Jul 24, 3:11 pm, Robert <[email protected]> wrote: > > > Hello group, > > > I'm trying to include Prototype into a Greasemonkey script, but have > > not been successful so far. > > > Below is the script I'm currently using (basically straight > > fromhttp://wiki.greasespot.net/Code_snippets#jQuery_in_Greasemonkey_scrip... > > ). > > I've tried playing around with the Prototype version, chaning it to > > 1.6.0.2, .1 and .0, and loading it directly from prototypejs.com, and > > also from my own webspace, but no success. > > I also tried to remove the anonymous function around the alert, no > > joy. > > The file is being downloaded into the profiles directory, and there is > > no error message or anything pointing out what is happening. It just > > doesn't work. > > > Interestingly, jQuery seems to work without a problem. > > > Any help appreciated. > > > Robert > > > // ==UserScript== > > // @name Prototype Test > > // @namespace http://localhost/ > > // @description Test Prototype > > // @include http://localhost/* > > // @require > > http://ajax.googleapis.com/ajax/libs/prototype/1.6.0.3/prototype.js > > // ==/UserScript== > > > // Anonymous function wrapper > > (function() { > > alert('echo'); > > > })(); // end anonymous function wrapper --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "greasemonkey-users" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/greasemonkey-users?hl=en -~----------~----~----~----~------~----~------~--~---
