ClipboardItem: presentationStyle property
Secure context: This feature is available only in secure contexts (HTTPS), in some or all supporting browsers.
The read-only presentationStyle
property of the ClipboardItem
interface returns a string indicating how an item should be presented.
For example, in some contexts an image might be displayed inline, while in others it might be represented as an attachment.
Value
One of either "unspecified"
, "inline"
or "attachment"
.
Examples
In the below example, we're returning all items on the clipboard via the clipboard.read()
method, then logging the presentationStyle
property.
js
async function getClipboardContents() {
try {
const clipboardItems = await navigator.clipboard.read();
for (const clipboardItem of clipboardItems) {
console.log(clipboardItem.presentationStyle);
}
} catch (err) {
console.error(err.name, err.message);
}
}
Specifications
Specification |
---|
Clipboard API and events # dom-clipboarditem-presentationstyle |
Browser compatibility
Report problems with this compatibility data on GitHubdesktop | mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
presentationStyle |
Legend
Tip: you can click/tap on a cell for more information.
- Full support
- Full support
- No support
- No support
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.