The My Opera forums have been replaced with forums.opera.com. Please head over there to discuss Opera's products and features
See the new ForumsYou need to be logged in to post in the forums. If you do not have an account, please sign up first.
UserJS newbie, need help (plus a question about Opera)
So I recently began playing around with User JavaScript, I'm writing simple scripts for like changing some part of the the page's title, getting a portion of a cookie and so on. I use Notepad++ for writing and Opera 11.60 (1159), 12.00 (1155) for actually running the scripts.What I found (may even be a bug in both versions): setting UserJS folder only for one site works as expected and the script runs fine, but changing the script on the fly may prevent it from working - if I make a syntax error or something, the Error Console will alert me about it the first time, but nothing afterwards. Using Dragonfly, I found that even if I correct the errors, the .js file would not be reloaded, like Opera sees the errors and ignores the file (contrary to the statement that "Opera does not need to be restarted to see any changes to User JavaScript files."). The script may load again if I rename it, but this makes things slow - I want to write something more complex for my own needs, but this probable bug impairs me.
I tried ticking "Always load User Javascript" in opera:config, but this does not work. Is there any other setting I may not be aware of, or this may be considered a bug?
Anyway, thanks for your time for at least reading this (cause my way of expressing is a mess), I'd gladly appreciate any help on this question.
Loyal Opera user saying NO to Opera 15.
Opera Mobile 16 & Opera Mobile 16 beta & Opera Mobile 12.1 & Opera Mini 7.5 on Samsung Galaxy Nexus
Opera Mobile 12 & Opera Mini 7 on Nokia E51
By the way, setting the UserJS folder globally should also set it to sites without previously saved Site Preferences, right?
Loyal Opera user saying NO to Opera 15.
Opera Mobile 16 & Opera Mobile 16 beta & Opera Mobile 12.1 & Opera Mini 7.5 on Samsung Galaxy Nexus
Opera Mobile 12 & Opera Mini 7 on Nokia E51
Loyal Opera user saying NO to Opera 15.
Opera Mobile 16 & Opera Mobile 16 beta & Opera Mobile 12.1 & Opera Mini 7.5 on Samsung Galaxy Nexus
Opera Mobile 12 & Opera Mini 7 on Nokia E51
Originally posted by larskl:
There’s no reason to use site-specific settings for UserJS. Thanks to the @include/@exclude lines in the header of the userjs you can control where the userjs runs far more fine-grained than you can do with site-specific settings. So just put them all in one global folder and be done.
Excuse me, sir, but did you read my last two posts?
Loyal Opera user saying NO to Opera 15.
Opera Mobile 16 & Opera Mobile 16 beta & Opera Mobile 12.1 & Opera Mini 7.5 on Samsung Galaxy Nexus
Opera Mobile 12 & Opera Mini 7 on Nokia E51
Originally posted by larskl:
Yes. So? I didn't say "put them in a global folder and it'll work" but "put them in a global folder because site specific folders for userjs makes no sense"
In which way is it wrong to only have a user script running for one site?
Loyal Opera user saying NO to Opera 15.
Opera Mobile 16 & Opera Mobile 16 beta & Opera Mobile 12.1 & Opera Mini 7.5 on Samsung Galaxy Nexus
Opera Mobile 12 & Opera Mini 7 on Nokia E51
I believe someone else already found the bug with Opera essentially blacklisting scripts with errors in 11.60+. I do not know if it has been reported or not.
Originally posted by spadija:
I believe someone else already found the bug with Opera essentially blacklisting scripts with errors in 11.60+. I do not know if it has been reported or not.
It is reported and should get fixed in the not too distant future. The only workaround I know about is to either re-start Opera or use "Save as" and give the script a new name after fixing the syntax error - sorry about the nuisance :-/
My blog: miscoded
Stupid code from major websites uncovered and criticised
Contribute site fixes! - OTW&TA- all sites must work
Originally posted by hallvors:
Originally posted by spadija:
The only workaround I know about is to either re-start Opera or use "Save as" and give the script a new name after fixing the syntax error [...]I believe someone else already found the bug with Opera essentially blacklisting scripts with errors in 11.60+. I do not know if it has been reported or not.
Yup, that's what I've found out as well.
I'm staying with 11.52 for now, at least for writing and [de]bugging purposes - you know, making lots of errors is just part of the learning process, and as I stated, I'm a JS newb wanting to learn.
Loyal Opera user saying NO to Opera 15.
Opera Mobile 16 & Opera Mobile 16 beta & Opera Mobile 12.1 & Opera Mini 7.5 on Samsung Galaxy Nexus
Opera Mobile 12 & Opera Mini 7 on Nokia E51