niska, try to resolve this from 2 angles: Number 1, can you provide more specific details about why it doesn't work as a content script? What error message are you getting?
Number 2, you can add a STAR to the following issue for "Implement @require for user scripts": http://code.google.com/p/chromium/issues/detail?id=19173 On Dec 11, 1:06 am, Evgeny Shadchnev <[email protected]> wrote: > No, it isn't. However, you can include jQuery in the extension and > it'll work fine. > > Evgeny > InvisibleHand > > > > On Fri, Dec 11, 2009 at 9:04 AM, niska <[email protected]> wrote: > > > I've tried using content scripts. But I get a error message. Isn't it > > possible to include external javascripts? > > > My code: > > > "js": ["http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/ > > jquery.min.js", "myscript.js"] > > > On 10 Dec, 21:13, Aaron Boodman <[email protected]> wrote: > >> You can do something similar to @require by listing multiple scripts > >> in the content script declaration. So like: > > >> ... > >> "content_scripts": [ > >> { > >> "matches": [...], > >> "js": ["jQuery.js", "myscript.js"] > >> } > >> ] > >> ... > > >> For more information, see: > > >>http://code.google.com/chrome/extensions/content_scripts.html > > >> - a > > >> On Thu, Dec 10, 2009 at 10:51 AM, PhistucK <[email protected]> wrote: > >> > I guess that if you replace the require with some kind of > >> > document.write("<scri+"pt src=\"http://blabla/jquery.js\"><"+"/script>") > >> > or something like that (and maybe put a setTimeout, or an event listener > >> > if > >> > jQuery creates an event once it is loaded), you will have your jQuery. > >> > No? > >> > Or, put the entire jQuery file contents at the beginning of your > >> > UserScript! > >> > sucks but should work. > >> > ☆PhistucK > > >> > On Thu, Dec 10, 2009 at 21:45, Pedro Junior <[email protected]> > >> > wrote: > > >> >> Maybe Content Scripts will serve for you: > >> >>http://code.google.com/chrome/extensions/content_scripts.html > > >> >> ----- Original Message ----- > >> >> From: "niska" <[email protected]> > >> >> To: "Chromium-extensions" <[email protected]> > >> >> Sent: Thursday, December 10, 2009 5:35 AM > >> >> Subject: [chromium-extensions] Transform a Greasemonkey userscript into > >> >> a > >> >> Chrome extension > > >> >> > I've got a *really* simple userscript (think Hallo World). But I'm > >> >> > unable to run it in chrome, since chrome doesn't support @require. And > >> >> > my userscript requires jquery to run. > > >> >> > According to the Chrome docs, @require won't be implemented - since it > >> >> > is already implemented in extensions. > > >> >> > The only problem is that I have never build a Chrome extension. > > >> >> > What do I need to transform a "hello world"-userscript that uses > >> >> > jquery, into a Chrome extension? > > >> >> > -- > > >> >> > You received this message because you are subscribed to the Google > >> >> > Groups "Chromium-extensions" 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/chromium-extensions?hl=en. > > >> >> -- > > >> >> You received this message because you are subscribed to the Google > >> >> Groups > >> >> "Chromium-extensions" 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/chromium-extensions?hl=en. > > >> > -- > > >> > You received this message because you are subscribed to the Google Groups > >> > "Chromium-extensions" 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/chromium-extensions?hl=en. > > > -- > > > You received this message because you are subscribed to the Google Groups > > "Chromium-extensions" 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 > > athttp://groups.google.com/group/chromium-extensions?hl=en. -- You received this message because you are subscribed to the Google Groups "Chromium-extensions" 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/chromium-extensions?hl=en.
