The My Opera forums have been replaced with forums.opera.com. Please head over there to discuss Opera's products and features
See the new ForumsYou need to be logged in to post in the forums. If you do not have an account, please sign up first.
Copy-paste website content WITH formatting & images
It would be great if selecting and copy-pasting content from a page into another application (e.g. Outlook email) preserved the formatting from the source, including fonts, font size, colours, hyperlinks, images, etc.Firefox and Chrome both do this. I find myself mailing content to others in my office a lot (since they are too lazy to click through links), and I often have to load a URL in another browser for copy-pasting so that I save myself the time required to reformat.
Thanks

Do you think copy-pasting with formatting is a useful feature to have?
| Option | Results | Votes | |
|---|---|---|---|
| Yes | 82% | 49 | |
| No | 18% | 11 | |
| Total number of votes: | 60 | ||
Pasting your blog post below:http://my.opera.com/burnout426/blog/2011/09/16/standard-features-missing-in-opera-copying-rich-text
"Today's standard feature that Opera is missing is copying rich text in a selection on a web page to the clipboard.
This is useful for selecting content on a web page, copying it and pasting it into MS Office, OpenOffice, rich text editors on web pages, mail clients that support composing in HTML and other programs that support rich text.
This works fine in IE, Chrome, Safari and Firefox.
Opera doesn't support this at all for regular web pages. Opera does support this partially if you turn an entire web page into a rich text editor by setting document.designMode to "on". But, that's not even close to the same as what other browsers support.
This is probably one of the most popular feature requests for Opera. Other browsers have had this forever. But, Opera remains broken in this area.
Some Opera users are against this though because they only want to copy and paste plain text. Well, the way it works in other browsers is that both a plain text version and an HTML version is copied to the clipboard. Then, which version gets pasted depends on what you're pasting into. If what you're pasting into supports rich text, the HTML version gets inserted. If you paste into a plain text editor, the plain text version obviously gets inserted. Further, programs that support rich text often give you a special paste option to paste the text version just in case you don't want the HTML version inserted.
Even with that in mind, some Opera users might want to paste into a rich text editor that doesn't have a special text only paste option. Or, they just don't want markup leaking into the clipboard for whatever reason. In these edge-cases, Opera could have an option to disable copying of rich text, if that's really necessary. But, other browsers and their users seem to do fine without that.
This is something that is not only a standard feature, but a required feature for a web browser."
The Opera Co-Founder Jon Stephenson von Tetzchner created a new community for MyOpera Users. Enjoy it!
http://www.vivaldi.net
O co-fundador do Opera Jon Stephenson von Tetzchner criou uma nova comunidade para os usuários do MyOpera. Aproveitem!
http://www.vivaldi.net
If you need any help from me with regards to Opera, please make a comment on any of my blog posts.
Support Opera wishes
To see what I am missing I checked the feature with Chrome and Firefox.
I tried it with the page http://my.opera.com/chooseopera/blog/ (in case the page has changed, here a screenshot)
I pasted some text portion to Abiword, and frankly I'm not impressed with the result. Firefox couldn't even keep the headline in uppercase:

Things work better when the HTML code contains style information like this
<p align="center"><b><font face="Comic Sans MS" size="6" color="#FF00FF">Sample text</font></b></p>
But such outdated markup can (hopefully!) only be found in amateur homepages, so I think the ability of Opera to copy formatted text would have a very limited value.
You can select cells in Calc or Excel and copy them to the clipboard to see what they generate too.
Originally posted by burnout426:
You'll see an rtf/html section and a text section for the text/plain alternative.
Thanks. What I can see is that the HTML code in the clipboard has little to do with the style of the copied text...no surprise.
The Opera Co-Founder Jon Stephenson von Tetzchner created a new community for MyOpera Users. Enjoy it!
http://www.vivaldi.net
O co-fundador do Opera Jon Stephenson von Tetzchner criou uma nova comunidade para os usuários do MyOpera. Aproveitem!
http://www.vivaldi.net
21. November 2011, 11:31:34 (edited)
at the user level, Opera corrupts the data copied by the user, by stripping out the formatting and pictures. Most users are non techy. And don't care for any technical reasons why Opera modifies their data. Wysiwyg has been around only 20 years.
As a good workaround install the Edit the Page extension.
Switch on edit, make the copy and paste, then switch off edit. Formatting, links and pictures are successfully pasted.
6. July 2012, 13:08:27 (edited)
If you need any help from me with regards to Opera, please make a comment on any of my blog posts.
Support Opera wishes
When I did the dragging operation, only the link to this page shown int the MS word.
Maybe I did not do it in the correct way.
Originally posted by Swapnil99pro:
^^ Select the parts of the page (or if you need the really complete page, press Ctrl + A), and drag it to the application. (perform a drag and drop from Opera to application - works fine, tested with word processors). Opera 12.00 and above.
Originally posted by hsuankwok:
It did not work for me.
Broken since Opera 12.01.
If you need any help from me with regards to Opera, please make a comment on any of my blog posts.
Support Opera wishes
24. November 2012, 12:21:14 (edited)
If it already works with an extension, it cant be too difficult for the developers to add. It's just a question of priorities. A bit like rich text email in Opera. Critical for the majority of users, but not interesting to techies. They should not be allowed to set the priorities. But maybe Opera developers are really well overloaded. Maybe when HTML5 is finished.
[ Tweedo Monitor - Deluxe Website & Service Monitoring ]
I usually don't write on forums but this time i just had to. Maybe when more people will ask for copying text with formatting and images opera developers decide to implement it and if they will i'm sure it will work better then in other browsers
- Ctrl + F12 > Advanced > Toolbars > Menu setup > chose "Opera Standard" and make a copy.
- Close Opera.
- Run (Win+R) or open in any editor: %APPDATA%\Opera\Opera\menu\standard_menu (1).ini
- Search for "[Hotclick Popup Menu]" (without quotes)
- Below Item, M_COPY_TO_NOTE=Copy to note add:
Item, "Copy with formatting"=Go to page, "javascript:function sS() {var s = window.getSelection();if (s.getRangeAt && s.rangeCount) {return s.getRangeAt(0);}return null;}function rS(range) {if (range) {var s = window.getSelection();s.removeAllRanges();s.addRange(range);}}",,"Copying with formatting" & Go to page, "javascript:void(tmp=sS());void(document.designMode='on')" & Delay, 300 & Go to page, "javascript:void(rS(tmp))" & Delay, 300 & Copy & Delay, 300 & Go to page, "javascript:void(document.designMode='off')" - Start Opera.
Select text and from context menu choose "Copy with formatting". The selection will flicker and it's done - you've copied the HTML :-).
BTW there is hope - Opera 12.50 should support Clipboard API and maybe HTML copying will be a bit less hacky ;-).
Originally posted by EcceNux:
Victory!
I'm attempting to make your suggested menu item into a button, but I'm having trouble setting a title and custom icon. Do you have the equivalent code as a button with title and icon?
From a few tests the code works well only for most basic text formatting (bold, italic, headlines, lists, etc), copying of Unicode characters and raw images and preservation of original font used doesn't appear to be supported.
Thanks.
9. January 2013, 16:06:45 (edited)
Originally posted by laurenbacall:
Originally posted by EcceNux:
Victory!
I'm attempting to make your suggested menu item into a button, but I'm having trouble setting a title and custom icon. Do you have the equivalent code as a button with title and icon?
Edit: Ignore all below the link for adding a button is this: Copy HTML
Go to page, "javascript:function sS() {var s = window.getSelection();if (s.getRangeAt && s.rangeCount) {return s.getRangeAt(0);}return null;}function rS(range) {if (range) {var s = window.getSelection();s.removeAllRanges();s.addRange(range);}}", , "Copy HTML", "Select Author Mode" & Go to page, "javascript:void(tmp=sS());void(document.designMode='on')" & Delay, 300 & Go to page, "javascript:void(rS(tmp))" & Delay, 300 & Copy & Delay, 300 & Go to page, "javascript:void(document.designMode='off')"
Oh, and yes, fonts are not supported, but that's probably because you don't select style sheet of the page when you select a page fragment. It would probably work if a style tag would be inside selection (haven't tried though).

I did notice that upon clicking the 'Go to page' text on the button it briefly changes to display the correct icon, so perhaps only the syntax of the button needs some fix. As I'm writing this I notice a strange bug with the icon (the copypasta one), when the text caret is inside an input box and you press Shift+left arrow / Shift+right arrow the icon toggles on/off
.I'm not too concerned, Opera will hopefully add this ability natively soon with font, image, etc support like other browers.

Originally posted by EcceNux:
Victory!
- Ctrl + F12 > Advanced > Toolbars > Menu setup > chose "Opera Standard" and make a copy.
- Close Opera.
- Run (Win+R) or open in any editor: %APPDATA%\Opera\Opera\menu\standard_menu (1).ini
- Search for "[Hotclick Popup Menu]" (without quotes)
- Below Item, M_COPY_TO_NOTE=Copy to note add:
Item, "Copy with formatting"=Go to page, "javascript:function sS() {var s = window.getSelection();if (s.getRangeAt && s.rangeCount) {return s.getRangeAt(0);}return null;}function rS(range) {if (range) {var s = window.getSelection();s.removeAllRanges();s.addRange(range);}}",,"Copying with formatting" & Go to page, "javascript:void(tmp=sS());void(document.designMode='on')" & Delay, 300 & Go to page, "javascript:void(rS(tmp))" & Delay, 300 & Copy & Delay, 300 & Go to page, "javascript:void(document.designMode='off')"- Start Opera.
Select text and from context menu choose "Copy with formatting". The selection will flicker and it's done - you've copied the HTML :-).
BTW there is hope - Opera 12.50 should support Clipboard API and maybe HTML copying will be a bit less hacky ;-).
@EcceNux
you are a genius!!! i works on my Opera 12.12... i m hoping for this option by default for 3000 yrs. on Opera
... IE, Chrome and FF have this option for ages... i missed it for long... let's hope this option comes to v12.50 by defaultthanks,
samystic
Originally posted by laurenbacall:
Thanks for your help. I was actually using the same button creator, but couldn't get the icon to display correctly, and indeed pasting in your code gave me the same result. However using your button link at the end of your post did display the icon, but doesn't perform the action.
Fixed that now. The forum was truncating the link rather randomly. Pre-encoded it and it seems fine now.
Originally posted by laurenbacall:
I did notice that upon clicking the 'Go to page' text on the button it briefly changes to display the correct icon, so perhaps only the syntax of the button needs some fix. As I'm writing this I notice a strange bug with the icon (the copypasta one), when the text caret is inside an input box and you press Shift+left arrow / Shift+right arrow the icon toggles on/off
.
That happens for me too but it used to work fine... Strange. It might be because the line is much longer then expected ;-).
Copy HTML button
You need to restart Opera after adding the button. It should then activate itself when something is selected.
How to copy HTML by selecting elements on a web page and clicking the right mouse button.
N.B. You need to enable HTML formatting.
Step 1. Duplicate the menu:
Settings > Preferences > Advanced > Toolbars > Menu Setup > "Opera Standard" --> Duplicate
You will find the duplicated menu setup here: c:\users\username\AppData\Roaming\Opera\Opera\menu
The files name usually is "standard menu (1).ini".
Step 2. Add a menu item:
Edit the menu(1).ini file.
Got to:
[Hotclick Popup Menu]
Copy the lines below:
--------------------
Item, "Copy with formating"=Go to page, "javascript:function sS() {var s = window.getSelection();if (s.getRangeAt && s.rangeCount) {return s.getRangeAt(0);}return null;}function rS(range) {if (range) {var s = window.getSelection();s.removeAllRanges();s.addRange(range);}}",,"Copying with formatting" & Go to page, "javascript:void(tmp=sS());void(document.designMode='on')" & Delay, 300 & Go to page, "javascript:void(rS(tmp))" & Delay, 300 & Copy & Delay, 300 & Go to page, "javascript:void(document.designMode='off')""
29. March 2013, 15:07:50 (edited)
The Edit the Page extension also allows copying formats for me, with similar limitations: no fonts, and front-truncated Wikipedia links.
But on the off chance that any Opera developers see this: user-created workarounds, even though they work well, are not a satisfactory replacement for the programmers' fulfilling this longstanding and widely supported request!
Windows 7 Pro 64-bit