0

I'm working on some Google Chrome user scripts and now I'd like to make them work on other browsers too.

That means Greasemonkey compatibility for Firefox, I think I've heard Opera has some support too, and if it's possible to support Safari and Explorer too, all in one script that would be great.

But I have one problem. I'm loading jQuery into my script and sometimes other libraries or dependencies, such as jQuery UI. This seems tricky to get right just for one browser. Is there some snippet / framework / pattern floating around that can do this for all browsers that support a version of Greasemonkey user scripts?


I had been using this "Multiple-dependancy Chrome-friendly userscript pattern" by Brian Schweitzer but it turns out that it has some flaw which when I use it on Stack Exchange, prevents the post editing toolbar and previews from appearing, so I'm looking for alternatives.

3
  • At first glance, that pattern doesn't appear to be using noConflict correctly for sites that already use jQuery. Sep 27, 2012 at 16:57
  • @BrockAdams: Could you expand on the difference between using noConflict correctly and how it's being used in the pattern? Sep 27, 2012 at 17:01
  • 1
    Maybe later, if I decide to answer this question. Also, I just glanced at that script; I may be wrong (but don't think so). The comment was just to hint at what you should search for, possible bug-wise. Sep 27, 2012 at 17:05

1 Answer 1

4

While I work at Crossrider, and my opinion might be a bit biased - From what you're describing, I think Crossrider's framework would be useful for you. You can develop with jQuery natively, and your code would work on all major browsers (Chrome, Firefox, IE and Safari).

It would save you a lot of hassle of "getting it right" on each browser.

3
  • Does the user have to install Crossrider or does it produce stand-alone extensions? I am interested in browser extensions too but for this question I wanted to ask about their lesser cousins, the user scripts. Sep 29, 2012 at 15:49
  • 2
    @hippietrail Crossrider will generate you a different native extension for each one of the browsers. EXE installer for Internet Explorer, CRX for Chrome, XPI for Firefox and Safarixtz for Safari. You can also customise the windows installer to bundle all of those files into one installer that will install for all.
    – gkof
    Sep 29, 2012 at 20:00
  • But he meant as a userscript to an extension. Does crossrider do userscripts?
    – Vik
    Jul 28, 2015 at 19:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.