My Opera is closing 1st of March

Croquemichette

Un blog qui veut dire tellement de choses...

The end of a story...

, , , ,

Pour ceux qui ne le savent pas encore, Opera 11 supportera les extensions. Une des premières extensions sera WOT.

For those who don't know yet, Opera 11 will support addons. One of the first will be WOT.

Une fois qu'Opera 11 et cette extension seront disponibles, je vous conseille de les utiliser et de dire adieu à mon UserJs ninja

Once Opera 11 and this addon will be available, I suggest you to use it and say good bye to my UserJS.

spock

Bonjour Madame, Bonjour MonsieurQuel serveur HTTP utiliser ?

Comments

QuHno Friday, October 15, 2010 10:21:55 AM

Snif... <insert smiley with handkerchief here>


Thank you for all your efforts to give us the UserJS! smile

It was fun as long as it lasted, but don't despair:

Some Opera users will still need your services in the future idea

Those poor Mac PowerPC users will never come into the situation to use the WOT extension, because 10.6x is the last version that supports that processor architecture ...


BTW: Extensions are written in JS too (+ a little bit more stuff around, but that doesn't count much, the main work is done by the JS), I hope they didn't copy shamelessly parts of your code without giving credit wink

PHcphr666 Friday, October 15, 2010 12:12:11 PM

Originally posted by QuHno:

BTW: Extensions are written in JS too (+ a little bit more stuff around, but that doesn't count much, the main work is done by the JS), I hope they didn't copy shamelessly parts of your code without giving credit


I don't think so, it sucked bigsmile
I'm better now smile

j.Paradiseparadj Thursday, October 21, 2010 11:39:37 AM

Moi aussi, je tiens à vous remercier pour vos talents avec WOT pour Opéra
et depuis Opera 11 est pas tout à fait ici pour l'instant ..
Je vais continuer à l'utiliser ... smile
comme il l'a sauvé mes fesses de plus d'un site de Troie.


I too want to Thank you for your talents with WOT for Opera
and since Opera 11 isn't quite here yet..
i'm going to keep using it... smile
as it has saved my butt from many a trojan site.

QuHno Thursday, October 21, 2010 12:06:24 PM

Originally posted by PH`:

I'm better now


Write an extension, I would suggest a WOT extension because there ain't one p

It is like the widgets API, with xhdr and script storage, should be a piece of cake for you bigsmile

Arun Kumarmarunkmr Monday, October 25, 2010 12:08:56 PM

Originally posted by QuHno:

Write an extension


Ya you should do that because you have great programming skills..

PHcphr666 Monday, October 25, 2010 3:58:08 PM

Well, I won't, but thanks smile

Arthur WilkinsonGT500 Thursday, June 16, 2011 10:57:02 PM

I'll be sad to see this script go. I didn't want to upgrade to Opera 11 (I hate extensions, and I don't want a browser that supports them). Unfortunately, the most recent version of your script is having issues on YouTube (once a video starts playing, nothing in the page responds to mouse clicks except for the video player, and none of the thumbnails for related videos will load).

Disabling the only other UserJS I have installed doesn't make a difference. Issue is definitely caused by the WOT script... I guess I have to decide whether or not I want to live without WOT. I don't need it for work anymore, so its not as big of a deal these days.

Edit: After further YouTube usage, I've noticed that the issues are not completely gone. YouTube works a lot better without the WOT script, but I'm still having occasional issues. Maybe I'll just install Fedora in a VM and use Konqueror.

PHcphr666 Tuesday, August 9, 2011 9:51:24 PM

Hi,

You can try to disable the script on Youtube.
At the top of the script, you should see a lot of @include.
After all these includes, add a new line :
@exclude http://*youtube.com/*

That way, the script will be disabled on Youtube smile

QuHno Saturday, August 20, 2011 7:51:05 PM

btw: The official WOT extension still sucks ...

... and your script needs a small update for one of the major search engines - the crap thing with instant, you know? wink
I know at least one Apple user who still needs the userJS because he has an old, but reliable PPC and can not update to Opera 11 because Opera decided not to make a PPC version ...

PHcphr666 Tuesday, August 23, 2011 7:40:03 AM

btw: The official WOT extension still sucks ...


I know, and I still use mine ninja

... and your script needs a small update for one of the major search engines - the crap thing with instant, you know?


Hum... I thought no one uses Google bigsmile

QuHno Tuesday, August 23, 2011 9:44:49 AM

Originally posted by PH:

Hum... I thought no one uses Google bigsmile


*I* don't use it if possible and I know how to shut that instant crap off without disabling JS generally p

... but Google has a market share of 99% for searches here (really!) and the script breaks with the new Bing images too ...

PHcphr666 Tuesday, August 23, 2011 8:28:22 PM

The problem with these Web2 result pages is that I need to read the Javascript code in order to understand it (or simply prototype XMLHttpRequest).

Then, I could listen to the right events, and call WOT.

It needs some time sad

I could try.

QuHno Wednesday, August 24, 2011 4:51:07 AM

Changing the prototype is so EVIL - I like the idea. bigsmile

... but may be just listening to changes of the body or the results container and restarting the script after a change could be enough, may be with a little timeout, to avoid too many repetetive restarts ...

Bing image search: Tapping the scroll event and restarting the script afterwards could work too. Bing seems to load the new contents as soon as you stop scrolling. (funny side effect if I use an auto-scroller: No reloads before I don't stop auto-scrolling, I have to stop it to get the new results bigsmile)

QuHno Monday, October 31, 2011 2:30:47 PM

bump bigsmile

http://userscripts.org/scripts/review/105887

prototypes the XMLHttpRequest and seems to work quite fine, so the "simple" way should be enough. Could work on bing images and other AJAXian pages too ...

PHcphr666 Friday, November 4, 2011 11:14:11 AM

Originally posted by QuHno:

... but may be just listening to changes of the body or the results container and restarting the script after a change could be enough, may be with a little timeout, to avoid too many repetetive restarts ...


I tried that, but DOMNodeInserted and DOMSubtreeModified didn’t fire anything sad

QuHno Friday, November 4, 2011 6:09:35 PM

Yes, I ran into that too, I have some troubles with one of my own scripts... :|

In 11.60 or 12 they fire but that wouldn't help the Mac PPC users because they can't use 11 or 12. Prototyping works in the 10 series too, so that seems to be the way to go.

QuHno Thursday, January 5, 2012 12:44:13 AM

I read up a little bit and scribbled much and found out:
Tapping XMLHttpRequests works without breaking the pages!
See my clumsy solution:
http://my.opera.com/QuHno/blog/2012/01/05/tapping-xmlhttprequests

I watched the error console during several surf sessions and looks as if it should be safe to use the .apply() method.

Just one ouestion, because your script is quite complicated (for me):

Is it enough to call
startBrowsing()
from the tapping script to restart the WOT script? (just as a quick hack, to get it working with those pesky AJAX pages like Google Instant and Bing Images etc.) or are further actions needed?

I thought about an additional timeout, that can be re-triggered to avoid too many calls to the API, but I don't know if that is really necessary ...

QuHno Friday, January 6, 2012 9:41:29 AM

Sorry for the three posts in a row, but I couldn't edit the older posts any more.

I experimentally added the above mentioned code to the modified WOT script version and it seems to work so far smile
... but the changed code really needs a JS expert review, my changes look awfully out of place and I am sure that there is a lot room for improvement awww

The script is here

PHcphr666 Wednesday, January 11, 2012 7:07:08 PM

Hi QuHno, Happy New Year, best wishes smile

I read what you did to the XMLHttpRequest object. It’s not bad, but I think you can do better.

XMLHttpRequest.prototype.nativeOpen = XMLHttpRequest.prototype.open;
XMLHttpRequest.prototype.open = function(method, url, async, user, password) {
   // your modifications
   this.nativeOpen(method, url, async, user, password);
}

That way, you don’t have to use the apply method, and work in this scope. I did it for another script.

Originally posted by QuHno:

Is it enough to call startBrowsing()


I guess so. It restarts the browsing of the new content. That’s what I call it everywhere in the script.

PHcphr666 Wednesday, January 11, 2012 7:19:00 PM

About what you did wth the experimental WOT script, you should be very careful when you prototype a native object like XMLHttpRequest.

Because when you do that, you modify the global native object (userd by the page, other scripts, etc.).

So, in your example, you modify the object, and if some code makes an XHR request, it’ll call startBrowsing. Whatever the query is, and the content it needs to retrieve. So I guess you should filter the call of startBrowsing only to known URL (Google Instant & Bing).

QuHno Thursday, January 12, 2012 5:13:49 AM

Your answer shows exactly why you are predestined to make changes to the script, not I. I hadn't thought of the repetitive calls on other pages sherlock

btw: I don't fully understand the code you wrote for the nativeOpen, so a question if I guess right:
Am I right that by writing
XMLHttpRequest.prototype.nativeOpen = XMLHttpRequest.prototype.open;
the the whole XMLHttpRequest.open method and it's occurring events are added as new nativeOpen method of the same XMLHttpRequest object?

If yes:
What is the advantage of doing this over assigning the prototype's method only to a plain variable, as I did?
(function(){
  var open = window.XMLHttpRequest.prototype.open; 
  /*here the rest of it */
  return open.apply(this, arguments);
})()

If not:
Could you please post a link where I can read up how it works? (Or, if it is short and easy enough to explain, explain it here?)

I looked through some documentation but didn't find anything that made clear to me, what the benefit of your method is, apart from being able to use this instead of apply(this, arguments). As I see it, you just add a second open method to the basic prototype in the global context. It could still cause conflicts if someone decides to do the same thing with the same name on his website, or am I wrong? "var open = foo;" on the other hand should stay inside the local scope of the enclosing function (especially if it is an anonymous function) and not be directly accessible from the outside AFAIK.

About filtering:
Good point, may be I should filter the overwrite too, so that it doesn't even start on pages where it shouldn't.

... apart from that, the rating that should pop up when hovering over the circle doesn't show up with my modification (or one of the many Google did lately) and I don't find the reason for it ... cry

PHcphr666 Thursday, January 12, 2012 10:11:48 PM

In my example, I really modify the XMLHttpRequest. The new code can only be executed in the scope of an XMLHttpRequest object.

How can I say it... It’s really hard to explain.

I’d say the call of the .apply, in this case, is just a hack. It’s usually used on DOM events.
For example, when you listen an event on a DOM node (let’s say click), you’do :
previousFunction : function() {},

aLambdaMethodInAObject : function() {
   myNode.addEVentListener("click", function(e) {
      this.myClickFunction(e);
   }, false);
},

myClickFunction : function(e) {
   alert(e.keyCode);
},

nextFunction : function() {}

If you do that, myClickFunction’ll be called in the scope of myNode. It’ll fail cause there’s no myClickFunction in myNode.


To prevent this from happening, you could create a hitch function (You can read a code example here from Dojo) :
previousFunction : function() {},

aLambdaMethodInAObject : function() {
   myNode.addEVentListener("click", hitch(this, "myClickFunction"), false);
},

myClickFunction : function(e) {
   alert(e.keyCode);
},

nextFunction : function() {}

This hitch function calls the method you specified in the scope you specified, with all arguments. That’s what you did in your experimental code.
But, when you have a tool like the prototype property, I suppose you can’t use this hack (in your case, for me, it’s a hack), it’s against nature bigsmile


It’s just like when you create an object from scratch. :
// Just declare a class
function myClass(a, b) {
  this.propertyA = a;
  this.propertyB = b;
}

// Add functions to it
myClass.prototype.render = function() {
  alert(this.propertyA + " / " + this.propertyB + "\n");
}

// Instanciate it
var zz = new myClass(12, 13);
zz.render()


I hope it helped smile

Write a comment

New comments have been disabled for this post.