You need to be logged in to post in the forums. If you do not have an account, please sign up first.
My UJS Manager service
Here is my take on Unite technology. It's simple manager for User Scripts directory.Features:
- enable/disable selected script
- display userjs header fields
- edit userjs settings (requires modifications to script files)
- quick find through scripts
To install, save file anywhere, drop into Opera window and pick you user scripts folder.
Although I haven't had any problems with corrupted/deleted files, it's better to backup user scripts directory before trying this service.
Download: UJS Manager
Editing scripts from manager requires special modifications to scripts and is more of an expert feature. So not for faint of heart
.Here is a snippet of my user script that shows three object properties that will be exposed to UJS Manager as nice switchable checkboxes:
prettyify_js : /*@Prettify Javascript@bool@*/false/*@*/, replace : /*@__replace 3@string@*/'debugger; if (! (a[J]'/*@*/, replace_scripttext : /*@Replace text in scripts@bool@*/false/*@*/,
Idea is to wrap any javascript variable into special formatted comment.
Syntax is:
/*@CUSTOM_NAME@(bool|int|string)@*/JS_VARIABLE/*@*/
Here's picture of some helper script that I've modified to expose most useful settings: http://files.myopera.com/d.i.z./files/ujs02.png
And when I said "to the left" earlier I meant "to the right" of course.


I can't see good way of using skin elements and retaining readability in all cases. One of the reason is that color: -o-skin does not work like it should. If given skin element is not available, it uses red color.
Originally posted by d.i.z.:
I don't think I will bring it back. It was causing problems because skin elements can be unavailable in custom skins. Even official skin in 10.50 removed some skin elements that I was using.
Aw.

Another question, your screenshot shows this nice hierarchy of options but with the information you've given I can only get a straight list?
Not sure I understand how this is possible (I'm not a skinner though) - don't all skins fall back to the default skin element definitions for undefined elements?
I didn't really test with custom skins. I guess they do. So I guess the biggest problem I stumbled upon was that I couldn't get the color that I could use for text that would always contrast with skin element background. Text color is not always defined in skin section. In this case, getting color would just return red which is not most pleasant to look at.
Another question, your screenshot shows this nice hierarchy of options but with the information you've given I can only get a straight list?
Ah, yes, looks like I forgot to mention it. Number of underscores before CUSTOM_NAME defines how big left-margin it gets in em's.
For example, this will give 1em left margin: /*@_CUSTOM_NAME@(bool|int|string)@*/JS_VARIABLE/*@*/
Originally posted by d.i.z.:
Ah, yes, looks like I forgot to mention it. Number of underscores before CUSTOM_NAME defines how big left-margin it gets in em's.
For example, this will give 1em left margin: /*@_CUSTOM_NAME@(bool|int|string)@*/JS_VARIABLE/*@*/
Thanks. Don't forget to update the instructions at some point.

I also notice the text inputs (for int and string) are on the right whereas mine are on the left. Is this some other option or is it just an older default?
I also noticed that I defined my JavaScript home as: "D:\Program Files\Opera backup files\Javascripts" but if I enter a new JavaScript using USJ Manager it writes it out to: "C:\Program Files\Opera backup files\Javascripts". My Windows XP is booted from my D: drive.
__________________________________________________________________________________
'If there is one, Knowledge is the "Fountain of Youth"'
-William E. Taylor, Regular Guy (1952-)
__________________________________________________________________________________
'If there is one, Knowledge is the "Fountain of Youth"'
-William E. Taylor, Regular Guy (1952-)
Originally posted by netwolf:
Had the same issue with an old installation (10.10). When attempting to update the script, I got the same error message.
I am running Version 10.52 Build 3370 on a Win32 Windows XP. Maybe something was hanging around so I am assuming the same ballpark error. Thanks for your input.
__________________________________________________________________________________
'If there is one, Knowledge is the "Fountain of Youth"'
-William E. Taylor, Regular Guy (1952-)
Also if I open a javascript file and select the "Install user Script" button I recieve the error: "The address was not found (Error 404)". USJ Manager error.png
I am running Opera v10.53 Build 3374
__________________________________________________________________________________
'If there is one, Knowledge is the "Fountain of Youth"'
-William E. Taylor, Regular Guy (1952-)
I'll go a bit off-topic. I just saw the "What is your dream Unite app?" post in the Unite blog. After writing a comment there
http://my.opera.com/unite/blog/what-is-your-dream-unite-app#comment30716792
What I want: something similar to UJS but about urlfilter.ini. I want a app that does this:
The user enters a list of URLs that point to urlfilter files on the net (say Fanboys's list), periodically (or on demand) downloads the latest versions from those URLs and keeps them in a folder somewhere in Opera's folder. Takes the files and combines them (by simply appending the 'exclude' parts) into a single urlfilter.ini, puts it in Opera's folder and tels the user to restart Opera.
I am maintaining my own urlfilter.ini that is a localized version of Fanboy's list and it would be great if I could put just my additions in my repository and the user could just point said Unite app to both my short list and Fanboy's big list and have the automatically combined. I really really want this...
I realized that if anyone can do it, that's you. So my questions are, in your opinion, is a UJS Manager-like app for managing urlfilter.ini even possible and, more importantly, are you willing to make it?
BTW, the UJS Manager is ridiculously good, especially for people like me that constantly install, try and remove different userjs.
Originally posted by Alpha-Toxic:
What I want: something similar to UJS but about urlfilter.ini.
And, I want one like that but for webmailproviders.ini
Originally posted by Alpha-Toxic:
@d.i.z.:
I'll go a bit off-topic. I just saw the "What is your dream Unite app?" post in the Unite blog. After writing a comment there
http://my.opera.com/unite/blog/what-is-your-dream-unite-app#comment30716792What I want: something similar to UJS but about urlfilter.ini. I want a app that does this:
The user enters a list of URLs that point to urlfilter files on the net (say Fanboys's list), periodically (or on demand) downloads the latest versions from those URLs and keeps them in a folder somewhere in Opera's folder. Takes the files and combines them (by simply appending the 'exclude' parts) into a single urlfilter.ini, puts it in Opera's folder and tels the user to restart Opera.
I am maintaining my own urlfilter.ini that is a localized version of Fanboy's list and it would be great if I could put just my additions in my repository and the user could just point said Unite app to both my short list and Fanboy's big list and have the automatically combined. I really really want this...
I realized that if anyone can do it, that's you. So my questions are, in your opinion, is a UJS Manager-like app for managing urlfilter.ini even possible and, more importantly, are you willing to make it?
BTW, the UJS Manager is ridiculously good, especially for people like me that constantly install, try and remove different userjs.
It sounds like something that could be made in few lines in some scripting language.
I'm a bash newb but something like that could work:
wget http://filter1
wget http:// filter2
cat filter_header filter1 filter2 myfilter > urlfilter.ini
On windows you can install cygwin to get all required tools for that.
Every three days all active scripts are checked for update. It looks for update by checking (in that order):
a) original URL that script was installed from (if it was installed using UJS Manager - download URL is saved by it)
b) userjs header field "download"
c) userjs header field "ujs:download"
d) userjs header field "identifier"
If any of these is available then it proceeds to check if either userjs header field "version" of remote script is higher or "ujs:modified" is later.
Given that most user scripts don't use these headers (some even don't use "version"), it will not be able to detect update in a lot of cases unfortunately but still better than nothing.
1. July 2010, 22:19:12 (edited)
Current Opera builds seem to have some bug that makes XHR in unite applications stop working after restarting Opera (works only after first install of application).
That makes UJS Manager not load when it tries to check for update because I'm not catching exception (fixed in 2.9).
20. July 2010, 02:12:06 (edited)
Originally posted by Frenzie:
It seems like the latest version doesn't read userscript headers anymore if they're not on the first line, plus it automatically strips said first line & UTF-8 BOM when automatically installing scripts.
yup
http://unite.opera.com/application/401/2.9/2/#comment20832
I made a change to only accept user script headers that are located in the beginning of the file. If it is not, then it is invalid header which Opera should not consider valid either.
Why u did it? I can't remember any paper that contains such requirements. Moreover, Opera can easily recognize metadata from 2nd, 10th, 1000th line or even next to the last bracket.
Originally posted by webrider:
Why u did it? I can't remember any paper that contains such requirements. Moreover, Opera can easily recognize metadata from 2nd, 10th, 1000th line or even next to the last bracket.
Because I found scripts that include header of another script inside a comment but did not have it's own header. So then name and other info were all wrong in manager.
But clearly I have to allow that. Just need to make parsing smarter.
I don't care much about the lack of reading headers, but the automated stripping of the BOM doesn't seem like a very good idea to me. If you wish I'll whip up a couple of tests to prove whether it is or isn't a problem.
Originally posted by Frenzie:
Are scripts automatically handled as UTF-8? If not, stripping the BOM could mess things up for non-Western UserJS authors.
Yes, Opera handles scripts as UTF-8 by default unless there is @encoding directive specified. Then it uses specified encoding.
Originally posted by Frenzie:
The reason for the new line is that Opera ignores the UserJS if there's a BOM present.
Yes, I know this bug.
Stripping of BOM is not something that I do deliberately. It just goes away when passing user script text through textarea (obviously). I'm not sure if I will be able to preserve this somehow as usually this is not something that is exposed in javascript. I guess I could specify "user-defined" encoding in XHR to trigger data mode and then I won't loose anything but it might be harder when editing scripts for example...
Originally posted by d.i.z.:
Originally posted by Frenzie:
Are scripts automatically handled as UTF-8? If not, stripping the BOM could mess things up for non-Western UserJS authors.
Yes, Opera handles scripts as UTF-8 by default unless there is @encoding directive specified. Then it uses specified encoding.
I suppose it shouldn't really be a problem then, though it could cause some unintended consequences (at least if you've got your editor set up to treat files without a BOM as 8-bit).
Originally posted by d.i.z.:
Stripping of BOM is not something that I do deliberately. It just goes away when passing user script text through textarea (obviously). I'm not sure if I will be able to preserve this somehow as usually this is not something that is exposed in javascript. I guess I could specify "user-defined" encoding in XHR to trigger data mode and then I won't loose anything but it might be harder when editing scripts for example...
Oh right, I didn't realize the installation also utilized that method (I just checked the script). I assumed it passed the URI to the Unite service which then downloaded it internally. Or maybe it used to do that? Unless my memory betrays me I don't think it used to strip anything.

Originally posted by Frenzie:
I assumed it passed the URI to the Unite service which then downloaded it internally. Or maybe it used to do that?
It used to do this but it didn't work for pages that check referrer. So now I use XHR on page to fetch source and pass as text to "backend".
Help expand the Public BTS (un-official) when reporting bugs | Opera Desktop Team | Download Opera | http://www.opera.com/browser/features/
Could you add multi language support to UJS Manager? All strings in the application are English.
Originally posted by d.i.z.:
If any of these is available then it proceeds to check if either userjs header field "version" of remote script is higher or "ujs:modified" is later.
Does it work with UJS hosted on files.myopera.com too?
What takes precedence, the "version" or the "ujs:modified" info?
Can you update the Infos at unite.opera.com so that script authors can see, that they don't need to build updater of their own, if they include those headers and ask the users to use the UJS Manager?
blog (en/de) | houmpäidsch (de) | Extension: cleanPages for Opera 11 and 12
Originally posted by QuHno:
Does it work with UJS hosted on files.myopera.com too?
Unfortunately not. Hotlinking protection prevents it from working.
Originally posted by QuHno:
What takes precedence, the "version" or the "ujs:modified" info?
"version" is checked first. If it's not available or equal then ujs:modified is checked.
Originally posted by Rodny:
During UJ-scripts installation UJS Manager changes carriage return from Unix 0x0A to Win 0x0D 0x0A. Because of this stops working noads.js by Lex1. It downloads Adblock Plus subscriptions, but doesn't import them into itself.
I don't understand why changing line breaks would break script but I have fixed UJSM bug and will include it in next release.
Showing topic replies 101 - 150 of 190.

