Opera support for greasemonkey scripts

in Userscripts.org discussion
Subscribe to Opera support for greasemonkey scripts 19 posts, 10 voices



jesus2099 Scriptwright

Hello,

I think it should be stated somewhere on this website what browsers and plugins support greasemonkey or at least a link to more information…

It took me several minutes to find out that my browser, Opera, has support for it : http://www.opera.com/support/tutorials/userjs/e...

Opera recognizes *.user.js and understands the specific greasemonkey syntax, including ==UserScript==.

Thanks for the great website.

 
LouCypher Scriptwright
understands the specific greasemonkey syntax

No. Opera doesn't recognize Greasemonkey APIs.

 
Mortimer Scriptwright

Opera supports userscripts (I might say something wrong, but they "introduced" the technology I think) but has a different javascript interpretor than firefox and as LouCypher says doesn't suppose GM APIs. Because of that, many userscripts made for Greasemonkey+Firefox will not be compatible (but you can still try).

For the GM API problem, you can use this: http://userjs.org/scripts/browser/enhancements/... to simulate most of the functions, but it's not perfect (in particular, there is no cross site request possible).

For the missing javascript:
- some array functions are missing and you can add them by making a file in your userscript folder containing the functions given here: http://snippets.dzone.com/posts/show/718 this will augment the compatibility of some GM scripts
- more complex GM scripts, using E4X and javascript 1.7 syntax etc... won't work probably... but often there are solutions to use compatible javascript. Try to fix them, or ask the developer.

 
jesus2099 Scriptwright

Thank you for your complete information Mortimer :)
Like I said, shouldn't there be a FAQ somewhere saying this ?

 
Descriptor Scriptwright

It really should be on Opera's site, I searched all over for info on this and found little more than what's in the link you posted.

I mean, why would you expect Mozilla users to know anything about Opera?

 
Joel H Scriptwright

jesus2099, do you propose a notice or a sticky to indicate to new users what to expect from this site? Or would you suggest an FAQ section? Any ideas are welcome.

-Joel

 
jheiselman Scriptwright

I think one of the questions that should be asked is whether or not userscripts.org wants to host Opera user scripts. There could be a section for Opera UserJS scripts in addition to the Greasemonkey Compatible scripts. You could also provide a check box for Greasemonkey/Opera compatibility when a script is uploaded.

I personally would like to see userscripts.org host this as the Opera site (http://userjs.org) is mostly dead. I also don't remember seeing anything on userscripts.org that states that the site is dedicated to Greasemonkey. While I don't think it would be a bad thing to only support Greasemonkey scripts, I think it should at least be made clear what the direction of the sit e is.

 
Descriptor Scriptwright

I didn't remember seeing anything either, a while back when we discussed this before, but if you log out it does say:

This site is a repository to download and install Greasemonkey scripts.

'Nuf said.

 
jheiselman Scriptwright

Ahh, haven't been logged out in a while. Perhaps a FAQ section would be best, or the modifications to include browser compatibility so that this site can be about user scripts as opposed to GM scripts.

 
Descriptor Scriptwright

I don't mind making a GM Script Opera compatible if someone requested it, but someone needs to post more information than what is available on the Opera site. I know a little about this because I used to use Opera years ago when it didn't have full CSS and JavaScript support and I think there was an Opera news group where we discussed these issues. It was always annoying for me to find out something didn't work - like trying to replace embed with object and thinking I found a solution then I'd find out that Opera didn't support it correctly either.
And now I have a script that uses watch() but Opera doesn't support that. So someone that knows needs to start a thread that shows alternative code for these unsupported methods. I, for one, don't want to go to the trouble to install Opera just to test alternative functions to make a script that I wrote for myself work for someone that uses a different browser that doesn't use Greasemonkey so that they can use it as well. That doesn't make much sense does it?

 
Joel H Scriptwright

If people are really serious about this, someone could make an Opera Compatibility Script, which would have to be run first, which would patch functions such that opera runs like firefox (as far as the scripts are concerned, that is). Naturally, it would be necessary to control the order of execution of Opera scripts, and I don't know enough to comment on that.

-Joel

 
Descriptor Scriptwright

I think if this becomes a popular subject that there should be a 5th topic, something like "Script compatibility; i.e. Opera, etc.".
Or at least in the Banana room, somewhere people can find it without a futile search of the entire forum.
Or is the Banana room just for spammers?

- Odd that sometimes lines don't break.
 
Descriptor Scriptwright

I thought of something else to add here, keeping to the subject, I think that one of two things can happen here...

The site can be changed to add some kind of support for Opera User Javascripts - I suspect this won't happen anytime in the near future.

Scriptwrights can go ahead and upload Opera scripts under the following conditions:
Use Greasemonkey metadata and add the statement "This is a Opera / Greasemonkey user script". The metadata should be required anyway.
Only upload Content scripts, UI scripts won't work in Greasemonkey and that isn't what this site is about.
Scripts should be Mozilla Gecko compatible, which should require little or no effort at all, only that it uses ECMAScript and standard DOM methods (i.e. no MS-JScript allowed).

 
Descriptor Scriptwright
Mortimer said:
Opera supports userscripts (I might say something wrong, but they "introduced" the technology I think)

I would say that's wrong because Mozilla has had this ability since before Opera even had decent JavaScript support. It's just that Greasemonkey has not been around that long. You can even create User Chrome Scripts, which isn't anything new, just the extension is.

 
Spot User

Perhaps one of you intelligent people out there can just write a greasemonkey widget for Opera.
That would rock!

 
jerone Scriptwright

@spot. For you.

 
Dapxin User
OperaWindows

the most logical solution would be for userscripts.org to implement a method where authors can flat scripts for Opera compatibility.

A simple icon system seems logical to me. wrong ?

 
jesus2099 Scriptwright
OperaWindows

Hey Dapxin, just use one of the existing tags: opera (or opera friendly).

(\(\
( ^_^)..

 
kayzh User
OperaWindows

There's an Opera userscript group where you can do some discussion:

http://userscripts.org/groups/73

Cross
Presentational HTML allowed.
Use <code> for inline code and <pre> for code blocks. Use &lt; and &gt; for literal < and >.
We help break paragraphs and link your links.
or cancel