Skip navigation.

exploreopera

| Help

Sign up | Help

interweb trek

where no nerd has gone before...

Meet meenoo and drag

, , ,

I've previously posted at the forum two scripts to resize textareas.
Now I'll release them here.

Meet the two siblings: power-drag and power-meeno. They complement each other, one being more complete, the other being more broadly usable. Both these scripts started out from the simple desire of resizing textareas easily, alla CSS3 UI. If Safari can do it, then why should not Opera, with some bells and whistles?



Power-meenoo adds a small menu which can be toggled by pressing ALT and hovering a textarea. The menu has many options, and the script is localizable, currently translated in english, portuguese (duh p:) and polish (credits to Wasacz). The options are self explainatory, so you can bore yourselves trying them.

Power-drag is simply cool. Probably I should call it "awesome script"? Pressing your shift key then hover textareas, select boxes, iframes, objects, images or input fields to simply resize them by dragging its lower right corner. Simple, clean and efficient. Double click to restore the original dimensions. You can enable the dragging corner always, or use another modifier key. The script requires shift by default because makes the script less intrusive, and does not cover small elements in the page, while having a smaller performance impact.

One script DOES NOT require the other to function properly. They're independent.

Now, you might recall these scripts from the forum. Power-meenoo now requires alt because ctrl is usualy associated with clipboard shortcuts, shift with selections, so that leaves us with alt which is usually associated with menus, so it fits well.
The old scripts you had resize-textarea-util.js and textarea-drag-resizer.js are therefore deprecated. Please delete them if you want to download one of these scripts.

Get them here.
power-drag
power-meenoo

As always, updates will be annouced in the blog post, and the links always point to the most recently updated files..

Spammers using M2?

, , ,


Using Opera's revolutionary e-mail client

chuck norris

SQL challenge

Now for something technical, unrelated to web dev and Opera…:alien:
I joined my company in March 2007, and since then I've worked mostly in Oracle. Back then, I only had a theoretical knowledge of databases, but meanwhile I learned a lot in most areas, and now I'll fairly comfortable working with a big database.
In many technologies you’ll always find fun stuff to do. So know I post you a contest:
Which is the smallest possible query you can write, that'll take the longest to execute?
This is solely an exercise. I won't buy you a pack of peanuts monkey if you beat everyone else to the answer.
Some notes:
  • it may work only in a specific database
  • you can only use builtin functions, if any, not custom ones.
  • your answer must be solely a SQL query, the name of the database the query runs and an explanation of how it works.
  • doing wild Cartesian merges is not the answer, like
    select 1 from dba_objects, dba_objects, dba_objects, dba_objects, dba_objects, ...
    for Oracle. When you find that the query takes an eternity to execute, you can still add another dba_objects to the FROM clause and you’ll go beyond eternity, while making the query fatter and therefore beating the prime purpose: to be the smallest


Good luck! The challenge is on. :cool:

P.S.: Yes, I have a possible answer and I think I already gave enough hints :wink:

Plugsome Toolbar

, , , ...

I present you, right from xErath labs, beign these a two year old laptop (which works just fine), the "Plugsome Toolbar" user javascript. It's fairly simple to use, and very useful.
In the screenshot that follows you can have an idea of what it does::cool:



This script is an utility that add a small toolbar to plugins in webpages.:raider:
The toolbar by default has 3 buttons:
  • the 1st button is a Reload button which reload the plugin content
  • the 2nd button is a link to the external file that the plugin loaded. Somefiles might get special treatment, like in youtube. Instead of linking to youtube's media player swf, the script links to the video file. Click this link to save the file.
  • the 3rd button is a X which if clicked closes the toolbar, and if double-clicked removes the toolbar and plugin from the page. The space that the plugin occupied is preserved though.
The toolbar is dimmed by default, and it'll highlight when you hover it.
If the toolbar is attached to a Flash file, then you get two extra buttons: a play and a pause button. Note however, that play and pause might not pause/resume plyback in all flash files. This is due to the file's internal structure, and the way content is layed out in the Flash's timeline.

Download link:
xerath-plugsome-toolbar.js
Further updates will be annouced, the link above will point always to the latest version.

Technical details
like I've said, the script applies different treatments to differents objects in different website, when returning the link to the file which feeds the plugin.
The script already support youtube.
To add your custom behavior for a specific website, the user script exports a small interface.

All functions and variables are grouped in the opera.PlugsomeToolbar object.
The object has the following properties:
  • version - script version
  • URLHandlers - an object with host names and custom functions to apply to a html OBJECT or EMBED to have the link that is available in the toolbar.
  • URLHandlerFallback - a fallback function that should be called when custom functions in URLHandlers require to work asynchronously, but fail to retrieve the file url
  • AllToolbars - an array with all the instantiated toolbars in the current page.
The object looks like this:
a.PlugsomeToolbar = {
    version: '1.0',
    URLHandlers: {'a':...}
    URLHandlerFallback: function(){...},
    AllToolbars: [...]
};

To code your own website rule, do something like this:
opera.PlugsomeToolbar.URLHandlers['.youtube.']=function(object, link){
    var fv = object.getAttribute('flashvars');
    if( fv ){
        /* ... */
        link.href = 'http://www.youtube.com/.....';
        return true;
    };
};
You can, and should place it in another file, because that way you can easily upgrade Plugsome Toolbar without loosing functionality.
The functions in URLHandlers receive 2 arguments, the plugin and the toolbar link to fill in the href. Each function returns true or false, respectively, in case of success or fail. The script, for each plugin, loops through all rules and aborts when one returns true, meaning that the link is known.



cow You might find the name "Plugsome Toolbar" familiar. The original one was invented to feed hype for a specific piece of software, when others did the same thing that the former advertised.
But we're not here to talk about Firefox,... whoops, I said it... :whistle:

EDIT (2008-June-11)
New update, version 1.0.2.

Changelog:
  • Option to show toolbar when plugins are disabled
  • Added Quicktime and windows media player controls toolbar
Note: the quicktime controls may not work in. It seems quicktime scripting is broken in Opera. But the work is done, until Opera get fixed.

Url filters - The Discipline of Annoyance & Demise

, , , ...

Note: title kindly adapted from Emperor's 2001 album

Lets do a little experience. :idea:
1. Go to the website http://www.asdf.com/
2. Select block content from the right-click menu
3. Add http://www.asdf.com/* to the blocked urls.
4. Now open this url. Here's what you see

5. Go to a unexistent website like http://foo.bar/. Here's what you see

Can you make the difference ? No ? Look a little closer, approach the screen a bit, observe from different angles. Still can't see the different ? Well, the second website has some red in it. :eyes: Homer: Doh!

What does this mean ?
Whops ! You stumbled upon a invalid domain and Opera cannot connect. But what about the 1st case ? Opera deliberatly blocked the url. :devil:

Now imagine that you just downloaded one of those ad lists online. You start to wonder..hum ! Opera can't render this webpage. It's a Google conspiracy for sure.:sherlock:

Most filter files encoutered online are too generic, and hit too many false positives.
Consider the case described in this thread.
The user complained because Opera blocked an image which add "/ad4" in it's base64 content. Well too bad. You downloaded a too generic filter file, now you hit some false positives. But he was lucky to solve the problem with such a simple case. If you check the OP's filter file, whenever there should be either a dot and an wildcard, or wildcard and dot, there is no dot, becaise the person that did that filter file didn't consider that ad4 could ever be part of a valid url, which that rule would happily block.:ninja:

Now, why did I initially approach this subject with the asdf.com example ?
Simple. Opera currently does not provide any way to tell the user that some content is blocked. Iframes get blank, not loaded scripts go to the error console and that's it. Opera definetly needs a friendly error page telling the user that a url was blocked. If so, the user would then inspect either the info panel, or whatever, to realize that there is blocked content.:faint:

As an extra case, I once saw a user complaining he couldn't open any website that started with http://count*
Where do I recognize that ? Most statistic website's domains start with count. So the poor used downloaded a bad filter file, and actively contributed for Opera not being part of statistics online. The author of that filter file must be proud.:furious:

Conclusion: don't accept generic filter files out of ignorance. First inspect them. Tamil has a almost good list, but I consider it too generic. My personal filter file has a very little amount of generic rules. The rest is all full domains, and I rarely see an ad.:yes:

Happy browsing (without annoying ads). :wink:

Developer tools unleashed

, ,

Allas ! The wish of many developers and Opera fans was partially fulfilled ! Real developer tools officially supported in Opera :yes:
See some screenies
I personally have my own tools, but Opera's ones seem much more polished, and since they're in javascript, they're fully editable. :yes:

But, being me the techie person I am, aka geek, and knowning that the tools announced at dev.opera are scripts, I opened my menu.ini, and saw the following
[Advanced Tools Menu]
Item, 69887            = Manage cookies
Item, 69888        = Manage wand
Item, 920136405    = Content block details, 1
--------------------1
Item, 50838            = Go to page, "opera:plugins",,,"Blank"
Item, 50835            = Go to page, "opera:cache",,,"Blank"
--------------------3
Item, 54122            = Show Java console
Item, 67476            = Show Message console
Item, "Developer Console"="Go to page, "javascript:(function(){var ele=document.documentElement.appendChild(document.createElement('script'));ele.src='http://devfiles.myopera.com/tools/developer/8679/devConsole.js';ele.parentNode.removeChild(ele);opera.tools.console.open();})();", , , " ""
--------------------4
Item, 51212            = Refresh display


Neat, uh ? :right: hum, maybe not.
What happens if you are offline, or have javascript off ?
Besides, the script is 170kb, which takes time to download, or check if it's not modified, therefore the menu entry does not respond instantelly, which is a usability problem.

The solution is simple. Download the file http://devfiles.myopera.com/tools/developer/8679/devConsole.js to your user js folder, and add this as a bookmarklet, or replace the Developer Console command with
javascript:(function(o){if(o&&o.tools&&o.tools.console&&o.tools.console.open)o.tools.console.open();})(window.opera);
and you're done.

Don't forget to periodically check for the script version.

Happy development ! :yes: :hat:

The world through a Google

, , , ...

Note: I'm not in any way affiliated to Opera Software or Google Inc. The opinions expressed here are my own only :spock: .

After having gained some notoriety, both in this community, and outside, I feel like I should announce probably the most useful user script I've made. Unlike what you may think it's not an enhancement, but a unified patch from some of the most awful discrimination on the web: Google services.
Unlike what many not-so-techie-people think, Google is not superman.
quiris asked me:

Originally posted by quiris:

Many Fx zealots complains in comments that it's Opera fault, not Google's. So xErath, could you explain the all patched problems in Google services are necessary because of bugs in Opera or rather because of Firefox/IE-centric code?
Here's the answer for you all. No software is flawless, all have problems, quirks and bugs to workaround. I not saying Opera is bug ridden. Much on the contrary, IE has some of the worst DOM support ever, and Mozilla too has it's quirks and mis-behaviours. As consequence, developers make their applications against browser behaviours instead of the specification. This eventually breaks Opera which gets some workaround for one of those browsers bugs, which misbehaves, or too hits a bug which needs a workaround. So it's a bit of all issues, browser specific code, Opera quirk, or bad object detection.
For many of those Google services to work, the compatibility would be ensured by fixing problems on both sides. Guess what? Opera is doing its job, but Google isn't because they probably feel like 1% of the market and the Wii users aren't worth it. Google definitely doesn't like you.
So I avenged many Opera users, and did a patch for many Google services to work in Opera, mainly because I use Google too a lot.

Where's a description of what the script does:
  • Google spreadsheets - nothing much to fix. Simply reverses the mousewheel, so when you roll it down, the pages goes down. It's a known quirk. Then it warns the user to Mask as IE, if it's not, which is the only way for the site to work. If the browser is Masked as IE, the page tries to use IE's css filters to display transparent PNGs. So there's a workaround for this one too.
  • Google Calender - simply makes the "browser not compatible" notification to go way, and for the create event date popups to work.
  • Google Picassa Web - simply overrides bad browser sniffing. Now the website works just fine, including the slideshow (shame on them :irked:)
  • Google Docs - this is more complicated. The writely team, which built the editor you see thrived to have their application working in the 4 major browsers: IE, Moz, Opera and Saf/Konq. The word Safari is scattered all over the code, to workaround it's problems (Safari's DOM was weak at that time). But then Google ate writely, and all efforts for interoperability were squashed. The patches fixes many issues related to bad object detection, and overrides a few quirks in Opera.


I hope you put this script to good use, and have more fun using it, than I have writing it :right: .

Here you go:
fix-google-services.js

Next stop for me might be Google Page Creator, because it seems to share components with the new Google Groups beta. Refer to this post for updates.

Edit: BtEO worded wonderfully mine and other Opera's power users sentiments.

Edit 2 (21-april-2007): I have no intentions of bad mouthing Writely's developers, which previously showed interest for Opera. It seems after all, that one of the major blockers for Safari, are bugs related to selections and designMode, although the current Safari 3 nightlies seem promising. In the mean time, there was a little update to google docs javascript code a bit more Opera friendly. Thanks to them.
I've done some heavy work with google pages, but it's a nut terribly hard to crack. Google pages developers really only care for 2 browsers, which flooded the code with a enormous amount of browser quirks usage, or using Mozilla or IE's bugs as features.
I'm aware that spreadsheets isn't working fine. IT seems a bit unstable: most of the time it works, but them all the sudden is seems broken. I have no intention of debugging more. If you want a real spreadsheets application try EditGrid.
Currently I have little time to improve the script, so contributions are wellcome.

Note: script updated last 14th of March