Clipboard (computing)

Last updated

The clipboard is a buffer that some operating systems provide for short-term storage and transfer within and between application programs. The clipboard is usually temporary and unnamed, and its contents reside in the computer's RAM. [1]

Contents

The clipboard provides an application programming interface by which programs can specify cut, copy and paste operations. It is left to the program to define methods for the user to command these operations, which may include keybindings and menu selections. When an element is copied or cut, the clipboard must store enough information to enable a sensible result no matter where the element is pasted. Application programs may extend the clipboard functions that the operating system provides. A clipboard manager may give the user additional control over the clipboard. Specific clipboard semantics vary among operating systems, can also vary between versions of the same system, and can sometimes be changed by programs and by user preferences.

Windows, Linux and macOS support a single clipboard transaction. [2] [3]

History

Clipboards as buffers for small text snippets were first used by Pentti Kanerva when he used it to store deleted texts in order to restore them. [4] Since one could delete a text in one place and restore it in another, the term "delete" wasn't what one would expect in this case. Larry Tesler renamed this in 1973 as cut, copy, and paste and coined the term "clipboard" for this buffer, since these techniques need a clipboard for temporary saving the copied or cut data. [5]

Data formats

Applications communicate through the clipboard by providing either serialized representations of an object, or a promise (for larger objects). [6] In some circumstances, the transfer of certain common data formats may be achieved opaquely through the use of an abstract factory; for example, Mac OS X uses a class called NSImage to provide access to image data stored on the clipboard, though the actual format of the image data backing the object is hidden. The sending and receiving application negotiate the formats which can be transferred in between them, oftentimes with the active GUI widget responsible for providing acceptable type transformations. The pasteboard allows for transfer of common items such as URLs, colors, images, strings, attributed strings (Rich text), and sounds. The operating system and GUI toolkit may provide some common conversions, for example converting from rich text to plain text and vice versa. Various type identifiers for data transfer are supported by modern operating systems, which may automatically provide acceptable mappings between type systems, such as between MIME and Uniform Type Identifier. [7] [8]

Computer security

Clipboard hijacking is an exploit in which a person's clipboard's content is replaced by malicious data, such as a link to a malicious web site. [9] While some security-holes were patched, JavaScript can still be used to modify clipboard content via an attack dubbed 'pastejacking'. [10] [11] Dylan Ayrey who developed the attack set up a website that demonstrates how this exploit can be used to trick a user into running commands they didn't want to run. [12]

There have been exploits where web pages grab clipboard data. In early 2013 researchers exposed risks stemming from Android-based password managers and documented how passwords in 21 of the most popular of these apps could be accessed by any other app on an Android device including those with extremely low-level privileges. [13] Joe Siegrist notes that this is an "OS-level issue that impacts everything running on Android". [14] [1]

Clipboard management and extensions

Glipper, an example of a clipboard management program Glipper menu.png
Glipper, an example of a clipboard management program

Clipboard manager extensions add functionality to the integrated clipboard functions of an operating system. They are applications that enable the user to manipulate the clipboard. On platforms such as Linux that use multiple incompatible GUI toolkits, clipboard managers are often used to transfer data between applications using different such frameworks.

When a clipboard manager provides multiple cut and paste transactions, the clipboard is treated as a stack or scrap book, with new cuts and copies being placed on a list of recent transactions. The standard paste operation copies the most recent transaction, while specialized pastes provide access to the other stored transactions. These managers generally also provide a window that displays the transaction history and allows the user to select earlier copies, edit them, change their format and even search amongst them.

Since most operating systems (e.g. Windows, macOS, Linux, X11, Android, iOS) do not save the clipboard contents to any persistent storage – when a user logs out or reboots the system the clipboard contents are deleted – an added functionality is to save the clipboard persistently. Another example is making the local clipboard work with online applications by saving the clipboard data to the online location upon a copy or cut event, making this data available to online applications for pasting. Clipboard managers can also serve as tools to overcome the limitation of software not supporting copying and pasting (for example, while logging into remote Windows server, one cannot copy and paste their user name and password).

Operating system-specific clipboards

AmigaOS

The Amiga operating system uses 256 units, so one has multiple clipboards at the same time. [15]

Android

Android provides a clipboard that can hold up to one clip object and is accessible system-wide. Simple text is stored directly in the clipboard; complex data are stored by reference. The clip object has one of three formats: text string, URI object, or intent. [16]

To interact with the clipboard, an app uses the class ClipboardManager [17] and system calls to cut, copy, and paste objects.

In Android 8.0, the clipboard first appears in the user interface: In a situation where the user prepares to paste from the clipboard, a "Clipboard" option appears that gives the user access to many objects copied or cut to the clipboard in the past. Apart from that, and in earlier versions, the user has no access to the clipboard except in apps that make it available to the user.

iOS

The clipboard is called "pasteboard" in iOS similar to OS X. Apps on this operating system can create additional pasteboards, called instances of the UIPasteboard class, which can be public or private. One instance can hold a single item or multiple items in different formats. [18]

The formats are identified by Uniform Type Identifiers (UTI). [19]

The data contained in the pasteboard cannot be accessed via the GUI but only from the system and applications

macOS

The clipboard in macOS holds one item in multiple available formats.

The contents of the clipboard can be viewed by selecting the Show Clipboard menu item from the Finder's Edit menu. The raw data and the stored formats can be seen using the ClipboardViewer. [20]

Using the following commands the clipboard can be accessed from the command line: [21] [22]

$ # to copy data into the clipboard:$ echo'hello world'|pbcopy $ # to paste from the clipboard:$ pbpaste hello world

Microsoft Windows and ReactOS

clip
Developer(s) Microsoft, ReactOS Contributors
Operating system Windows, ReactOS
Type Command
License Windows: Proprietary commercial software
ReactOS: GNU General Public License
Website docs.microsoft.com/en-us/windows-server/administration/windows-commands/clip

The clipboard in Microsoft Windows and ReactOS holds one item in multiple available formats.

Every item has at least one clipboard format, but can have different types of format of the same data. The three different types of possible formats are: [23]

Up to and including Windows XP the clipboard could be accessed via the ClipBook Viewer application. [26] In newer versions of Windows the content can be accessed via clipboard managers.

Data can be stored to the Windows [27] and ReactOS [28] clipboard via command line using the clip command: [29]

$ # to paste the content of a folder to the clipboard:$ dir|clip 

The clipboard can also be accessed via PowerShell: [30] [31]

# to paste the content of a directory to the clipboardSet-Clipboard-Path"C:\directory\"# to get the content of the clipboardGet-Clipboard

Windows 10 and Windows 11 include the Clipboard application, allowing for the storage of multiple text-based clipboard items. It can be accessed by pressing Windows+V.

X Window System

The X Window System commonly used on Unix and Linux systems provides three clipboards, which are named "CLIPBOARD", "PRIMARY" and "SECONDARY". [32] The usage and handling of various selections is not standardized. However, most modern toolkits and desktop environments, such as GNOME or KDE, follow a widely accepted convention, outlined in the freedesktop.org specification. [33] One selection, CLIPBOARD, is used for traditional clipboard semantics, with shortcuts identical to Windows. Another selection, PRIMARY, is an X11-specific mechanism. Data is "copied" immediately upon highlighting and pasted with the third (middle) mouse button. [34] This copied data is usually separated from the CLIPBOARD selection and does not change its contents. [35] SECONDARY was planned as an alternative to PRIMARY but is only used inconsistently. [32]

There are two command line tools (xsel and xclip) which can access the clipboard: [36]

$# to paste standard output to the clipboard using xclip $echotext|xclip-in-selectionclipboard $# to paste standard output to the clipboard using xsel $echotext|xsel--clipboard 

The main difference to OS X and Windows is that no data is actually stored in the CLIPBOARD-clipboard but only the reference to the copied or cut data. The application claims the ownership of the CLIPBOARD selection and communicates its ownership to the X Server. [34] When pasting this data, the data and its available formats are requested from the application that owns the CLIPBOARD selection. [37]

APIs

Applications can access the clipboard or its data via APIs.

JavaScript

In JavaScript a class which detects changes in the users clipboard data (ClipboardEvent) [38] and functions to alter the content of a clipboard or read from it (clipboardData.getData(), clipboardData.setData()) [39] exist, but aren't supported by every browser since altering the clipboard of a user can represent a security issue.

Qt

In Qt a wrapper for every supported platform [40] exists. It provides access to window system clipboards with the use of the class QClipboard. This class facilitates access to common data types by functions. [41] The data type of the element stored in the clipboard is indicated via MIME and MIME data can also be put in the clipboard with help of functions from this class.

See also

Related Research Articles

<span class="mw-page-title-main">Microsoft Office</span> Suite of office software

Microsoft Office, or simply Office, is a discontinued family of client software, server software, and services developed by Microsoft. It was first announced by Bill Gates on August 1, 1988, at COMDEX in Las Vegas. Initially a marketing term for an office suite, the first version of Office contained Microsoft Word, Microsoft Excel, and Microsoft PowerPoint. Over the years, Office applications have grown substantially closer with shared features such as a common spell checker, Object Linking and Embedding data integration and Visual Basic for Applications scripting language. Microsoft also positions Office as a development platform for line-of-business software under the Office Business Applications brand.

In computing, cross-platform software is computer software that is designed to work in several computing platforms. Some cross-platform software requires a separate build for each platform, but some can be directly run on any platform without special preparation, being written in an interpreted language or compiled to portable bytecode for which the interpreters or run-time packages are common or standard components of all supported platforms.

Object Linking & Embedding (OLE) is a proprietary technology developed by Microsoft that allows embedding and linking to documents and other objects. For developers, it brought OLE Control Extension (OCX), a way to develop and use custom user interface elements. On a technical level, an OLE object is any object that implements the IOleObject interface, possibly along with a wide range of other interfaces, depending on the object's needs.

In human–computer interaction and user interface design, cut, copy, and paste are related commands that offer an interprocess communication technique for transferring data through a computer's user interface. The cut command removes the selected data from its original position, while the copy command creates a duplicate; in both cases the selected data is kept in temporary storage. The data from the clipboard is later inserted wherever a paste command is issued. The data remains available to any application supporting the feature, thus allowing easy data transfer between applications.

A clipboard manager is a computer program that adds functionality to an operating system's clipboard. Many clipboards provide only one buffer for the "copy and paste" function, and it is overwritten by each new "copy" operation. The main task of a clipboard manager is to store data copied to the clipboard in a way that permits extended use of the data.

The Media Transfer Protocol (MTP) is an extension to the Picture Transfer Protocol (PTP) communications protocol that allows media files to be transferred automatically to and from portable devices. Whereas PTP was designed for downloading photographs from digital cameras, Media Transfer Protocol allows the transfer of music files on digital audio players and media files on portable media players, as well as personal information on personal digital assistants. MTP is a key part of WMDRM10-PD, a digital rights management (DRM) service for the Windows Media platform. In 2011, it became the standard method to transfer files to and from Android.

In computing, a file association associates a file with an application capable of opening that file. More commonly, a file association associates a class of files with a corresponding application.

<span class="mw-page-title-main">Password Safe</span> Free password manager by Bruce Schneier

Password Safe is a free and open-source password manager program originally written for Microsoft Windows but supporting wide area of operating systems with compatible clients available for Linux, FreeBSD, Android, IOS, BlackBerry and other operating systems as well.

<span class="mw-page-title-main">Crash reporter</span> System software that identify and report crash details

A crash reporter is usually a system software whose function is to identify reporting crash details and to alert when there are crashes, in production or on development / testing environments. Crash reports often include data such as stack traces, type of crash, trends and version of software. These reports help software developers- Web, SAAS, mobile apps and more, to diagnose and fix the underlying problem causing the crashes. Crash reports may contain sensitive information such as passwords, email addresses, and contact information, and so have become objects of interest for researchers in the field of computer security.

<span class="mw-page-title-main">Live Clipboard</span>

Live Clipboard is an extensible data format and set of UI technologies used to support copy/paste operations between web applications in browsers, and between web and desktop applications. Unlike the typical copy/paste experience in browsers, the Live Clipboard mechanism never needs to display a security dialog to the end user, thus delivering a more streamlined user experience.

<span class="mw-page-title-main">Adobe AIR</span> Cross-platform runtime system for building rich web applications

Adobe AIR is a cross-platform runtime system currently developed by Harman International, in collaboration with Adobe Inc., for building desktop applications and mobile applications, programmed using Adobe Animate, ActionScript, and optionally Apache Flex. It was originally released in 2008. The runtime supports installable applications on Windows, macOS, and mobile operating systems, including Android, iOS, and BlackBerry Tablet OS.

The Android Package with the file extension apk is the file format used by the Android operating system, and a number of other Android-based operating systems for distribution and installation of mobile apps, mobile games and middleware. A file using this format can be built from source code written in either Java or Kotlin.

<span class="mw-page-title-main">Qt Creator</span> QT development environment

Qt Creator is a cross-platform C++, JavaScript, Python and QML integrated development environment (IDE) which simplifies GUI application development. It is part of the SDK for the Qt GUI application development framework and uses the Qt API, which encapsulates host OS GUI function calls. It includes a visual debugger and an integrated WYSIWYG GUI layout and forms designer. The editor has features such as syntax highlighting and autocompletion. Qt Creator uses the C++ compiler from the GNU Compiler Collection on Linux. On Windows it can use MinGW or MSVC with the default install and can also use Microsoft Console Debugger when compiled from source code. Clang is also supported.

<span class="mw-page-title-main">Symbian</span> Discontinued mobile operating system

Symbian is a discontinued mobile operating system (OS) and computing platform designed for smartphones. It was originally developed as a proprietary software OS for personal digital assistants in 1998 by the Symbian Ltd. consortium. Symbian OS is a descendant of Psion's EPOC, and was released exclusively on ARM processors, although an unreleased x86 port existed. Symbian was used by many major mobile phone brands, like Samsung, Motorola, Sony Ericsson, and above all by Nokia. It was also prevalent in Japan by brands including Fujitsu, Sharp and Mitsubishi. As a pioneer that established the smartphone industry, it was the most popular smartphone OS on a worldwide average until the end of 2010, at a time when smartphones were in limited use, when it was overtaken by iOS and Android. It was notably less popular in North America.

<span class="mw-page-title-main">KeePass</span> Computer password management utility

KeePass Password Safe is a free and open-source password manager primarily for Windows. It officially supports macOS and Linux operating systems through the use of Mono. Additionally, there are several unofficial ports for Windows Phone, Android, iOS, and BlackBerry devices, which normally work with the same copied or shared (remote) password database. KeePass stores usernames, passwords, and other fields, including free-form notes and file attachments, in an encrypted file. This file can be protected by any combination of a master password, a key file, and the current Windows account details. By default, the KeePass database is stored on a local file system.

click.to is an application software that integrates with the operating system clipboard to enhance copy and paste operations. It analyzes data stored on the clipboard and offers the user a choice of appropriate paste-destination programs or web pages from a context menu. click.to is a product of Axonic Informationssysteme GmbH, headquartered in Karlsruhe, Germany.

mpv (media player) Free and open-source media player software

mpv is free and open-source media player software based on MPlayer, mplayer2 and FFmpeg. It runs on several operating systems, including Unix-like operating systems and Microsoft Windows, along with having an Android port called mpv-android. It is cross-platform, running on ARM, PowerPC, x86/IA-32, x86-64, and MIPS architecture.

In the context of mobile apps, deep linking consists of using a uniform resource identifier (URI) that links to a specific location within a mobile app rather than simply launching the app. Deferred deep linking allows users to deep link to content even if the app is not already installed. Depending on the mobile device platform, the URI required to trigger the app may be different.

<span class="mw-page-title-main">Google Sheets</span> Cloud-based spreadsheet software

Google Sheets is a spreadsheet application included as part of the free, web-based Google Docs Editors suite offered by Google. Google Sheets is available as a web application; a mobile app for: Android, iOS, and as a desktop application on Google's ChromeOS. The app is compatible with Microsoft Excel file formats. The app allows users to create and edit files online while collaborating with other users in real-time. Edits are tracked by which user made them, along with a revision history. Where an editor is making changes is highlighted with an editor-specific color and cursor. A permissions system regulates what users can do. Updates have introduced features that use machine learning, including "Explore", which offers answers based on natural language questions in the spreadsheet. Sheets is one of the services provided by Google that also includes Google Docs, Google Slides, Google Drawings, Google Forms, Google Sites and Google Keep.

macOS Sierra Thirteenth major release of macOS

macOS Sierra is the thirteenth major release of macOS, Apple Inc.'s desktop and server operating system for Macintosh computers. The name "macOS" stems from the intention to unify the operating system's name with that of iOS, iPadOS, watchOS and tvOS. Sierra is named after the Sierra Nevada mountain range in California and Nevada. Its major new features concern Continuity, iCloud, and windowing, as well as support for Apple Pay and Siri.

References

  1. 1 2 "What is a Clipboard in Computing? - Definition from Techopedia". Techopedia.com. Archived from the original on 2018-02-02. Retrieved 2018-02-01.
  2. Kimmatkar, Sarang B. (2014). "Extending functionalities of default clipboard". (IJCSIT) International Journal of Computer Science and Information Technologies 5. 6.
  3. Stephens, Rod (2010). Visual Basic 2010 : programmer's reference . Library Genesis. Indianapolis, IN : Wiley Pub., Inc. ISBN   978-0-470-49983-2.
  4. Moggridge, Bill (2007). Designing interactions . Cambridge, Massachusetts: MIT Press. p.  65ff. ISBN   9780262134743.
  5. Larry Tesler. "A User Experience Retrospective". Archived from the original on 2018-02-02. Retrieved 23 January 2018.
  6. "Dragging Files". developer.apple.com. Retrieved 9 December 2018.
  7. "NSPasteboard - AppKit | Apple Developer Documentation". developer.apple.com. Archived from the original on 2018-05-26. Retrieved 9 December 2018.
  8. "Adopting Uniform Type Identifiers". developer.apple.com. Archived from the original on 2018-07-21. Retrieved 9 December 2018.
  9. "What is clipboard hijack attack? - Definition from WhatIs.com". WhatIs.com. Archived from the original on 2017-01-05. Retrieved 4 January 2017.
  10. Chirgwin, Richard. "Pastejack attack turns your clipboard into a threat". The Register. Archived from the original on 2017-01-04. Retrieved 4 January 2017.
  11. "Researcher warns of 'pastejacking' hack attacks targeting users' clipboards". Graham Cluley. 26 May 2016. Archived from the original on 2017-01-05. Retrieved 4 January 2017.
  12. "dxa4481/Pastejacking". GitHub. Archived from the original on 2017-01-04. Retrieved 4 January 2017.
  13. Fahl, Sascha; Harbach, Marian; Oltrogge, Marten; Muders, Thomas; Smith, Matthew (2013). "Hey, You, Get Off of My Clipboard" (PDF). Financial Cryptography and Data Security. Lecture Notes in Computer Science. Vol. 7859. pp. 144–161. doi:10.1007/978-3-642-39884-1_12. ISBN   978-3-642-39883-4. Archived (PDF) from the original on 2017-09-19. Retrieved 4 January 2017.
  14. "Using a password manager on Android? It may be wide open to sniffing attacks". Ars Technica. 21 November 2014. Archived from the original on 2017-01-04. Retrieved 4 January 2017.
  15. "Clipboard Device - AmigaOS Documentation Wiki". wiki.amigaos.net. Archived from the original on 2018-02-05. Retrieved 2018-02-03.
  16. "Copy and Paste | Android Developers". developer.android.com. Archived from the original on 2018-02-07. Retrieved 2018-02-06.
  17. "ClipboardManager | Android Developers". developer.android.com. Archived from the original on 2018-02-07. Retrieved 2018-02-02.
  18. "Pasteboard". developer.apple.com. Archived from the original on 2018-02-07. Retrieved 2018-02-01.
  19. "Uniform Type Identifier". developer.apple.com. Archived from the original on 2018-02-07. Retrieved 2018-02-06.
  20. "ClipboardViewer". developer.apple.com. Archived from the original on 2018-02-07. Retrieved 2018-02-06.
  21. "Copy to clipboard from terminal in OS X". rogeriopvl.com. Archived from the original on 2013-08-15. Retrieved 2013-07-02.
  22. "pbcopy(1) Mac OS X Manual Page". apple.com. Archived from the original on 2014-03-28. Retrieved 2013-07-02.
  23. "Clipboard Formats (Windows)". msdn.microsoft.com. Archived from the original on 2018-02-07. Retrieved 2018-02-03.
  24. "Standard Clipboard Formats (Windows)". msdn.microsoft.com. Archived from the original on 2018-02-07. Retrieved 2018-02-03.
  25. "HTML Clipboard Format (Internet Explorer)". msdn.microsoft.com. Archived from the original on 2018-02-07. Retrieved 2018-02-03.
  26. "View & Manage Clipboard In Windows 10/8/7". The Windows Club. 2013-04-12. Archived from the original on 2018-02-12. Retrieved 2018-02-06.
  27. "clip | Microsoft Docs". Docs.microsoft.com. 2017-10-16. Retrieved 2019-09-26.
  28. "reactos/base/applications/cmdutils/clip at master · reactos/reactos · GitHub". Github.com. Retrieved 2019-09-26.
  29. "How to Copy Command Line Output to the Windows Clipboard". www.labnol.org. Archived from the original on 2018-02-07. Retrieved 2018-02-06.
  30. sdwheeler. "Get-Clipboard (Microsoft.PowerShell.Management)". docs.microsoft.com. Archived from the original on 2018-01-26. Retrieved 2018-02-06.
  31. sdwheeler. "Set-Clipboard (Microsoft.PowerShell.Management)". docs.microsoft.com. Archived from the original on 2018-02-07. Retrieved 2018-02-06.
  32. 1 2 "Clipboard - ArchWiki". wiki.archlinux.org. Archived from the original on 2018-02-17. Retrieved 2018-02-16.
  33. "clipboards-spec". freedesktop.org. Archived from the original on 2014-12-24. Retrieved 2014-08-16.
  34. 1 2 "Copy & Paste, Drag & Drop [MI Wiki]". wiki.mi.ur.de (in German). Archived from the original on 2018-02-16. Retrieved 2018-02-16.
  35. "gnu.org". www.gnu.org. Archived from the original on 2017-12-24. Retrieved 2018-02-16.
  36. "Copying and Pasting To and From the System Clipboard On The Command Line — Fernando Basso". fernandobasso.github.io. Archived from the original on 2018-02-07. Retrieved 2018-02-06.
  37. "X Selections, X Cut Buffers, and Emacs Kill Rings". www.jwz.org. Archived from the original on 2018-03-04. Retrieved 2018-02-02.
  38. "Clipboard API and events – ClipboardEvent". www.w3.org. Archived from the original on 2018-01-28. Retrieved 2018-02-08.
  39. "Clipboard API and events – Synchronous Clipboard API". www.w3.org. Archived from the original on 2018-01-28. Retrieved 2018-02-08.
  40. "platforms\plugins\src - qt/qtbase.git - Qt Base (Core, Gui, Widgets, Network, ...)". code.qt.io. Archived from the original on 2018-02-09. Retrieved 2018-02-02.
  41. "QClipboard Class | Qt GUI 5.10". doc.qt.io. Archived from the original on 2018-02-02. Retrieved 2018-02-02.

Further reading