Tuesday, 1. July 2008, 10:43:54
Questions and comments
Feel free to ask us any questions or comments you have about our "User JavaScript contest".Tuesday, 15. July 2008, 19:01:51
Originally posted by xErath:
IMO your submission is not valid. Most of code is a local java application.
I disagree...
Originally posted by hallvors:
you may write a User JS that will interact with some plugin if there is something you can't do with pure User JS+DOM+SVG+CANVAS+Voice+whatever else we support natively.
The bulk of my work went into implementing persistent storage, accessible via UserJS from any page, backed by a full-fledged SQLite database. This is something Opera does not offer natively (cookies in 0.0.0.0 iframe do not offer the same functionality and are limited to 4kb).
This is something that could be very useful for other applications as it frees the UserJS from the context of a single page / domain.
Tuesday, 15. July 2008, 19:39:53
Originally posted by xErath:
wow! Do you know how many times I thought of doing that myself ?
No idea. I was trying quite hard to come up with good ideas
I am quite happy with this though, and now it seems like the directory browsing should've been an obvious idea right from the start
Tuesday, 15. July 2008, 20:00:57 (edited)
Originally posted by zomg:
I can't help but think if you hadn't been able to perform at least the graphics using canvas or svg instead of Java
The graph output is in SVG
Originally posted by zomg:
One thing that bothers me about it is the port.. a more random one would've been better IMO since I usually have more pressing matters to run on the most elite of all ports
Yes, I wanted to add more configuration options, but that was lower on the priority list... For now, you could change the source and recompile, it's the constant SERVER_PORT in Server.java and the variable SERVER_ROOT_URL in HistoryPlus.js
Oh and by the way, thanks for the MessageStore.js script, it came in handy
Tuesday, 15. July 2008, 20:01:56
Tuesday, 15. July 2008, 20:36:17
Hallvors said external stuff was allowed, if it does something not possible in Opera.
I did something that is impossible in pure userJS (4kb cookie size being atleast one limiting factor), and I think the final result is quite useful, so I really don't see what the big deal is here...
Wednesday, 16. July 2008, 15:12:05 (edited)
Originally posted by fearphage:
the rules were not clear. agreed. in future competitions (hint, hint), maybe we can remedy that.
Or make 2 competition categories, one for pure userJS, and another allowing external stuff.
I think the use of external plugins is great because it extends opera functionality on an incredible way, but it present a mayor disadvantage to those who don't use it, and by doing that way, maintain platform independent code. It will probably be a great thing to encourage both ways.
By the way, I have a couple of mine:
getVideo.zip
and
enhanceGeo.zip
getVideo detects flash .flv movies and adds download links at the bottom of that movie. It currently supports youtube videos with multiple download formats, and generic .flv movies.
You can test it on youtube, I'll add more sites depending on the demand
enhanceGeo detects geo and hCard microformats with address information, adds options related to that geo positions (it only let you link to
google maps by now). You will see "Extended Geo Info" with the options below the element that contains the microformat.
You can test it on any site that contains the geo microformat, of hCard with adr on it.
Here is one example: http://technorati.com/about/contact.html you can see below the contact card a link to google maps
Wednesday, 16. July 2008, 17:31:40
Originally posted by Guille:
It's so subtle I didn't even see the download links at first, ha. Nice job! The last script I was using for this quit working for some reasons, plus it doesn't give as many download options.getVideo detects flash .flv movies and adds download links at the bottom of that movie. It currently supports youtube videos with multiple download formats, and generic .flv movies.
Wednesday, 16. July 2008, 17:54:56
Originally posted by Guille:
I would argue that a built-in Opera extension API would suit our needs better but this (your way) is a mediocre way to bridge the gap temporarily.I think the use of external plugins is great because it extends opera functionality on an incredible way, but it present a mayor disadvantage to those who don't use it, and by doing that way, maintain platform independent code. It will probably be a great thing to encourage both ways.
Wednesday, 16. July 2008, 22:34:44
Originally posted by BAMAToNE:
<P class="cite">Originally posted by Guille:</P><BLOCKQUOTE class="bbquote">getVideo detects flash .flv movies and adds download links at the bottom of that movie. It currently supports youtube videos with multiple download formats, and generic .flv movies.
It's so subtle I didn't even see the download links at first, ha. Nice job!
That was the plan! I didn't want to break the pages's original design
Originally posted by BAMAToNE:
The last script I was using for this quit working for some reasons,
ouch! do you have the page where that happened?
Originally posted by BAMAToNE:
plus it doesn't give as many download options.
Yes, I wanted to add more options, but I didn't had the time
Thursday, 17. July 2008, 10:32:13
I was actually thinking of doing a similar flash download script, but I noticed there was some in UserJS.org which supposedly did the job for all embedded content, so I dropped the idea.
I wonder when can we expect the results of this competition to be announced?
Thursday, 17. July 2008, 15:29:19
Originally posted by zomg:
Guille, I think BAMAToNE meant that some other script had those problems, not your script
Thursday, 17. July 2008, 18:46:03
Originally posted by zomg:
Guille, I think BAMAToNE meant that some other script had those problems, not your script
I was actually thinking of doing a similar flash download script, but I noticed there was some in UserJS.org which supposedly did the job for all embedded content, so I dropped the idea.
Oh, I get it now, yes, there were some youtube scripts, but they only let you download the .flv file, plus youtube has changed its code to make it more difficult (and sometimes you find different arguments depending on the movie) , probably that's why other scripts stopped working.
Wednesday, 23. July 2008, 11:14:19
Originally posted by fearphage:
i'd like to see 100% of the entries
Since you ask.. I'll present many of them below. I won't disclose entries or authors that weren't among the really strong contestants though - loosing a contest is bad enough without being "outed" as a bad JavaScripter
I'll link to site, submitted archives or .js - files but note that the contents may of course have changed after the competition deadline, in which case judges' comments may no longer apply.
Site fixes
Surprisingly, there were only three entries in this category. The main contestants were
Unfortunately the 4chan.org site was always down whenever I tried evaluating the Fychan.js functionality. Also, the script itself uses global variables that aren't required and does somewhat heavy-handed DOM manipulations.
As an illustration of how a User script can better insulate itself from page scripts, consider this from fychan.js:
jumpbuttons = " <a href=\"javascript:myFychan.jumpThread('" + threadPrev + "');\" style='color:inherit; font-family:verdana; font-size:inherit'>Prev</a>";
Using the "innerHTML" approach to adding links to the document requires defining "myFychan" as a global variable that can be seen from a javascript: URL. If this was replaced with something like
var link=document.createElement('a');
link.onclick=jumpThread;
we can keep the information inside the script without defining global variables.
In any case, the "Site fixes" category was an easy one to judge. I miss a fully Opera-compliant Google Spreadsheet every single week, and the winner of the "Site fixes" category is zomg for zomg-fix-spreadsheets.js. Congratulations!
Tools
And here comes the much larger and harder category "tools and enhancements".. Top nine entries were:
- View selection source, pretty XML tree and anchorize by jkb.
Fairly well known and well developed scripts. The former two are good web developer tools, the latter very convenient whenever URLs are added to a page without links. The only drawbacks are non-technical: they aren't new scripts, and perhaps targeted at a minority audience though they do what that audience needs very well.
- Tagger Menu by Aux. This script creates a ctrl+click menu with BBCode or HTML fragments for TEXTAREAs. Very useful - I'm writing this long post in Notepad to be able to save drafts, and I already miss this script

One drawback is that the script relies on mouse usage. Some keyboard equivalent would be nice. The way it remembers the selection when you do ctrl+mousedown is useful when you ctrl-click on existing selections, but confusing if you hold ctrl while making a selection.
- directory-listings.js and bookmarking.js by zomg
Sweet! Both these are general tools that have nice UI and should appeal to a wide audience. I like the way the directory listings script uses XMLHttp and yet keeps your back/forward buttons working nicely with location.hash changes. The bookmarking UI is minimal but very nice. Actually, the only drawback for these scripts is that zomg already won the other category
.
Minor drawback: the directory listings script did not work correctly on some directory listings I tested. Likely to do with Apache configuration, probably a simple fix.
- BlockIt by shoust. A good equivalent to the Firefox NoScript extension? Consider me an official fan, shoust..
The script works pretty well on all sites tested. Some drawbacks though:
* somewhat complex and confusing UI IMO.
* settings stored in cookies - script would really benefit from localStorage
* scripts are identified only by source order. If you selectively un-block a script and the source order of scripts change, the scrip you want to run might be blocked and another one un-blocked. This is probably related to the storage limitations and the inconvenience of storing more detailed identifier (i.e. script URL)
- Gallery by d.i.z
Now this is really sweet. Pretty UI with a lovely mouse/keyboard interaction. No drawbacks I could find, except that the My Opera gallery pages lack pages that link directly to the graphics so it's not usable there. My Opera should just steal your UI ideas, d.i.z.
- History+ by d4n3
This script hit the limitations of User JS - and worked around them by thinking outside the box, implementing localStorage by running a local HTTP server the script can interact with! It presents your browsing history in a really innovative way (and I love the way it by default focuses on the site you are at when you launch the browsing history overview). The User JS part is relatively simple but the overall concept and implementation is awesome.
Testing uncovered one serious bug: it looks like input is converted to UTF-8 twice, meaning all characters that are outside US-ASCII are badly mangled. It's impossible to go back to what page you visited on Japanese Wikipedia for example.
Another important issue when we store such an amount of data is security. I think if this script should reach wide usage, it needs to implement some "shared secret" feature where a "pass phrase" entered by the user into the .js file and stored by the server on first usage needs to be presented in every request, or something like that, to prevent rouge page scripts from being able to post things to the localStorage server.
Kudos to you guys - this is all great work! And the winner is...
History+. For thinking outside the box and overcoming the native limitations of User JS - this is hopefully an approach other user scripts can build on until we have some script-specific native localStorage implementation. With a few more parameters to enable different databases for each script, for example BlockIt would easily be able to store its white-list of scripts there and thus have a more robust solution. Congratulations to d4n3!
Now, I promise that this won't be the last User JS contest. We've learnt a thing or two by running this first one, so I predict that next time we'll have even clearer rules from the start and more development time before the deadline. See you then?
Wednesday, 23. July 2008, 15:21:24 (edited)
Congratulations to d4n3 and me
btw:
"The best User JavaScript overall will be awarded with a brand new HTC Touch Diamond™ "
Does that mean best overall in each category or best overall from both categories?
edit: so according to aaas it's the latter, as in just one phone, and d4n3 was the winner of that.
I have to wonder if I killed my chances at winning the phone because I participated in site fixes category... hallvors did list winning that as a drawback - so I'd assume it means I couldn't have won both, and how is a simple site fix supposed to compete against something big like the tools scripts are?
Yeah, I'm not very happy with this. Now it feels like a waste of time.
the hopefully final edit: Thanks!
Wednesday, 23. July 2008, 17:27:09
@hallvors: how's userjs.opera.com coming along?
Wednesday, 23. July 2008, 18:47:37
I think that's only fair. And congrats to both of you.
And I am glad that Opera finally decided to conduct a userjs contest. Personally I use very few widgets, but I use a good number of userjs. And I would really like to see Opera promoting the userjs feature more. We really do need an official userjs gallery though.
Wednesday, 23. July 2008, 18:48:38
Here is the Screenshoot: opera-history.jpg
Thursday, 24. July 2008, 07:37:39
And yeah I guess I could completely remove all globals now that I think about it! I might try to work around needing the global object along with the other changes I've been doing for the next version. One of such things is adding in a storage method to avoid passing cookies to their server, so that I can finally implement a thread watcher.
In any case congrats to the winners! Looks like we all get some new UserJS scripts to try out.
Friday, 25. July 2008, 03:28:13
awesome dude.
keep it up.
Also History+ Doesn't seem to work on my mac system, I can't get the .jar to run.
There are some broken links ofr example the taggermenu one.
Friday, 25. July 2008, 07:21:07
I won't disclose entries or authors that weren't among the really strong contestants though - loosing a contest is bad enough without being "outed" as a bad JavaScripter
As one of those "bad Javascripter" contesters, I don't mind to be "outed"
I am very interested to know what's bad in my User Javascript (ODictCN), and if you don't mind and have enough time, I will be glad to have some feedback.
Friday, 25. July 2008, 10:51:50
Originally posted by RyomaNagare:
Also History+ Doesn't seem to work on my mac system, I can't get the .jar to run.
Originally posted by kavalec74:
What can I do? I can not run jar-files on xp
Do you have Java 5 installed?
Try this: in the command line, type
java -version
If there is an error or if the version reported is less than 1.5, you first have to install Java..
I'll try to make the setup process less painful in the next version, please stay tuned to the forum topic for History+.
Friday, 25. July 2008, 11:11:15
Originally posted by d4n3:
Originally posted by RyomaNagare:
Also History+ Doesn't seem to work on my mac system, I can't get the .jar to run.
Originally posted by kavalec74:
What can I do? I can not run jar-files on xp
Do you have Java 5 installed?
Try this: in the command line, type
java -version
If there is an error or if the version reported is less than 1.5, you first have to install Java..
I'll try to make the setup process less painful in the next version, please stay tuned to the forum topic for History+.
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_13-b05-237)
Java HotSpot(TM) Client VM (build 1.5.0_13-119, mixed mode, sharing)
Friday, 25. July 2008, 11:43:07
Microsoft Windows XP [Verze 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.
C:\Documents and Settings>java -version
java version "1.6.0_07"
Java(TM) SE Runtime Environment (build 1.6.0_07-b06)
Java HotSpot(TM) Client VM (build 10.0-b23, mixed mode, sharing)
Is this corect version?
Friday, 25. July 2008, 12:25:53
Yes, the Java version is ok. Try what i suggested here...
@RyomaNagare:
Your Java version is ok too. But I'm sorry i can't tell you exactly how to launch jar files from Mac since i don't own one
Can you do this from the command line:
- go to the directory where the jar file is
- type: java -jar HistoryPlusServer.jar
Friday, 25. July 2008, 13:19:50
Originally posted by kavalec74:
but running the install page, I get blanak page.
What next please? Where can I get the bookmarklet?
Excellent, you're almost there
you probably don't have the HistoryPlus.js file in your userJS directory.
Go to tools->preferences->advanced->content->javascript options
Then see the "User JavaScript Files" directory. If it is empty, create a new directory (either in Opera's profile folder or elswhere on disk) and point to it in this dialog. Then copy the HistoryPlus.js file from the History+ distribution to this directory.
Saturday, 26. July 2008, 02:14:07 (edited)
Originally posted by d4n3:
@kavalec74:
Yes, the Java version is ok. Try what i suggested here...
@RyomaNagare:
Your Java version is ok too. But I'm sorry i can't tell you exactly how to launch jar files from Mac since i don't own one
Can you do this from the command line:
- go to the directory where the jar file is
- type: java -jar HistoryPlusServer.jar
That worked like a charm, But the serevr only runs while I have the terminal window Open,
any way to run the server on the background, without me noticing it, else its kind of anoying.
Saturday, 26. July 2008, 16:39:11
Monday, 28. July 2008, 20:00:10
I won't disclose entries or authors that weren't among the really strong contestants though - loosing a contest is bad enough without being "outed" as a bad JavaScripter
I am very interested to know what's bad in my User Javascript (ODictCN), and if you don't mind and have enough time, I will be glad to have some feedback.
EDIT : Opera staff never received my submission.
But it doesn't really matter for me, because I know that I wouldn't have won.
Thanks to hallvors for his answer.
EDIT of EDIT : when trying to submit the EDIT : Error 502
Tuesday, 29. July 2008, 19:30:03
Wednesday, 30. July 2008, 11:31:28
Originally posted by galanga:
Opera staff never received my submission.
Yes, seems there was a technical glitch somewhere.
Well, just keep those scripts ready for the next competition
Wednesday, 30. July 2008, 19:20:40
Originally posted by hallvors:
Even if we use the same form, we can at least send a manual E-mail or PM reply saying your entry was received next time, so you know for sure that your contribution reached the judges.
There's something that comes to my mind : I hope that Opera had already set up a mechanism to send an E-mail when somebody use the "Apply Job" form at www.opera.com...
Tuesday, 5. August 2008, 13:23:48
d4n3's suggestion++
also, are the phones shipped yet? If not, will we get the info when? Yeah, I know, I suck in waiting - but I blame excitement; I've always had a quite basic phone
Showing topic replies 51 - 99.
Forums » Choose Opera » User JavaScript contest
Moderated by:
Lawmune
thomas.ford
EspenAO
Tamil
BAMAToNE
coxy
fred
melnichuck
Chas4
kumenova
onlyputri
goessling
ZaraL
ehoppe
myfrenchopera
Jon
nunos
ptckian
aaas
Aleksander
howcome
hicksdesign
Abohasn
odd-even
