ClipboardItem.presentationStyle
presentationStyle
は ClipboardItem
インターフェイスの読み取り専用プロパティで、アイテムをどう表示すべきかを示す文字列を返します。
値
"unspecified"
, "inline"
, "attachment"
のいずれかです。
例
以下の例では、 clipboard.read()
メソッドによってクリップボード上のすべての項目を返し、 presentationStyle
プロパティをログ出力しています。
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);
}
}
仕様書
Specification |
---|
Clipboard API and events # dom-clipboarditem-presentationstyle |
ブラウザーの互換性
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.