Clipboard

from Wikipedia, the free encyclopedia

The clipboard (English Clipboard ) is a buffer , so a buffer for temporary storage and transfer of data. This procedure is usually only used on a computer between documents or applications. Operating systems use the technology to interact with the clipboard copy and paste (Copy and Paste). Most programs access their clipboard interfaces when they respond to specified user input, such as a key combination or menu selection. An element in the clipboard can be kept in different formats. Each program determines the variations in which the data is saved. This is useful because no conclusions can be drawn about the target application at the time of saving.

Windows , Linux and MacOS use the RAM for the clipboard and cannot cache multiple items as they overwrite the previous content. In addition, the object in the clipboard is not deleted after being pasted, but rather kept. However, restarting or switching off the system empties the RAM and thus the saved object. The way the clipboard works can vary between operating systems and their versions. These core functions of the clipboard can also be changed or expanded using the clipboard manager and settings.

The drag and drop interaction technique, on the other hand, does not use the clipboard, although the functionality is similar to that of copy and paste.

history

A first form of the clipboard was implemented by Pentti Kanerva in the text editor TVEDIT. The software used a buffer to cut out texts. The user first had to select characters and then delete them. He was then able to restore it at a specific point.

Since a text could be deleted in one place and inserted again in another place, the term "delete" no longer corresponds to the actual meaning of the word in this context. Larry Tesler named the scenario so 1973 in Cut, Copy, Paste (English cut, copy and paste ) around. He also defined the term “clipboard”, which literally means “ clipboard ”, as a buffer for this interaction technique. Tesler was also one of the developers of the first PC called Apple Lisa , which supported this technology ex works.

Data formats

The clipboard supports the saving of several types of the data object at the same time, so that complex data structures can also be saved. These range from text formats using markup language , such as RTF or HTML , through a variety of bitmaps and vector graphics to complex variants such as files and directories, tables and entries in databases. Cutting out several cells from one table and then pasting them into another table could, for example, incorporate the underlying formulas, data sets and even automatic translations of the references within a cell. This would mean, for example, that after copying and pasting cells that are used by a sum function, a program updates the content of this function with the new references.

An application can add data to the clipboard in many different formats. These can be native, simpler or more frequent data formats that have a higher chance of being recognized by a wide variety of applications. Therefore, when pasting the clipboard, the target application can choose the format that most closely matches that of the application, so that all the original data is retained if possible.

Example of formats saved on the Ubuntu clipboard.
Title of the English version of this article (in Mozilla Firefox) Python script in the downloads folder Clipboard pictogram of the English version of this article
available formats in clipboard 'TIMESTAMP', 'TARGETS', 'MULTIPLE', 'SAVE_TARGETS', 'text / html', 'text / _moz_htmlcontext', 'text / _moz_htmlinfo', 'text / plain', 'COMPOUND_TEXT', 'text / x-moz -url-priv ' 'TIMESTAMP', 'TARGETS', 'MULTIPLE', 'x-special / gnome-copied-files',' text / uri-list ',' text / plain ',' COMPOUND_TEXT ',' text / plain; charset = utf -8th' 'TIMESTAMP', 'TARGETS', 'MULTIPLE', 'SAVE_TARGETS', 'text / html', 'text / _moz_htmlinfo', 'text / _moz_htmlcontext', 'image / png', 'image / tiff', 'image / x -icon ',' image / x-ico ',' image / x-win-bitmap ',' image / jpeg ',' image / bmp ',' image / x-bmp ',' image / x-MS-bmp ',' application / x-qt-image '
TIMESTAMP '\ xdb \ xdb \ n \ x00' @ \ x07 \ x0f \ x00 '\ xb0 $ \ x1e \ x00'
TARGETS '\ xb1 \ x01 \ x00 \ x00 \ xaf \ x01 \ x00 \ x00 \ xb0 \ x01 \ x00 \ x00 \ xc6 \ x01 \ x00

\ x00) \ x02 \ x00 \ x00 * \ x02 \ x00 \ x00 + \ x02 \ x0 […]

'\ xb1 \ x01 \ x00 \ x00 \ xaf \ x01 \ x00 \ x00 \ xb0 \ x01 \ x00 \ x007 \ x02 \ x00

\ x008 \ x02 \ x00 \ x00 \ x13 \ x01 \ x00 \ x00 \ xd7 \ x01 […]

'\ xb1 \ x01 \ x00 \ x00 \ xaf \ x01 \ x00 \ x00 \ xb0 \ x01 \ x00 \ x00 \ xc6

\ x01 \ x00 \ x00) \ x02 \ x00 \ x00 + \ x02 \ x00 \ x00 * \ x02 \ x0 […]

MULTIPLE [empty] [empty] [empty]
SAVE TARGETS [empty] - [empty]
text / html '\ xff \ xfe <\ x00h \ x001 \ x00 \ x00i \ x00d \ x00 = \ x00 "\ x00f \ x00i \ x00r \ x00s

\ x00t \ x00H \ x00e \ x00a \ x00d \ x00i \ x00 [...]

'\ xff \ xfe <\ x00i \ x00m \ x00g \ x00 \ x00a \ x00l \ x00t \ x00 = \ x00 "

\ x00 "\ x00 \ x00s \ x00r \ x00c \ x00 = \ x00" \ x00h \ x00 [...]

text / _moz_htmlcontext '<\ x00h \ x00t \ x00m \ x00l \ x00 \ x00c \ x00l \ x00a \ x00s \ x00s \ x00 = \ x00 "

\ x00c \ x00l \ x00i \ x00e \ x00n \ x00t \ x00- \ x […]

[empty]
text / _moz_htmlinfo '0 \ x00, \ x000 \ x00' '0 \ x00, \ x000 \ x00'
text / plain 'Clipboard (computing)' '/home/user/Downloads/show_clipboard.py' -
COMPOUND_TEXT 'Clipboard (computing)' '/home/user/Downloads/show_clipboard.py'
text / x-moz-url-priv 'h \ x00t \ x00t \ x00p \ x00s \ x00: \ x00 / \ x00 / \ x00e \ x00n \ x00. \ x00w \ x00i \ x00k

\ x00i \ x00p \ x00e \ x00d \ x00i \ x00a \ x [...]

-
x-special / gnome-copied-files - 'copy \ nfile: ///home/user/downloads/show_clipboard.py'//
text / uri-list 'file: ///home/user/downloads/show_clipboard.py \ r \ n' //
text / plain; charset = utf-8 '/home/user/Downloads/show_clipboard.py'
image / png - '\ x89PNG \ r \ n \ x1a \ n \ x00 \ x00 \ x00 \ rIHDR \ x00 \ x00 \ x00 \ xdc

\ x00 \ x00 \ x00 \ xf4 \ x08 \ x06 \ x00 \ x00 \ x00 \ xf0 \ xa5H \ x […]

image / tiff [empty]
image / x-icon, image / x-ico, image / x-win-bitmap '\ x00 \ x00 \ x01 \ x00 \ x01 \ x00 \ xdc \ xf4 \ x00 \ x00 \ x01 \ x00 \ x00

\ x98a \ x03 \ x00 \ x16 \ x00 \ x00 \ x00 (\ x00 \ x00 \ x00 \ xd […]

image / jpeg '\ xff \ xd8 \ xff \ xe0 \ x00 \ x10JFIF \ x00 \ x01 \ x01 \ x00 \ x00 \ x01 \ x00

\ x01 \ x00 \ x00 \ xff \ xdb \ x00C \ x00 \ x08 \ x06 \ x06 \ […]

image / bmp, image / x-bmp, image / x-MS-bmp 'BMFu \ x02 \ x00 \ x00 \ x00 \ x00 \ x006 \ x00 \ x00 \ x00 (\ x00 \ x00 \ x00

\ xdc \ x00 \ x00 \ x00 \ xf4 \ x00 \ x00 \ x00 \ x01 \ x00 \ x18 […]

application / x-qt-image '\ x89PNG \ r \ n \ x1a \ n \ x00 \ x00 \ x00 \ rIHDR \ x00 \ x00 \ x00 \ xdc \ x00

\ x00 \ x00 \ xf4 \ x08 \ x06 \ x00 \ x00 \ x00 \ xf0 \ xa5H \ x […]

safety

The hijacking of the clipboard is an attack that the contents of the clipboard against a malicious payload as one with viruses exchanges afflicted website. While some security gaps have been closed, the so-called "pastejacking" can continue to be used via JavaScript and thus via every website. Dylan Ayrey found this loophole and provides a website to show that the system is performing actions that the user did not intend.

In 2013, researchers discovered a security risk in password management applications on Android devices. They found that 21 of the most popular of these applications can read passwords. This is done by using another application and accessing the clipboard. Joe Siegrist said this attack affects all Android operating system applications. In 2016, the Fraunhofer Institute SIT found a similar security hole that also made it possible to steal passwords from the clipboard.

Operating system clipboards

Windows

The clipboard in Windows stores an entry in 3 different formats. Each entry is available in at least one of these formats.

  • Windows standard formats (e.g. CF_BITMAP, or CF_UNICODETEXT),
  • Registered formats added by applications (e.g. CF_HTML)
  • Internal formats of applications or the system

Windows also supports delayed rendering of the formats of a cached data object. This means that the application generates a format and moves it to the clipboard only when required. So if an application needs time-consuming processes to prepare the data in a special format, the long-lasting arithmetic operations can be bypassed with this functionality.

Up to and including Windows XP , the clipboard could be accessed using clipbrd.exe. This application allowed the user to save the current clipboard in a CLP file. The file could then be used either in its own system or via transfer within another Windows computer. By importing the CLP into the clipboard using clipbrd.exe, the user can paste the content in the desired location of the target system. This is useful because the different formats are saved and thus also have a working variant ready for other users.

With Windows 10 1809, Microsoft is significantly expanding the possibilities of the clipboard. The clipboard receives a progression that enables several objects or text passages to be transferred to the clipboard. The desired object can then be selected from the history when inserting. In addition, the clipboard history can be synchronized with the cloud (automatically or manually).

The clipboard can also be reached via PowerShell :

# Um den Inhalt eines Ordners in die Zwischenablage einzufügen.
Set-Clipboard -Path "C:\directory\"
# Um den Inhalt der Ablage zu erlangen.
Get-Clipboard

Data can also be saved from the command prompt:

$ # Um den Inhalt eines Ordners in die Zwischenablage zu speichern.
$ dir | clip

macOS

Also macOS stores a record in various formats to the clipboard.

Its content can be displayed using the menu of the Edit button in the Finder and selecting the "Show clipboard" entry. In addition, the clipboard can be used across devices with the same Apple ID, as long as you have activated WLAN , Bluetooth and Handoff. A copied text can be pasted on one device and on a second.

The clipboard can be used with the help of the following commands:

$ # Um Daten in die Zwischenablage zu kopieren.
$ echo 'hello world' | pbcopy
$ # Um aus dem Clipboard heraus einzufügen.
$ pbpaste
hello world

X Window System

The X Window System , which is mainly used in Unix or Linux- based operating systems, provides three clipboards named "PRIMARY", "SECONDARY" and "CLIPBOARD".

The interaction with these is not standardized. However, most modern libraries and desktop environments, such as GNOME or KDE , use a widely used convention specified by freedesktop.org.

“CLIPBOARD” is used identically to its Windows counterpart. The difference to the systems already mentioned is that the data is not stored separately in the clipboard, only its reference. The application takes ownership of the selection and communicates this to the X server . As soon as an insertion takes place, the data object and its available formats are requested by the application and inserted depending on this.

“PRIMARY”, on the other hand, is an X11-specific mechanism. This means that the selection results in the data being copied and pasted using the third or middle mouse button. This process is completely independent of the "CLIPBOARD" variant and therefore does not change its content.

"SECONDARY" was planned as an alternative to "PRIMARY", but is usually not used.

Two commands enable access to the "CLIPBOARD":

$ # Speichern mit Hilfe von xclip.
$ echo text | xclip -in -selection clipboard
$ # Speichern mit Hilfe von xsel.
$ echo text | xsel --clipboard

On the Linux console, GPM (General Purpose Mouse Manager) offers a similar function, but only for text. The insertion takes place on the Linux console with the scroll key of the mouse or the middle mouse button.

AmigaOS

The AmigaOS operating system uses 256 units for the clipboard, so that a user can use several clipboards at the same time. These are stored in a special storage space CLIPS:that is defined by the AmigaDOS allocation . The IFF container format allows any data types to be mixed in a clipboard.

Android

Android provides a framework that caches an object and makes it available system-wide. While simple text is saved directly, complex data structures are saved for reference. The object belongs to one of three different types:

The contents of the clipboard can only be used by applications or the system.

Developers can use the ClipboardManager class to control copying and pasting of data.

iOS

The clipboard in iOS is called "Pasteboard" and works in a similar way to its counterpart in macOS. Applications can create additional pasteboards using instances of the UIPasteboard class. These can be set private or public. An instance can contain one or more entries with different formatting that have been specified by Uniform Type Identifiers.

Similar to Android , the data on the clipboard cannot be accessed via the GUI of the operating system. Only applications and the system itself can access them.

APIs

For many programming languages there are libraries and APIs that provide easy access to the clipboard.

JavaScript

JavaScript provides an interface via an event (ClipboardEvent) that allows reading and setting of data. However, this is not supported by every browser, as manipulation of this memory can pose a security risk.

Qt

The framework for cross-platform user interfaces Qt is used by Python and C ++ , among others . With the QClipboard class, Qt contains a way to access the various clipboard interfaces of the operating systems . This allows common data types in the clipboard to be accessed via functions. Each saved element is typed using MIME and can thus be read out and saved in a specific data type.

Clipboard extensions

Ditto, an alternative clipboard that is licensed under GPLv3.

Clipboard managers add further functions to the already integrated clipboard so that the user can change the memory. Many applications of this type can cache and paste multiple entries. The last entry can still be used as usual. Furthermore, the user is often given the opportunity to see, select, edit, convert to other formats and search through the history of the memory entries.

Since most operating systems ( Windows , macOS , Linux , X11 , Android , iOS ) do not save the contents of the clipboard to the permanent memory, it is deleted as soon as the user logs off or the system restarts. This is why clipboard managers and applications such as the Emacs text editor often implement persistent storage.

Web links

Individual evidence

  1. FOCUS Online: clipboard . In: FOCUS Online . ( focus.de [accessed on October 9, 2018]).
  2. ^ Microsoft: Clipboard Operations. Retrieved October 9, 2018 (American English).
  3. Sarang B. Kimmatkar: Extending Functionalities of default clipboard. . In: (IJCSIT) International Journal of Computer Science and Information Technologies 5 . 6, 2014.
  4. dotnet-bot: overview of drag & drop. Retrieved October 9, 2018 .
  5. ^ A b Larry Tesler: A personal history of modeless text editing and cut / copy-paste . In: Interactions . tape 19 , no. 4 , July 1, 2012, ISSN  1072-5520 , p. 70-75 , doi : 10.1145 / 2212877.2212896 .
  6. ^ Larry Tesler: A User Experience Retrospective . Retrieved October 10, 2018.
  7. Larry Tesler: THE LEGACY OF THE LISA . MacWorld, September 1985.
  8. What is clipboard hijack attack? - Definition from WhatIs.com . In: WhatIs.com . Retrieved October 10, 2018.
  9. Pastejacking in the browser: code execution by copy and paste. Golem.de, accessed on October 10, 2018 .
  10. github.com/dxa4481/Pastejacking . In: GitHub . Retrieved October 10, 2018.
  11. Sascha Fahl, Marian Harbach, Marten Oltrogge, Thomas Muders, Matthew Smith: Hey, You, Get Off of My Clipboard . In: Financial Cryptography and Data Security . Springer Berlin Heidelberg, Berlin, Heidelberg 2013, ISBN 978-3-642-39883-4 , pp. 144-161 , doi : 10.1007 / 978-3-642-39884-1_12 .
  12. Using a password manager on Android? It may be wide open to sniffing attacks . Ars Technica. Retrieved October 10, 2018.
  13. heise online: Android: Password manager with security holes. Retrieved October 9, 2018 .
  14. Clipboard Formats (Windows) ( en ) In: msdn.microsoft.com . Retrieved October 10, 2018.
  15. Standard Clipboard Formats (Windows) ( en ) In: msdn.microsoft.com . Retrieved October 10, 2018.
  16. HTML Clipboard Format (Internet Explorer) ( en ) In: msdn.microsoft.com . Retrieved October 10, 2018.
  17. ^ Microsoft: Clipboard Operations. Retrieved October 9, 2018 (American English).
  18. Functions of CLIPBRD.EXE. In: PCWelt. Retrieved October 9, 2018 .
  19. Activate clipboard synchronization, deactivate or delete Windows 10 Deskmodder Wiki. Retrieved October 3, 2018 .
  20. sdwheeler: Get-Clipboard (Microsoft.PowerShell.Management) ( en-us ) In: docs.microsoft.com . Retrieved October 10, 2018.
  21. sdwheeler: Set-Clipboard (Microsoft.PowerShell.Management) ( en-us ) In: docs.microsoft.com . Retrieved October 10, 2018.
  22. Windowspage Clip - Copy output from command line programs to the clipboard. Retrieved October 9, 2018 .
  23. macOS Sierra: Copy and paste across devices. Retrieved October 9, 2018 .
  24. using terminal to copy a file to clipboard. Retrieved October 9, 2018 .
  25. Clipboard ›Wiki› ubuntuusers.de. Retrieved October 9, 2018 .
  26. clipboards-spec . freedesktop.org. Retrieved August 16, 2014.
  27. a b X11: How does "the" clipboard work? Retrieved October 9, 2018 .
  28. a b xclip ›Wiki› ubuntuusers.de. Retrieved October 9, 2018 .
  29. xsel ›Wiki› ubuntuusers.de. Retrieved October 9, 2018 .
  30. Clipboard Device - AmigaOS Documentation Wiki ( en ) In: wiki.amigaos.net . Retrieved February 3, 2018.
  31. Copy and Paste - Android Developers ( en ) In: developer.android.com . Retrieved October 10, 2018.
  32. ClipboardManager - Android Developers. Retrieved October 9, 2018 .
  33. ^ Uniform Type Identifiers
  34. pasteboard ( s ) In: developer.apple.com . Retrieved October 10, 2018.
  35. Uniform Type Identifier ( en ) In: developer.apple.com . Retrieved February 6, 2018.
  36. Clipboard API and events - ClipboardEvent . In: www.w3.org . Retrieved October 10, 2018.
  37. Clipboard API and events - Synchronous Clipboard API ( en ) In: www.w3.org . Retrieved October 10, 2018.
  38. QClipboard Class - Qt GUI 5.11. Accessed October 10, 2018 .
  39. Ditto