Enhanced Copy for Opera - Copy URL, Title & Selection
Friday, 11. January 2008, 05:40:06
Yaske made opera_ex (link Japanese) a small Windows application that does exactly that (and more apparently), which you can call as an external program from Opera.
Later, higeorange rewrote it for Linux (Gtk2-Perl version & Ruby-Gnome version).
Both links are in Japanese. I could translate them if on high demand, but I don't think it's needed. Here is a sort-of description: opera_ex on Linux
Anyway, I'm neither on Windows nor Linux, and I don't want to use an external program for Opera. I want a browser to be stand alone.
Owing to the "Delay" action introduced at Opera9.50beta, it is now possible to copy URL+PageTitle+Selection and so on using Opera internal actions and JavaScript.
Here is how you do.
If you want to copy with a format like this,
<p>SelectedText<a href="URL">PageTitle</a></p>
Write this for your keyboard shortcut or rightclick menu.
Go to page, "javascript:window.prompt('','<p>'+window.getSelection()+'<a href=\x22'+location.href+'\x22>'+document.title+'</a></p>');" & Delay, 10 & Copy & CancelIf you want an myOpera blog style like,
[URL=URL]PageTitle[/URL]*LineBreak* SelectedText(if exists)
Then add this to your shortcut
Go to page, "javascript:var s=window.getSelection(),t='[URL='+location.href+']'+document.title+'[/URL]',t=s?t+'\r\n'+s:t;window.prompt('',t);" & Delay, 10 & Copy & CancelOr you can create your own.
What they are doing is, call JavaScript alert, paste URL etc. with the format, Delay, Copy and Close the alert. Without Delay this doesn't work (which means it doesn't work on Opera9.25 or before, so you have to copy and close the alert by hand if you really want).
The only thing that might bother you is that it brings up an alert for a little moment and erases. I first didn't like it, but now I don't mind. I even like it because it tells me I am copying what I want for sure.
I adapted your code to my menu.ini file but it needs some adjusting
is there any way to have it copy & retain some of the text formatting?
ie. retain line & paragraph breaks, bullet lists, etc.?
By skye11, # 20. April 2008, 23:49:42
By edvakf, # 21. April 2008, 14:02:28
@ edvakf .. exactly! And that, in turn, is a major functional attraction to noobs who for the first time are considering making the *Big Switch* from IE to FF ~ that in FF with GMail, you can right click on any web page you want to copy and GMail it to yourself ~ a single click does it all ~ presto magic .. lol! It arrives in your inbox in an impressive "carbon copy" of the page you want to save.
And thank you so much for this post! I'd used it as my alternate to Netscape (back in Netscape days!) for two years and loved it.
I'm convinced that of the four *major default browsers* (IE, FF, Safari, Opera) Opera's the most secure. My husband's in that field and showed me exactly what he meant in a way I could understand ~ and from my intro to Opera in 1999/2000, I've been a believer on the exceptional security benefits of the formidable Opera browser.
We stopped using Opera at home two years ago on our Windows stations (and would never use Safari for Windows ~ we have enough Safari on our Mac's lol). My husband and I went on a "spring cleaning" in 2006 and got rid of software we didn't use enough. We considered more Windows browsers than two (IE and FF in our case) to be overdoing it.
The reason I was willing was because performing 3D web design / animation / development et al is far easier for me on FF ~ the best and most widely used program we use in my field of 3D content creation is Autodesk's MAYA http://www.autodesk.com/maya; MAYA only renders in IE/FF/Safari and doesn't support Opera, much like similar other programs in my field.
It's a security trade-off which Nvidia cryptically refers to as "performance versus quality" lol. Before Nvidia told us that, I had always thought that good performance represents good quality.
I'd love to use Opera again if it only supported the cutting edge 3D software used in the Gaming and Entertainment field.
By anonymous user, # 2. June 2008, 05:42:38
By tinhoy, # 12. July 2008, 02:06:12