BS-Harou

Just another blog about the best browser - Opera!

UserJS - External scripts v1.1

, ,

I create extensions from this userJS, you can downlod it here:

https://addons.labs.opera.com/addons/extensions/details/external-scripts/1.0/?display=en

My own AJAX Library? Yes please =)Weather in Speed dial

Comments

AnuaR ShInDigazzZ Monday, August 2, 2010 5:38:10 AM

Information about blocked scripts placed in LocalStorage?!

BS-Harou Saturday, August 7, 2010 1:06:08 PM

yes (sorry for late answer I was on my vacation)

QuHno Tuesday, September 7, 2010 4:19:54 AM

Nice script up

The button for drag and drop:
Show external scripts
easier than editing the toolbar ini and adds to the customize dialog too smile

BS-Harou Tuesday, September 7, 2010 5:27:28 AM

Originally posted by QuHno:

The button for drag and drop:



Thank you for the button =)

When I finish my Image Gallery userJS, I will focus again on this userJS and on buscomplete to make them even better)

QuHno Wednesday, September 8, 2010 9:31:49 PM

Hr, hr ... buttons are easy, scripts are not smile

One wish for the next version if you plan to make any updates:

A small close button in the lower right corner of the overlay - I always forget that I have to click the button to close it again - I think I'm getting old and senile wink

BS-Harou Wednesday, September 8, 2010 10:07:39 PM

Originally posted by QuHno:

A small close button in the lower right corner of the overlay



This is one of things I've wanted to do. =)

Another plan/idea is to separate scripts into two sections "same domain" and "different domain" and the possibility to automatically disable all scripts for one or both those sections.

QuHno Thursday, September 9, 2010 12:18:53 AM

That could break some UserJS like i.e. the WOT Script for it calls a script from api.mywot.com and some buttons, especially converted bookmarklets, load external scripts too ...

I fear you have to include an "exclude from blocking" list if you add the block all scripts from a different domain functionality.

AnuaR ShInDigazzZ Thursday, September 9, 2010 4:19:22 AM

It would be nice to have a settings by default:
"Block all"
"Block external"
"Block nothing"

BS-Harou Thursday, September 9, 2010 1:01:30 PM

Originally posted by QuHno:

I fear you have to include an "exclude from blocking" list if you add the block all scripts from a different domain functionality.



that is the plan =)

QuHno Saturday, September 11, 2010 6:12:01 PM

One more wish:

The UJS Manager Unite Application can check for updates of scripts periodically every 3 days, if one of these conditions is met.

Sometimes I change my UserJS directory or I do a real clean install and jst copy my userJS folder back into location. Then the UJS Manager fails if condition b or c are not fulfilled. Could you add the full d/l path to your script(s) to the script headers, please?

BS-Harou Saturday, September 11, 2010 6:49:55 PM

Originally posted by QuHno:

Could you add the full d/l path to your script(s) to the script headers, please?



thank you for information, I will add it in the next version of this userJS =)

BS-Harou Wednesday, September 22, 2010 4:22:21 PM

I started working on update for this userJS (because I have to wait for Opera to fix some redraw bugs before releasing final version of Image Gallery userJS). So there should be update for extscript.js in a week yes

BS-Harou Monday, September 27, 2010 7:32:15 PM

It's here! I've uploaded new version but I don't have energy to test it, if it's really working so - please - if you will find any bug(s) let me know!

You have to set higher number for "User JS Storage Quota" in opera:config to make this script working

BTW There will be probably second new version in near future, because this version has really unoptimized and ugly script + I want to add "white list" =)

PS: I would appreciate any feedback positive/negative because it makes me feel that there is some one who actually uses my scripts p

http://files.myopera.com/BS-Harou/files/extscripts.jpg -

QuHno Monday, September 27, 2010 8:08:28 PM

Of cause "Nobody" uses your scripts p

Hm... to some strange reason it doesn't want to open the panel a second time here at my.opera...

Works fine so far on other pages.

BS-Harou Monday, September 27, 2010 8:11:45 PM

Originally posted by QuHno:

Works fine so far on other pages.



I've realized that disabling single scripts is not working .. I'm trying to fix it =)

BS-Harou Monday, September 27, 2010 8:15:13 PM

New version uploaded, should be working now sherlock

(should be version 1.2.3 - if there is lower then press F5)

QuHno Monday, September 27, 2010 8:15:47 PM

That would have been the next comment - you beat me by 10s ... bigsmile

edit: Hm... now it won't work at all...

BS-Harou Monday, September 27, 2010 8:18:06 PM

Originally posted by QuHno:

That would have been the next comment - you beat me by 10s ...



bigsmile ... is there still the problem on my.opera.com? is it throwing any error to error console?

QuHno Monday, September 27, 2010 8:19:44 PM

You mean that one?:
Uncaught exception: TypeError: 'opera.userjs.extscripts.show' is not a function

Not only on my.opera now sad I have 1.2.3, I looked into the source.

Opera Version 10.70 9053 (latest of today)

BS-Harou Monday, September 27, 2010 8:36:26 PM

Originally posted by QuHno:

Not only on my.opera now :( I have 1.2.3, I looked into the source.



Did you set the userjs storage quota? can you please send me everything from error console, there might be something useful...

QuHno Monday, September 27, 2010 8:48:56 PM

You've got a PM (I hope) smile

BS-Harou Monday, September 27, 2010 8:52:22 PM

Uploaded new version (1.2.4) that shows alert dialog when the storage quota is not set

QuHno Monday, September 27, 2010 9:03:25 PM

Forgot to set the storage quota in opera:config#User JS Storage Quota - I looked in opera:webstorage doh

I have set the value to 50 now and it seems to work fine.
What's the best value to set?

BTW: "Other Domain" and "same domain" works fine but it is a bit of overkill here because of static.opera.com bigsmile


BS-Harou Monday, September 27, 2010 9:06:33 PM

Originally posted by QuHno:

I have set the value to 50 now and it seems to work fine.



I use "200000", but thats because my Image gallery userJS needs much more quota. This userJS needs only few bytes =)

Originally posted by QuHno:

BTW: "Other Domain" and "same domain" works fine but it is a bit of overkill here because of static.opera.com


I know, but I can't do much about this p

you can disable all scripts from other domain and enable only the ones you want

QuHno Monday, September 27, 2010 9:14:01 PM

I am patiently waiting for the white list option, but one step at a time, it is OK as it is and works fine up


Are the values in the config setting Bytes or KBytes (the later I hope)?
Is it the total amount or per domain?

You could add a hint to the alert in the next version, saying where to set it. That would help people like me finding it faster wink

BS-Harou Monday, September 27, 2010 9:16:01 PM

Originally posted by QuHno:

Bytes or KByte


not sure p

Originally posted by QuHno:

Is it the total amount or per domain?


total (because the script storage is same for all domains)

Originally posted by QuHno:

You could add a hint to the alert in the next version, saying where to set it.


Will do it yes

BS-Harou Monday, September 27, 2010 9:21:27 PM

Originally posted by QuHno:

Are the values in the config setting Bytes or KBytes (the later I hope)?


I found it, its in "KiB" sherlock

AnuaR ShInDigazzZ Wednesday, September 29, 2010 6:18:36 AM

http://s43.radikal.ru/i100/1009/2c/d2667f3588d4.png -

Ability to enable/disable all (same/other) scripts at once. Useful when some scripts is disabled (by auto), but to correctly view/work site you must include them and not to click each one separately...

QuHno Wednesday, September 29, 2010 7:14:07 AM

Hm... another problem: If I set it to block all external scripts, I can't use some buttons that trigger external scripts. When I unblock the specific script and reload the page to load the external JS for the button, the setting from before the reload is ignored and I still can't start the script because it changes the ID with every click.

Example button:
Readability

(In this case no real problem because I have a full local version of that script and button too bigsmile)

PS: Didn't know that opera.userjs is an object, too. That would have made several of my testscripts easier. Where is the full documentation of the opera object? I somehow can't find it, may be because of wrong search terms...

BS-Harou Wednesday, September 29, 2010 9:22:02 AM

Ability to enable/disable all


I want to do that in next version smile

I still can't start the script because it changes the ID with every click.


This will hopefully fix the white list.

AnuaR ShInDigazzZ Wednesday, September 29, 2010 9:24:48 AM

1. Go to Классный конкурс на свадьбе +3
2. Call the ExtScripts;
3. Hover mouse over the name of the script.

BS-Harou Wednesday, September 29, 2010 10:13:04 AM

Originally posted by InDigazzZ:

1. Go to Классный конкурс на свадьбе +3



interesting) I will try to fix it =)

BS-Harou Wednesday, September 29, 2010 3:16:54 PM

Originally posted by QuHno:

PS: Didn't know that opera.userjs is an object, too. That would have made several of my testscripts easier. Where is the full documentation of the opera object? I somehow can't find it, may be because of wrong search terms...



opera.userjs is not native object, my script creates it:
opera.userjs = opera.userjs || {};
opera.userjs.extscripts = {};

I test it for existence only because I use it in some other user scripts.

BS-Harou Wednesday, September 29, 2010 3:24:19 PM

New version uploaded (1.2.5) with "Классный конкурс на свадьбе +3" fix and optimized memory usage.

QuHno Wednesday, September 29, 2010 6:03:28 PM

Works cheers

AnuaR ShInDigazzZ Thursday, September 30, 2010 10:17:09 AM

QuHno Thursday, September 30, 2010 1:25:44 PM

They use:
z-index: 16777260; bigeyes
where 10 would have been enough. That's a bit more than the
z-index:100000;
in the script.
Just replacing it by 16777261 solves the problem smile

Good that CSS doesn't support exponents, I think Reuters would use it lol

BS-Harou Thursday, September 30, 2010 2:04:02 PM

Originally posted by QuHno:

They use:
z-index: 16777260;



omg, they are crazy bigsmile ... anyway, thanks for the help I will fix it soon)

AnuaR ShInDigazzZ Friday, October 1, 2010 3:57:15 AM

Settings for Twitter are not remembered. After opening and closing Twitter's page i have to re-include external (same) scripts.

User JS Storage Quota = 1024000

QuHno Friday, October 1, 2010 4:30:38 AM

I think the youtube problem is caused by Opera itself because of the way it handles the flash content, that could be out of control for a userJS.

A different approach for the script could be injecting the the code at the top of the page and pushing the whole page down (like i.e. the search toolbar) but that wouldn't look as nice like now...

BS-Harou Friday, October 1, 2010 5:12:51 AM

Originally posted by QuHno:

think the youtube problem is caused by Opera itself because of the way it handles the flash content, that could be out of control for a userJS.


+1

BS-Harou Friday, October 1, 2010 2:04:35 PM

Originally posted by InDigazzZ:

Settings for Twitter are not remembered.



yes, thats because of different number after the "?". This will fix the white list, but I'm also thinking about some possibility to enable/disable script with any query string - but I haven't find any good solution for this yet.

btw I found a way how to fix the flash problem. I will just set visiblity: hidden to all object elements while userJS window is opened =) but you have to wait a bit longer for new version because I started working on the white list and it will take some time.

AnuaR ShInDigazzZ Friday, October 1, 2010 2:22:12 PM

1. Go to Блоги в Казахстане на YVISION.kz
2. Call the ExtScripts.
3. Try to turn on/of some scripts.

BS-Harou Friday, October 1, 2010 2:33:29 PM

Originally posted by InDigazzZ:

1. Go to Блоги в Казахстане на YVISION.kz
2. Call the ExtScripts.
3. Try to turn on/of some scripts.


that is the same problem as I was describing above...

AnuaR ShInDigazzZ Friday, October 1, 2010 5:55:55 PM

What do you mean? I do not
mean that the settings are not
remembered, but that can not
disable scripts (same domain). There's no
reaction to clicks ...

BS-Harou Friday, October 1, 2010 5:59:46 PM

Originally posted by InDigazzZ:

There's no
reaction to clicks ...


Sorry, my mistake, you are right =)

BS-Harou Saturday, October 2, 2010 7:22:16 PM

Version 1.2.6 with white list uploaded =). I've also (at least I hope) fix all here mentioned bugs including the flash problem.

White list is working similar to implicit Opera content blocker. That means that you can use "*" like a "any character(s)". Data of white list are saved in script storage, so if you are going to use it I suggest you to increase the quota =)

btw do you have any ideas what all should be in help section? =)

QuHno Sunday, October 3, 2010 12:31:14 AM

This:
"In the white-list (W) you can use "*" as a wildcard that matches every set of characters." bigsmile
May be with an example or two.

OK, this too:
"Clicking on the colored dots before the URLs blocks or unblocks scripts. Green stands for unblocked, red for blocked and blue for a white-listed entry that is allowed to work even when you set block all external or same domain scripts in the settings panel (S).

You can block a script by clicking at the green dot and unblocking it by clicking on the red dot. Clicking on the URL of the script will open it as readable text in the browser for further inspection.

You can return to the scripts listing by clicking on "<""

The alert if no quota is set is there, so that part isn't necessary in the help.

But it would be better if a native English speaker would write the text, I can read much better than I can write and I know that the text above is not good enough wink


Then my last wish and I'll be fully comfortable with this script:
It would be fine if an URL could be copied from the start "screen" to the white-list prompt. That could help avoiding typing errors - at least mine bigsmile

PS: That was fast work, no complaints but compliments! Good work! cheers

Write a comment

New comments have been disabled for this post.

May 2012
M T W T F S S
April 2012June 2012
1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30 31