Custom Protocol and Content Handlers in Opera 11.60
Custom Protocol and Content Handlers in Opera 11.60 beta
The Opera 11.60 alpha snapshot introduces support for HTML5 custom scheme and content handlers.
Not yet supported are the isProtocolHandlerRegistered, isContentHandlerRegistered, unregisterContentHandler, unregisterProtocolHandler methods which were added to the spec recently.
The idea is pretty simple. Your site can offer to handle certain MIME types or schemes (aka “protocols”) and the user has the option of opting in. One obvious use-case is webmail. For example, a service like Fastmail.fm or Gmail could tell your browser to open its "Compose" page if you click on a "mailto:" link rather than open a native mail application.
Of course, there are reasons why you wouldn’t want to pass off every type of content to a web-app—we want JavaScript and CSS to be handled by the browser, for example—so a blacklist exists. For security reasons, there's also a whitelist for schemes (but with the option to create a custom “web+” scheme).
Protocol Registration
navigator.registerProtocolHandler takes three arguments: the protocol, a URL which points to the custom handler application with a placeholder “%s”, and a title.
navigator.registerProtocolHandler(
"tel", //protocol
"/protocolhandler.html?%s", //handler
"Telephony" //title
);
In a user-agent that supports this, the user will be prompted to allow this registration to happen. Here is how this currently looks in Opera 11.60 alpha:
Once that’s taken care of, all “tel:” links will have the opportunity to be handled by this “Telephony” app. For example: clicking on tel: 555-1234 brings up a dialog asking if you would like to open the link with the just-registered application, or the default.
The browser then navigates to http://miketaylr.com/pres/capjs/demo/?tel%3A5551234. A script can then parse the URL and operate on the “tel%3A5551234” content (in this case, just put the phone number in the phone’s LED).
You can try it out here.
Content Registration
navigator.registerContentHanlder takes three arguments as well: the content-type, a URL which points to the custom content handler with a placeholder “%s”, and a title.
navigator.registerContentHandler(
"text/x-cheeseburger", //content-type
"http://miketaylr.com/code/cb.html?cb=%s", //handler
"Cheeseburger Parser" //title
);
Just like registerProtocolHandler, the user will be prompted to allow the content-type registration to happen.
In this example, we have a custom text/x-cheeseburger content-type parser (see the syntax diagram) to operate on our .cheeseburger files. When we download a resource with the text/x-cheeseburger content-type, our browser will ask us to allow it to open it with our custom handler.
Again, just like registerProtocolHandler, the application is opened with the “%s” placeholder replaced by the URL of resource to be handled. In this case, http://miketaylr.com/code/cb.html?cb=http%3A%2F%2Fmiketaylr.com%2Fpres%2Fcapjs%2Fdemo%2Fsingle.cheeseburger. Now our script can fetch the contents and present it in a colorful way.
You can give it a spin here.About this article
| Published in | ODIN blog |
|---|---|
| Date | November 7, 2011 |
| Author | Mike Taylor |
| Tags | HTML5, cheeseburgers |
| Original | Internet Archive |
dmcb7Friday, November 4, 2011 5:00:08 PM
ChristophFriday, November 4, 2011 5:01:32 PM
Originally posted by Afonso1:
Opera Link - including the passwords - works perfectly here (Did you tickmark the "sync passwords"-item in the Opera Link dialog, which is disabled by default?) Win8 DevP x64slalauretteFriday, November 4, 2011 5:03:45 PM
Originally posted by MossMan:
This is what will happen by default.
Francesco De DomenicoFriday, November 4, 2011 5:06:33 PM
Afonso1Friday, November 4, 2011 5:11:07 PM
Originally posted by christoph142:
Yes I did. lets me try unistall and install againAfonso1Friday, November 4, 2011 5:23:37 PM
PASSWORD SYNC NOT WORKING _ MBP LIONS 10.7.2
OPERA CRASHED ON OPERA PHOTO UPLOAD WITHIN OPERA
PLS HELP
minhoFriday, November 4, 2011 5:33:10 PM
Confirm?
win 7 x64
Afonso1Friday, November 4, 2011 5:40:36 PM
Originally posted by Afonso1:
Apologies i did not IMPORT / EXPORT . I copy the folder ( make a duplicate ) from within user/library/applications support / operanext / mail and them COPY that duplicate (without the name word "copy " to the mail folder from Opera. Hope it helps.BLOBOFriday, November 4, 2011 5:48:06 PM
nesl247Friday, November 4, 2011 5:51:59 PM
Michael A. Puls IIFriday, November 4, 2011 6:01:02 PM
You can goto mail.google.com, paste the javascript URI from here into the address field and press enter to set Gmail as the mailto handler. But, it's a little buggy after a restart and Opera will crash when launching mailto URIs.
minhoFriday, November 4, 2011 6:12:54 PM
win 7 x64
Afonso1Friday, November 4, 2011 6:15:39 PM
Satan D. LuciferFriday, November 4, 2011 6:37:00 PM
just a heads up:)
DanStudioFriday, November 4, 2011 6:52:08 PM
i've told about this problem many times already!
TonyStarkAKAIronManFriday, November 4, 2011 6:55:19 PM
Is it me or the Winamp download visual glitch/bug is still there !
http://s7.postimage.org/fjtjxtj9n/Opera_11_6_Winamp_Download_Bug.png
Thanks.
Manoj ChandrasekharanFriday, November 4, 2011 7:08:21 PM
ClashCityRockerFriday, November 4, 2011 7:11:20 PM
Don't get me wrong. I agree with the statement that it's far more important to do things right rather than rush them, but it would be nice to back that statement up a little more.
minhoFriday, November 4, 2011 7:15:06 PM
Result: http://files.myopera.com/minho/albums/3631672/terra.png
Fix before final release please. This site is a Opera partner in my country.
win 7 x64
BinbiFriday, November 4, 2011 7:21:53 PM
It is true that this year comes out of the opera 12?
When expected Do Not Track?
minhoFriday, November 4, 2011 7:25:25 PM
Originally posted by TonyStarkAKAIronMan:
Same here: http://www.baixaki.com.br/download/opera.htm
Click on "Clique para baixar" green button. Old bug.
Robin GrolleauFriday, November 4, 2011 7:39:30 PM
And opera crash just before I submit this comment.
Windows 7 x64
Intel Core 2 Duo E8600
DrDannyFriday, November 4, 2011 7:48:56 PM
ritmocafeFriday, November 4, 2011 7:57:55 PM
earth01Friday, November 4, 2011 8:04:09 PM
Windows Vista 32bits, USB installation.
ttaveiraFriday, November 4, 2011 8:07:23 PM
For example, I have 'desktopteam' as a bookmark nick to this blog, yet when I type 'desktopt', most of the string, I still have to press down 6 times - skipping the useless Google search results - to reach it.
Please consider this
cousin333Friday, November 4, 2011 8:10:12 PM
1. Open http://na.leagueoflegends.com/items -> scrolling is choppy compared to IE9
2. Click in a checkbox in "Filters" -> 100% CPU load, VERY choppy scrolling
Using latest build (this snapshot) on Win7.
Constantine VesnaFriday, November 4, 2011 8:10:44 PM
slalauretteFriday, November 4, 2011 8:26:22 PM
Originally posted by minho:
Why did you import instead of pointing your mail directory to that folder? opera:config#Mail|MailRootDirectory
I think that if you delete the copied folder and edit that setting you will see all your mails correctly, and you'll be working with one copy instead of two.
Branko86Friday, November 4, 2011 8:27:17 PM
I'm using Win XP Pro SP3 x86
slalauretteFriday, November 4, 2011 8:29:39 PM
Originally posted by DanStudio:
+1. Editing any wiki is a pain in the knuckles.
Marco AdrianiFriday, November 4, 2011 9:01:13 PM
1- The address bar does no more show the nicknames.
2- In the feed-adding screen the only option to subscribe a feed is to use Opera Mail. I use Google Reader to manage my feeds and so I have to manually add new feeds through Google reader's interface.
However, it's a very good idea to split the release 12.00 in two version.
Michael PetrushinFriday, November 4, 2011 9:02:03 PM
And yes, it's sad that I can't downgrade my profile (with mail) from 12.00 (which is pretty stable for me) to 11.60.
JosemeloFriday, November 4, 2011 9:27:49 PM
Debian 6.03_64.
ricksperFriday, November 4, 2011 9:34:42 PM
minhoFriday, November 4, 2011 9:41:04 PM
Originally posted by ricksper:
No.
Rafael LuikFriday, November 4, 2011 9:41:34 PM
Very good move.
Originally posted by minho:
This is not a bug. The website developers made the download to open in a very small new window. Opera open it as a new very small tab, and by having a non-modal download dialog the dialog is "trapped" inside the very small tab.ricksperFriday, November 4, 2011 9:45:47 PM
Originally posted by minho:
So you will lose it if you overwrite 11.52
GeneticBOTFriday, November 4, 2011 9:45:54 PM
"An important bug in this site: http://www.mercadolibre.com.ar/
Image: http://img11.imageshack.us/img11/2976/operabug.png
The category list is not working as it should, it is supposed that you have to chose only ONE item from each column until you reach a continue buttom.
It's a well known site for sales.
Win 7 x64"
TidanFriday, November 4, 2011 10:01:45 PM
minhoFriday, November 4, 2011 10:04:17 PM
http://my.opera.com/minho/albums/showpic.dml?album=3631672&picture=131324182
win 7 x64
RickFriday, November 4, 2011 10:17:04 PM
Linux has been broken, Windows worked prior to 11.60.
Rafael LuikFriday, November 4, 2011 10:18:40 PM
Originally posted by Fifonik:
You shouldn't be using testing builds as if they were stable ones and you could put all your precious data there. Also, you can't expect to have downgrade possibility on any software.minhoFriday, November 4, 2011 10:21:38 PM
Rafael LuikFriday, November 4, 2011 10:25:10 PM
Originally posted by Swapnil99pro:
Originally posted by ObeseMaurice:
When it's ready.Originally posted by Swapnil99pro:
It can't be delayed since it wasn't given a release date in first place! There's no promised date or anything similar.berend ytsmaFriday, November 4, 2011 10:25:20 PM
Originally posted by rskunath:
What is broken? I don't see it
Obese MauriceFriday, November 4, 2011 10:28:10 PM
Originally posted by rafaelluik:
Ermm, on the conference they said by the end of the year.
bleicherFriday, November 4, 2011 10:35:16 PM
http://forum.de.selfhtml.org/
on Win7-64bit
Branko86Friday, November 4, 2011 11:07:50 PM
RijkFriday, November 4, 2011 11:31:02 PM
Originally posted by rafaelluik:
Or, just go on using the 12.00 snapshot then, for now. There are currently no mail compatibility issues between the latest snapshots and the 11.60 build, so moving mail folders between their profiles should work fine. But don't do that unless you really know what you are doing and/or have good backups.Originally posted by slalaurette:
Only do such things if you really know what you are doing - and if you are aware that at some point the different versions might not be compatible with each other anymore.Originally posted by clashcityrocker:
Developers are split over different features, not releases. What features to package as what version is something on which plans can change, like just happened.Originally posted by christoph142:
You shouldn't even try to do such things in Windows Vista or Windows 7...