User Specified Javascript

Opera 8 introduces the ability to execute a user javascript file in every page loaded, a bit like the browser stylesheet. This allows one to add in javascript fixes for any sites that need them, and enhance sites with new functionality.

Scripts [⊗]

The unofficial central script repository: http://userjs.org/

Collections

Individual scripts

Documentation [⊗]

How to add scripts [⊗]

To add the scripts, make a directory and point Opera at it using Preferences » Advanced » Content » Javascript options » My javascript files:

image

You can then simply drop scripts into that directory and Opera will use them automatically. If you want to limit their effects to particular web sites, you can use comment metadata to do so:

// ==UserScript==
// @include http://example.com/*
// @include http://www.example.com/*
// @exclude http://example.com/directory/*
// @exclude http://www.example.com/example.html
// ==/UserScript==

Note: Peter Karlsson aka nafmo said:

Setting up a script environment on a page costs memory, so Opera only does it if it actually encounters a script tag. However, without that, user JavaScripts can't be executed.

You can force Opera to run User JavaScript on other pages by adding

[User Prefs]
Always Load User JavaScript=1

to your opera6.ini file.

Historical Interlude [⊗]

Here is a post from a current developer and maintainer of the GreaseMonkey repository — note Rijk's comment is interesting for Opera users:

Opera’s userscript support has been developed during the year 2004, before Greasemonkey, as part of larger modifications of Opera’s core. This part was interesting enough for power-users to put into the current beta release, but it is only a small part of what we’ve been working on. Expect more in the future.

Rijk has later embellished this with:

It should be noted that Greasemonkey was not the inspiration for developing User JavaScript, as CNet.com seems to imply. This idea had come up between Jonny A. (Opera tech thinker) and Lars H., (our main JavaScript guy) in 2002 already, and the code was actually written last year.

Categories

CategoryOpera
CategoryTechnical

Backlinks
Comments [Hide comments/form]

I liked the structure of the UserJS file posted by Rijk in his journal (http://my.opera.com/Rijk/journal/54). Could we follow this approach here and post functions everyone can choose from to use in their own user.js?

ScipioNeer (2005-03-17 18:51:46)

Arve has commented that he wants to code a user JS repository so I'm holding off. As I pointed out, having some kind of API like Rijk's interface will be the way to go. Arve's idea (and mine independantly) was to have JS functions selectable through a web interface, and then the app would roll it all up into a single downloadable user.js file...

NonTroppo (2005-03-18 09:31:38)

So that would be something like the skins page on my.opera.com, if I understand you correctly. Sounds like a good idea. Is there a discussion about this on the forums or in a journal?

ScipioNeer (2005-03-18 10:15:23)

Yes, but with a better interface hopefully! ;) The discussion is lost in the æther of IRC..

NonTroppo (2005-03-19 13:22:03)

Maybe you all know about it, but I found this url: http://userjs.org/
There's nothing to see yet, but it's still very promising. :D

ScipioNeer (2005-04-21 11:26:17)

www.userjs.org is working now

212.160.55.32 (2005-05-23 00:23:40)

AutoFill? script is updated. You can download it here:
http://vvs.post.lg.ua/Opera7/autoFillForms2.zip

195.190.103.96 (2005-10-27 05:11:43)

"working now" - this really depends on your definition of "working".

Yes that was probably undeserved. Piss off.

PgL (2008-07-12 15:36:11)

it's carrefuly .

125.160.245.114 (2009-09-01 20:16:30)

it's carrefuly .
(2009-09-02 10:25:56)

125.160.245.114 (2009-09-01 20:18:30)

q porqueria

190.141.48.229 (2010-10-26 11:32:12)

l´´´lñ

200.92.228.132 (2011-01-15 09:40:01)

MAMALO

200.90.97.127 (2011-02-01 08:25:49)

freelance writer

31.184.236.16 (2011-12-29 04:24:44)

freelance writer

31.184.236.63 (2011-12-29 19:41:50)

k5SkoI As usual, the webmaster posted correctly..!!

193.105.210.170 (2012-02-12 04:06:36)

check this<a href=> </a> for your all your adult toys needs

158.255.7.240 (2012-06-05 02:23:04)

Add a comment to this page (use wiki formatting if needed, no HTML/BBCode please). Only registered users can submit links, your comment will be deleted otherwise: