Tag Archives: opera

And finally, Ubiquity for Opera v2.0!

Yes, I'm still working on this. It's so cool… :-)

This version, named 2.0, is a partial rewrite that allows most native Firefox Ubiquity commands to run unaltered. If you like Ubiquity, check out the UserJS forum announcement, or read the help page (with screenshot).

Download Ubiquity.js v2.0 and if you have suggestions for new commands, tell me!

Yet another post about Ubiquity

Yeah, sorry, but it's so exciting… :-)

In my development version now I'm able to run unmodified Firefox Ubiquity commands!
Yes, original Firefox Ubiquity JS commands can be run in the Opera version.

That's great! Of course, not all of them can work. Most of the Ubiquity internal objects are mocked, but nonetheless they work. So now I'm going to rewrite the command list as they were pB]native[/B] ubiquity commands and adapt all the code to this new structure.
This is an example of a native Ubiquity command:


CmdUtils.CreateCommand({
  name: "validate",
  icon: "http://www.imageboo.com/files/uhee2ii315oxd8akq0nm.ico",
  description: "Checks the markup validity of the current Web document",
  preview: "Sends this page to the W3C validator",
  execute: function() {
    var url = "http://validator.w3.org/check?uri=" + Application.activeWindow.activeTab.document.location.href;
    Utils.openUrlInBrowser( url );
  }
})

Cool!

Ubiquity for Opera 1.0 released!

The "nightly experiment" now is something more. Actually I am very surprised to see the amount of stuff I could do with "just" user javascript. It's already beyond my initial thoughts.

So now the plan is to convert it to a widget and get the full widget power, XHR, notifications, sticky preferences, and all that. Then, to complete the Opera version, I would only need to load real Ubiquity command RSS feeds. But that's probably not going to happen anytime soon…

Download Ubiquity for Opera v1.0

The usual warning about the default ubiquity shortcut, CTRL + SPACE, which is used by default in Opera as "homepage" shortcut. You have to remove it, or modify the javascript to assign it another shortcut.

Enjoy!

Ubiquity for Opera – UPDATED

Check out an update to the last post about the Ubiquity for Opera project I just started.

This is getting more serious than even I expected. At this point, you can see that it's not like the real thing yet, but it starts to be reasonably cool. For me, this is already past my best expectations.

If you install and try it, please give me your feedback and, most important, if you have some cool commands you want to add, just tell me. Opera's UserJS can't do everything though. They can't access remote sites via XMLHttpRequest because of security reasons.

But even with this limitation, I think the result is worth a try. Anyway, I realize that the power of Ubiquity is really the power of the Opera's location bar and custom searches, which are already builtin in every Opera standard browser :-)

There's one really nice feature in the translate command, and it's that it can automatically translate for you 3 kind of inputs:

  • the text you enter at the prompt
  • if no text, the selected text on the originating page
  • if still nothing, the current window (by URL)

This solves all my translation needs! :-)

Command list follows:

  • amazon-search
  • answers-search
  • ask-search
  • back
  • bugzilla
  • close
  • command-list
  • define
  • ebay-search
  • flickr
  • google
  • gcalculate
  • help
  • image-search
  • imdb
  • lastfm
  • map
  • msn-search
  • myopera-blogs
  • myopera-photos
  • new-tab
  • opera-config
  • opera-cache
  • print
  • refresh
  • search
  • skin-list
  • translate-no
  • weather
  • wikipedia
  • yahoo-answers
  • yahoo-search
  • youtube

Enjoy!

ubiquity.js

Ubiquity for Opera


I think Ubiquity is a pretty cool project, probably a bit overrated, but …
I thought it would be nice to try to build something like that for Opera, and learning UserJS along the way.

I managed to get the basics working. Right now, there's only one command, tran-no which takes you to the Google Translate page from Norwegian to English. If you have selected some text before bringing up "Ubiquity" (CTRL + SPACE), then typing tran-no + ENTER will translate that text for you.

Now I was trying to make it replace the text inline inside the page, instead of popping up a new tab with the Google Translate window. It seems that is somewhat harder, especially because the text you select might be broken up in several pieces, like:


This might be <b>your text</b>, so how do you   replace it?

Here it is: ubiquity.js

Why Opera doesn’t work with some web sites? Part 1

Today I received a mail from a friend. Some weeks ago, he tried Opera and then contacted me, reporting some problems with the Vodafone web site. I couldn't reproduce them because a personal account was needed.

Today he got back to me, reporting another site, Adecco's. This time, no login was required, so I could dedicate some time to investigate a bit more on what was happening.

The page is the following, from the Adecco italian web site:

http://candidate.adecco.adeccoweb.com/ecit/_General/DataPages/newCandidate/candidatesearchoffers.asp?MenuSelectedLevel1=115&Selected=1

It's just a simple form, with some SELECT controls and submit button ("Cerca…").
The problem is that using Opera the submit button does not work.

So, I fired up the javascript errors window, and I saw:

JavaScript - http://candidate.adecco.adeccoweb.com/ecit/_General/DataPages/newCandidate/candidatesearchoffers.asp?MenuSelectedLevel1=115&Selected=1
Event thread: click
Error:
name: TypeError
message: Statement on line 46: Cannot convert undefined or null to Object
Backtrace:
  Line 46 of inline#2 script in http://candidate.adecco.adeccoweb.com/ecit/_General/DataPages/newCandidate/candidatesearchoffers.asp?MenuSelectedLevel1=115&Selected=1: In function multiple_TypeBusinessLines
    	for(x=0;x<obj.length;x++){
  Line 81 of inline#2 script in http://candidate.adecco.adeccoweb.com/ecit/_General/DataPages/newCandidate/candidatesearchoffers.asp?MenuSelectedLevel1=115&Selected=1: In function cmdSearch_onclick
    		vTypeBusinessLineId= multiple_TypeBusinessLines().join(gCARACTER_SINGLE_SEPARATOR);
  Line 1 of function script 
    cmdSearch_onclick();
  ...
stacktrace: n/a; see 'opera:config#UserPrefs|Exceptions Have Stacktrace'

Ooook. Time to learn Dragonfly a bit more… I fired up Dragonfly, and I dug my way through the innards of this site javascript files. It turned out the "interesting" bits are here (javascript ahead):

http://candidate.adecco.adeccoweb.com/ecit/_includes/jscommonbrowser.js

If you open up this file in your text editor, you will see a getObject() function:

//-----------------------------------------------------------------------------
// getObject
//-----------------------------------------------------------------------------
//	Convierte una cadena con el nombre de un Objeto en la referencia
//	de un objeto. 
//-----------------------------------------------------------------------------
function getObject(obj) {
	var theObj;
	if (typeof obj == "string") {
		if (oBrowser.ns6 || oBrowser.ie5) {//si es Netscape6 o Explorer 5
			theObj = document.getElementById(obj);
		} else {
			if (oBrowser.ie4) {//si es Explorer 4
				theObj = document.all[obj];
			}
		}
	} else {
		theObj = obj;
	}
	return theObj;
}// getObject

So, what's wrong with this function? Who wrote this probably wrote it some years ago, because it's still testing for MSIE 4.0 or 5.0, or Netscape 6. Well, no wonder it doesn't work for Opera. Maybe it doesn't work for Safari either, nor for Chrome.

Anyway, time to fix this. How? As Hallvord said on dev.opera.com, it's probably a good idea, and this script shows it, to avoid testing for browsers. Let's test the functionality instead. We need getElementById().

What about this revised version:

function getObject(obj) {
  var theObj;
  if (typeof obj == "string") {
    if (document.getElementById)
      theObj = document.getElementById(obj);
    else if (document.all)
      theObj = document.all[obj];
  } else
    theObj = obj;
  return theObj;
}

I reported the problem through the Adecco web site contact form.
Let's hope that someone will consider it…

Main browsers memory usage

Here's the results of a small "experiment" I made today. I wanted to directly compare memory usage of as many different browsers as possible. I understand it's not a really scientific experiment, but I think it shows some interesting results nevertheless.

You can try it too, and report your results if you want.

So I setup this test on my machine, Windows Vista 32 bit, 3 Gb of RAM, a fresh new account and:

  • Microsoft Internet Explorer 7.0.6000.16764
  • Mozilla Firefox 3.0.4
  • Apple Safari 3.2 (WebKit 525.26.13)
  • Google Chrome 1.0.154.43 (WebKit 525.19)
  • Opera 9.63 (Build 10476)
  • Opera 10.00 Alpha (Build 1139)

For every browser, I fired up the same 3 tabs:

I kept every browser opened, but I had to switch between Opera 9.63 and Opera 10 because Chrome doesn't distinguish between the different Opera processes. I guess because both are named opera.exe in the Windows process list. However…

I used the about:memory tab of Chrome to find out the memory usage statistics. However, I could have used the Windows task manager in the same way, or FAR's process list plugin.

Here's the results:

So here we can see that Firefox and then Opera use the least amount of memory, with a few Mbytes of difference. In Firefox 3 Mozilla worked a lot to keep memory usage low and this (basic) results confirm it. Again, not to defend Opera on this, but Opera has Ad Blocker, Speed Dials, Bookmarks+ Sync, a full Email client and what-not already builtin. It would be nice to do another test with Firefox plus the most popular and used extensions…

And now we can compare the situation when we remove Opera 9.63 and add Opera 10,
which is still in alpha stage:

Another impressive result is that Opera 10 uses less memory than every other browser, and at the same time adds support for WebFonts, passes Acid3 with 100/100, has a new Spell Checker… Do you need more? :)

New T-shirt design


#!/usr/bin/env perl


                                                       ''=~("(".
                                                '?'.'{'.('`'|'%').("["^
                                           '-').('`'|             '!').('`'|
                                        ',').""".                  '#'.'!'.'/'
                                      .('['^'.').                    ('['^"(").(
                                    '['^')').'/'                      .('`'|'"').(
                                   '`'|(')')).(                        '`'|'.').'/'.
                                  ('`'|('%')).(                         '`'|'.').('['
                                 ^'-').(('{')^                          '[').('['^'+')
                                .('`'|('%')).(                           '['^')').('`'|
                               ',').('!'^'+').                           ('!'^'+').('['^
                              '+').('['^')').                            ('`'|')').('`'|
                              '.').('['^'/').                            ('{'^'[')."'".(
                             '`'^'*').(('[')^                            '.').('['^'(').(
                             '['^'/').(('{')^                            '[').('`'|'!').(
                             '`'|'.').(('`')|                            '/').('['^'/').(
                       '`'|'(').('`'|('%')).(                            '['^')').(('{')^
               '[').('{'^'+').('`'|'%').('['^")").(                     '`'|',').(('{')^
         '[').(('`')|        '(').('`'|'!').('`'|'#').('`'               |'+').('`'|'%').
      ('['^')')."'"          .','.('{'^"[").   '\'.'"'.('\').         '\'.('`'|".").
    '\'.'"'.";".(           '!'^'+').("["^       '+').('['^')').(     '`'|')').(('`')|
   '.').('['^"/").(          '{'^'[')."'".(         '{'^'[').(('{')^   '[').('{'^'['). 
   ('{'^'[').('{'^'[')         .('{'^('[')).(            '{'^'[').('{'^'[').('{'^"[").( 
    '{'^'[').('{'^'[').        '.'.'.'.('.').(             '{'^'[').('`'|'!').('['^'/')  
     .('{'^'[').('`'^'/')       .('['^('+')).(               '`'|'%').('['^')').("`"|  
       '!').'!'."'".(',').(      '{'^'[').'\'                 .'"'.'\'.'\'.(('`')|   
         '.').'\'.'"'.";".(     '!'^'+').('!'                  ^'+').'"'.'}'.')');    
            $:='.'^'~';$~="@"|    '(';$^=(')')^                  '[';$/='`'|'.';$,=
               '('^'}';$='`'|'!'   ;$:=')'^'}';                    $~='*'|'`';$^=
                  '+'^'_';$/='&'|'@'  ;$,='['&'~'                    ;$=','^'|'
                       ;$:='.'^"~";$~=  '@'|'(';$^                =')'^'[';$/
                            ='`'|'.';$,='('^('}');$=            '`'|'!';$:
                                    =')'^'}';$~='*'|'`';$^='+'^"_";$/=
                                                '&'|'@';$,=('[');

Dr.Dobb’s Journal and “the Broken Web”


Last week I was invited to a "Webinar" organized by Dr. Dobb's Journal about software engineering, "The Future of Software Delivery", sponsored by IBM. I was curious about this so I registered for the event.

On the registration page, there was a link to test your system to see if it met the technical requirements. So I took the test and, guess what? Only Internet Explorer and Firefox were admitted to the party.

So I wrote an email to the guys:

Subject: Dr. Dobb's Webinar event. Required browsers.
To: webcast@techonline.com
Regarding this event:

http://event.on24.com/eventManager/presentation/html.jsp?profiletype=customHTML1&eventid=25571

I'm using Opera 9.5 and I think it's perfectly fine
for streaming purposes. It runs both RealPlayer and
Windows Media Player.

Is there a reason why Opera shouldn't work for this event?
Thanks!

I was trying to send out the message "Strange. Opera should meet the requirements, because it seems we aren't talking about browser here, only video plugins. Can you explain?". Certainly not something like "You suck. Why isn't Opera your first preferred browser, you morons?"

A few days later I received an email from TechOnline.

Hello Cosimo,

You must use either Internet Explorer with Windows Media Player (preferably) or Firefox with RealPlayer to view the webinar. It will not work with other browsers.

Best Regards,
Lenda

Lenda Carter
TechInsights | TechOnline
lcarter@techinsights.com

Uh… This isn't serious.
Something's rotten in the state of The Web.

Open the Web!