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 |
ブラウザーの互換性
BCD tables only load in the browser