Bug 148482 - When pasting requires fetching remote content, ask for permission
Summary: When pasting requires fetching remote content, ask for permission
Status: UNCONFIRMED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: needsDevAdvice
Depends on:
Blocks:
 
Reported: 2022-04-09 14:47 UTC by Eyal Rozenberg
Modified: 2023-10-04 08:25 UTC (History)
6 users (show)

See Also:
Crash report or crash signature:


Attachments
Example file (11.49 KB, application/vnd.oasis.opendocument.text)
2022-04-11 13:30 UTC, Telesto
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Eyal Rozenberg 2022-04-09 14:47:50 UTC
Sometimes, pasting content from the clipboard requires fetching content from the network. I don't quite understand how this makes sense, but apparently it happens (see, for example, 148407 regarding the pasting of content copied from a web-browser).

A user may not be interested in having the content fetched at all; or they may want the content fetched and the link broken; or they may want both the remote content and the linkage to the remote source.

LO (or at least, LO Writer) should offer a dialog in which the user confirms wishing to fetch remote content, where if they don't confirm, either the paste is aborted, or occurs with no fetching (e.g empty background or placeholder image or what-not). Alternatively, the dialog could make the user choose between the three options.
Comment 1 Heiko Tietze 2022-04-11 10:10:38 UTC
Caolan, do we really fetch content on paste? Smells like a security issue.
Comment 2 Caolán McNamara 2022-04-11 13:00:03 UTC
Typically there are utilities available for the various platforms to examine the clipboard which you can use to have a look at what is going on. Normally when something is "copied" its just marked as available to be requested from the source app on demand in a variety of optional formats and the destination app picks its favorite one.

In this specific case I don't know what the situation is, using a clipboard utility should make it possible to get the source data out of the clipboard to see what it is.
Comment 3 Heiko Tietze 2022-04-11 13:11:47 UTC
Eyal, please use a clipboard inspection tool to find what specifically is fetching content from exemplary web site.
Comment 4 Eyal Rozenberg 2022-04-11 13:17:34 UTC
(In reply to Caolán McNamara from comment #2)

I wouldn't mind using a clipboard utility, but I don't think that's the point. The point is that if it's possible that the clipboard content provider will perform some network operations, then it would make sense for LO to ask permission to have that happen. If a clipboard utility can determine whether or not that's the case, then theoretically, so can LO. Does the clipboard API not indicate whether the content is readily available, or requires additional processing?


(In reply to Heiko Tietze from comment #3)
Use which clipboard utility? And what information from that utility would you like?
Comment 5 Telesto 2022-04-11 13:30:42 UTC
Created attachment 179464 [details]
Example file

@Heiko
A) Maybe start with something simple (without the clipboard stuff). This file contains an image which links to a file (webfile) instead of local disk. 

In Calc you get this file uses external data, do you want to update..

Here it's simply download images from the web. The image here is high res (5 mb)(so throttle the bandwidth to 7 mbit) and you start noticing lags..

Aside that you can as use not tell what the document contains.. If those links are safe to download...

---
b) Another dimension of the topic is that image is treated as if it's stored locally. It isn't buffered after a successful download.
So if you change context is simply starts doing the whole download starts again (Say Opening Image dialog closing dialog & scrolling).
It's really assuming the image is locally stored (or on fast network drive)

---
c) And well here the image won't show in document. It keeps failing.. but well might be because of the stuff mention under b
Comment 6 Caolán McNamara 2022-04-11 13:36:03 UTC
I don't know in this case if its the content of the clipboard data which, when parsed by LibreOffice, makes LibreOffice download from a remote location. Or if the fetch over the network is done by the source application when it prepares what to present to the destination application of LibreOffice. There can be a lot of moving parts in cut&paste and various platform specific factors.

If the platform you are using is Linux then xclip is probably easily installable and xclip -selection clipboard -t TARGETS is a good place to start to see what formats are available to get data in from the clipboard
Comment 7 Eyal Rozenberg 2022-04-11 21:49:59 UTC
(In reply to Caolán McNamara from comment #6)
> If the platform you are using is Linux then xclip is probably easily
> installable and xclip -selection clipboard -t TARGETS is a good place to
> start to see what formats are available to get data in from the clipboard

When I invoke that command, nothing happens. It waits and waits and prints nothing, regardless of what I copy or paste.
Comment 8 QA Administrators 2022-04-12 04:38:48 UTC Comment hidden (obsolete)
Comment 9 Heiko Tietze 2022-04-26 09:16:39 UTC
From UX POV, if we really fetch 3rd party content I expect a confirmation, whether per dialog or via infobar presuming acceptance, and/or an option "[x] Ask to load content from 3rd parties". 

But I guess it's either NAB or NOB.
Comment 10 Dieter 2023-10-04 08:25:25 UTC
(In reply to Heiko Tietze from comment #9)
> But I guess it's either NAB or NOB.

No further input for more than a year. Kindly reminder to our developers.