Cannot copy and paste text from a sandboxed browser into LibreOffice Writer

Please post your problem description here

Moderator: Barb@Invincea

Post Reply
Blinker
Posts: 3
Joined: Fri Mar 08, 2019 9:02 pm

Cannot copy and paste text from a sandboxed browser into LibreOffice Writer

Post by Blinker » Fri Mar 08, 2019 10:57 pm

I’m using the following:

Windows 7 32 bit

Sandboxie 5.28

Firefox Quantum 65.0.2 (32 bit)

LibreOffice 6.0.7.3

No AV installed



Does the issue occur in a new Sandbox with Default settings?
(https://www.sandboxie.com/SandboxMenu#create)

Yes


What are the exact steps to reproduce the issue?

1. Open a sandboxed Firefox using a Sandbox with default settings and go to the following Sandboxie forum post:

viewtopic.php?f=39&t=15743

2. Using your mouse, highlight some text, right-click and copy it to the clipboard. For example, I copied the following text:


“When trying to paste from the clipboard it has stopped working in sandboxed browsers.
Works fine when browsers aren't sandboxed.

The same problem is in Firefox and Comodo Dragon. Copy works but not paste. Works fine in Notepad.”


3. Open a LibreOffice Writer document (not in a sandbox – open the application normally)

4. Try to right-click and paste the text you just copied to the clipboard.

The Paste option will be greyed out, and Paste Special will offer no options. The Paste icon in the LibreOffice Writer toolbar will also be greyed out. In other words, you cannot use your mouse to copy and paste text from Firefox into LibreOffice Writer. It simply will not work. And this is with any web page, not just the URL above.

Now repeat steps 1 thru 4 in an UNsandboxed Firefox. It works no problem. I would suggest going to a different web page and highlighting different text so you know what text came from the sandboxed vs unsandboxed browser.



The issue is the same in a sandboxed Firefox, Chrome, or Internet Explorer, so the browser doesn’t seem to matter.



There is a curious workaround to this issue:

Copy text from a sandboxed browser, and paste it into Notepad. That will work, and then you can copy the text from Notepad to LibreOffice Writer.

However, if you need to do this a lot, it quickly becomes a giant pain, so I’m hoping there’s an actual fix for this issue.



I googled “copy and paste site:forums.sandboxie.com”, and variations of this problem seem to have happened over the years, so the issue I’m currently having may also apply to Apache Open Office and Microsoft Word. I don’t know, as I don’t have either of those currently installed.



For some reason, after you copy text from a sandboxed browser, if you go to Libre Writer and use CTRL V, sometimes it will paste the text, but that only works intermittently, and will eventually stop working after a while.

Also, sometimes you can use your mouse to copy and paste a URL from a sandboxed browser’s address bar into LibreOffice, but just like CTRL V, it may work over and over again for a little while, but it will eventually stop working for some reason, and then you will not be able to paste * anything *, using any method. The only thing that seems to always work is to copy it into Notepad first.

Any ideas on how to fix this issue?

In the past, the fix was a newer release of Sandboxie, but maybe there’s a setting somewhere that can be changed without compromising security?



One last thing: Although you cannot copy from a sandboxed browser to Libre Writer, you can do the reverse. I typed up this post in Libre Writer and pasted it to this forum using a sandboxed Firefox.

Barb@Invincea
Sandboxie Support
Sandboxie Support
Posts: 3020
Joined: Mon Nov 07, 2016 3:10 pm

Re: Cannot copy and paste text from a sandboxed browser into LibreOffice Writer

Post by Barb@Invincea » Mon Mar 11, 2019 10:22 am

Hi Blinker,

I tested Firefox (v65) and Chrome (v72) , and I was able to copy-paste with ctrl C/V to non-sandboxed LibreOffice 6.2.1 without issues (tested using LibreOffice Writer).
With Firefox only, I noticed the behavior with right-click paste not showing anything the first time I tried using it, however ctrl v takes care of that for me (other browsers such as Chrome do seem to get picked up by the clipboard and I can use right-click paste inside LibreOffice). Once I used ctrl v, then I was able to use right-click paste as well.
I also noticed that relaunching LibreOffice allows right-click paste to start working again.

Are you using the screen readers template? :
viewtopic.php?p=132221#p132221
viewtopic.php?p=91514#p91514

Please, consider updating LibreOffice to its latest version, and re-test after having deleted the contents of your Sandbox. Let me know if things improve.

Have you tried opening Libre office inside the Sandbox?

Regards,
Barb.-

bo.elam
Sandboxie Guru
Sandboxie Guru
Posts: 2910
Joined: Wed Apr 22, 2009 9:17 pm

Re: Cannot copy and paste text from a sandboxed browser into LibreOffice Writer

Post by bo.elam » Mon Mar 11, 2019 3:22 pm

Blinker wrote:
Fri Mar 08, 2019 10:57 pm

3. Open a LibreOffice Writer document (not in a sandbox – open the application normally)

4. Try to right-click and paste the text you just copied to the clipboard.

The Paste option will be greyed out,
Hi Blinker, I use the Libre portable version. What you describe was not working in an old version I was using (5.4.5.1) but after updating to latest portable from Portable apps (6.1.4.2), I can copy from a sandboxed Firefox to an unsandboxed or sandboxed Writer. But I found two things, 1. this works only if after copying from Firefox, I open Writer. If Writer is open before copying, the paste is greyed. 2. the copy and paste works only once. If I copy something else after the first successful instance of copy/paste, paste is greyed. So, to copy paste again, I would have to close Writer, and reopen it. I tested in W10 with SBIE 5.28. Firefox 65.0.2.

Bo
Attachments
Sin título.jpg
Sin título.jpg (107.51 KiB) Viewed 203 times

Blinker
Posts: 3
Joined: Fri Mar 08, 2019 9:02 pm

Re: Cannot copy and paste text from a sandboxed browser into LibreOffice Writer

Post by Blinker » Wed Mar 13, 2019 1:19 am

Hi Barb

I installed Libre Office 6.2.1. Right-click copy and paste still didn’t work with Firefox. Using ctrl C/V seemed to work a little more consistently, but would eventually stop working. Sometimes I could get ctrl C/V to work again if I first right-clicked and chose copy before ctrl+C, but that would eventually stop working. I was never able to “jumpstart” right clicking by first using ctrl C/V the way you described.

I don’t know what the screen readers template is. I followed your instructions about Sandboxie Configure > Software Compatibility, and unchecked all the items. It didn’t seem to change anything, but I’ve enclosed a screenshot of what was available to deselect. I also tried the linked instructions to disable multiprocessing in Firefox.

I’ve seen people asked if they used a clipboard manager, but I don’t know what that is either. Unless it’s something that one of my programs uses by default, then I don’t believe I have one.

My Firefox configuration isn’t that elaborate, I don’t think my security settings are overly strict, and the only browser extension I’m using is Virus Total VTZilla. Within the Firefox security settings, I normally have this item checked: “Prevent accessibility services from accessing your browser”. Since I’d seen screen readers referenced, I tried toggling that off, but it made no difference so I re-checked that item.

In any case, if I run Firefox outside of the sandbox, I have no issues with copy and paste.

After installing Libre Office 6.2.1, I was able to use my mouse to right-click to copy and paste from a sandboxed Chrome to Libre Writer, which is something that I could not do in version 6.0.7. However, just like ctrl C/V in Firefox, copy and paste eventually stops working in Chrome as well. Sometimes it will work for a pretty good while, sometimes it stops working pretty quickly. I can get it working again by closing and reopening Libre Office, but it will eventually stop working again.

The last thing I tried was closing out Libre Writer, and then using a sandboxed Windows Explorer to open a sandboxed Libre Writer document. I just kept the same sandboxed Firefox open from my previous tests. Now that both Firefox and Libre Writer were in the same sandbox, right-click copy and paste worked just fine.

So I guess using a sandboxed Libre Writer is a workaround, but it’s kind of convoluted. Not to mention all of your documents are now visible to Firefox, which is not ideal, although you could add another layer of workaround if need be by only copying select documents into the sandbox. Then of course, you’d have to copy the sandboxed document back to your documents folder to update the “real” document with whatever changes you made. So I’m not sure how practical this would be for daily use, but it does shed some light on the issue:

IF Firefox and Writer are both outside the sandbox, everything works normally. If they are both in the same sandbox, everything works normally. If Firefox is sandboxed and Writer is NOT sandboxed, right-click copy and paste never works, and ctrl C/V only works sporadically.

Any other ideas?

--------- MERGED POST -------------
Hi Bo

You’d think it would either always work, or never work, so I don’t get it. I don’t know if this would affect Microsoft Word or not, but I’ve had issues with Apache Open Office in the past on another system. However, on that system, right-clicking always worked for a while, where now it never works for me with Firefox and Libre Office.

It also affects more than one browser, but Firefox more than Chrome. Since everything works fine outside the sandbox, or if both the browser and Writer are in the same sandbox, then somehow Sandboxie would seem to be part of the issue. It almost seems like the clipboard can only be used a certain number of times before it “runs out of room” to copy to, and stops working until something is reloaded



Image

Barb@Invincea
Sandboxie Support
Sandboxie Support
Posts: 3020
Joined: Mon Nov 07, 2016 3:10 pm

Re: Cannot copy and paste text from a sandboxed browser into LibreOffice Writer

Post by Barb@Invincea » Wed Mar 13, 2019 10:27 am

Hi Blinker,

Unfortunately, I cannot reproduce the problem as you describe it. I did see some behavior issues related to Firefox and LibreOffice only, and provided you with workarounds.

Screen-readers template removal is explained in the posts I provided before. The first link has the exact steps to follow in case the template is enabled. Please, do not remove other templates as you may encounter functionality issues (such as incompatibility).

Clipboard managers are applications that manage the things you copy-paste and provide additional functionality. You may perform an online search for more information.
Any other ideas?
As mentioned before, looks like the order in which the apps are opened may affect functionality. Did you test opening Firefox first, then LibreOffice, or if already opened, relaunching LibreOffice?
So I guess using a sandboxed Libre Writer is a workaround, but it’s kind of convoluted. Not to mention all of your documents are now visible to Firefox, which is not ideal...
I am not sure what are you referring to. Sandboxie has read access to your files by default, what it does prevent is changes being made to your files/computer without your permission.
You will have to, however, recover files as you are done working with them, you may also use options to automatically do that. Refer to these sections for more information:
https://www.sandboxie.com/RecoverySettings
https://www.sandboxie.com/ResourceAccessSettings#file (check out the Direct Access option)

Regards,
Barb.-

bo.elam
Sandboxie Guru
Sandboxie Guru
Posts: 2910
Joined: Wed Apr 22, 2009 9:17 pm

Re: Cannot copy and paste text from a sandboxed browser into LibreOffice Writer

Post by bo.elam » Wed Mar 13, 2019 2:51 pm

Barb@Invincea wrote:
Wed Mar 13, 2019 10:27 am
I am not sure what are you referring to. Sandboxie has read access to your files by default, what it does prevent is changes being made to your files/computer without your permission.
Hi Barb, I think he is thinking of protection for his personal files by forbidding access.

Bo
Last edited by bo.elam on Wed Mar 13, 2019 2:54 pm, edited 1 time in total.

bo.elam
Sandboxie Guru
Sandboxie Guru
Posts: 2910
Joined: Wed Apr 22, 2009 9:17 pm

Re: Cannot copy and paste text from a sandboxed browser into LibreOffice Writer

Post by bo.elam » Wed Mar 13, 2019 2:52 pm

Blinker wrote:
Wed Mar 13, 2019 1:19 am
So I guess using a sandboxed Libre Writer is a workaround, but it’s kind of convoluted. Not to mention all of your documents are now visible to Firefox, which is not ideal, although you could add another layer of workaround if need be by only copying select documents into the sandbox. Then of course, you’d have to copy the sandboxed document back to your documents folder to update the “real” document with whatever changes you made. So I’m not sure how practical this would be for daily use, but it does shed some light on the issue:
In occasions when you need to run both, Firefox and Libre at the same time,you could run them in a sandbox in which you block access to your personal files, sensitive files. You probably doing it now in your Firefox sandbox so this is not a big change for you. I dont use Firefox and Libre as you do, but this is what I would do, before opening both programs, make a copy of the Writer document and place it at the Desktop, and save changes there, and then copy paste it back where you save your important files when you finish.

Bo

Blinker
Posts: 3
Joined: Fri Mar 08, 2019 9:02 pm

Re: Cannot copy and paste text from a sandboxed browser into LibreOffice Writer

Post by Blinker » Wed Mar 13, 2019 11:37 pm

As bo correctly assumed, I do use Sandbox Settings > Resource Access > File Access > Blocked Access. I added My Documents, which displays as %Personal%\ once you add it. I did this to prevent anything snoopy in my browser from being able to read the contents of My Documents or know what is in there. If you have more than one user, then you can navigate to C > Users and add their documents as well. It didn’t occur to me that this wasn’t a default setting when I mentioned this the first time.

Since I allow access to the desktop, I have a folder there for downloading and uploading. So I could copy files out of My Documents into my desktop folder, and those documents would be visible and modifiable from within the sandbox. Then I could right-click on the active sandbox in Sandboxie Control, then choose Run Sandboxed > Run Windows Explorer. Using a sandboxed Windows Explorer to open a Writer document would open Libre Writer in the sandbox.

(I know you guys already know all of that, but just in case somebody has a similar problem in the future and isn’t sure what we’re talking about: If you use a sandboxed windows explorer, then whatever you open is run inside the sandbox. This is useful for things like opening a downloaded file just in case something unexpected happens.)



If Libre Writer is running in the same sandbox as my browser, that eliminates the copy/paste issues (just as running both outside of the sandbox does). So I could copy a document to my desktop, use a sandboxed Windows Explorer to open the document and change it however I needed to. That would allow copy/paste to work normally. After I was done, I could either manually copy the file out of the sandbox or use quick recovery and overwrite the previous version in My Documents.

So that’s one workaround. Another one is copying from a sandboxed browser to Notepad first, and then copying from Notepad to Libre Writer.


Did you test opening Firefox first, then LibreOffice, or if already opened, relaunching LibreOffice?
I was never able to right-click to copy and paste from Firefox, regardless of the order of things (except for the one-time-only method that Bo described). Right-clicking would work for a while in Chrome, but would stop working. I could Ctrl C/V in either browser, but that will stop working also. Sometimes everything will work only a few times, other times it will work for a while, but it always stops working eventually, leaving you with no way to copy and paste.

If I relaunch Libre Writer, things start working again, but then they stop and the cycle repeats.



As for workarounds, the best one so far for me is a free utility I just stumbled across today called PureText (one word). The developer is Steve Miller. I’ll paste the link below if that’s allowed, but if not, Google it. You can find reviews online at a certain popular download site, but that site is known to use a download manager that bundles adware along with their downloads, so I’d highly suggest getting it directly from the developer’s personal website.

http://www.stevemiller.net/puretext/

It basically does what Notepad does, which is to remove all formatting and convert everything to plain text, but it automates and speeds up the process. All I have to do is right-click to copy from Firefox, left click on the PT icon in the system tray, and then I can right-click to paste into Libre Writer. Alternatively, I can just copy from Firefox and press Windows + V to paste into Libre Writer.

So far, this works flawlessly every time. It hasn’t just stopped working at some point like ctrl C/V does. Using this tool works for me a lot better than using Notepad or a sandboxed Writer, but I guess it just depends on your workflow and preferences.

What I don’t understand is WHY this works. Libre Writer never has an issue copying from Notepad or PureText, and never has an issue unless you’re pasting from a sandboxed browser. It seems like maybe the formatting isn’t coming out of the sandbox correctly, and so Libre Writer doesn’t know that there’s anything there to paste.

Maybe there’s a compatibility fix like there has been in the past?

Post Reply

Who is online

Users browsing this forum: Bing [Bot], test47 and 13 guests