50 lines
2.2 KiB
Plaintext
50 lines
2.2 KiB
Plaintext
|
클립보드 다이얼로그
|
||
|
|
||
|
"Failed to execute 'query' on 'Permissions': The provided value 'clipboard' is not a valid enum value of type PermissionName."
|
||
|
"TypeError: Failed to execute 'query' on 'Permissions': The provided value 'clipboard' is not a valid enum value of type PermissionName.
|
||
|
at FormSectionComponent.onPasteReply (http://localhost:4200/pages-chat-chat-page-module.27fafdb1d452d17534ca.hot-update.js:251:14)
|
||
|
at FormSectionComponent_Template_textarea_paste_8_listener (http://localhost:4200/pages-chat-chat-page-module.27fafdb1d452d17534ca.hot-update.js:351:282)
|
||
|
at executeListenerWithErrorHandling (http://localhost:4200/vendor.js:54608:16)
|
||
|
at wrapListenerIn_markDirtyAndPreventDefault (http://localhost:4200/vendor.js:54650:22)
|
||
|
at HTMLTextAreaElement.<anonymous> (http://localhost:4200/vendor.js:125315:38)
|
||
|
at ZoneDelegate.invokeTask (http://localhost:4200/polyfills.js:443:35)
|
||
|
at Object.onInvokeTask (http://localhost:4200/vendor.js:71697:33)
|
||
|
at ZoneDelegate.invokeTask (http://localhost:4200/polyfills.js:442:40)
|
||
|
at Zone.runTask (http://localhost:4200/polyfills.js:211:51)
|
||
|
at ZoneTask.invokeTask [as invoke] (http://localhost:4200/polyfills.js:524:38)"
|
||
|
|
||
|
|
||
|
navigator.permissions
|
||
|
.query({
|
||
|
name: 'clipboard-read' as PermissionName
|
||
|
})
|
||
|
.then((permissionStatus) => {
|
||
|
// Will be 'granted', 'denied' or 'prompt':
|
||
|
console.log(permissionStatus.state);
|
||
|
|
||
|
// Listen for changes to the permission state
|
||
|
permissionStatus.onchange = () => {
|
||
|
console.log(permissionStatus.state);
|
||
|
};
|
||
|
});
|
||
|
|
||
|
|
||
|
navigator.permissions
|
||
|
.query({ name: 'clipboard-read' as PermissionName })
|
||
|
.then((result: PermissionStatus) => {
|
||
|
console.log('1: ', result);
|
||
|
if ('granted' === result.state || 'prompt' === result.state) {
|
||
|
console.log(event.clipboardData.items);
|
||
|
navigator.clipboard
|
||
|
.readText()
|
||
|
.then((value) => {
|
||
|
console.log(value);
|
||
|
})
|
||
|
.catch((reason) => {
|
||
|
console.log(reason);
|
||
|
});
|
||
|
}
|
||
|
})
|
||
|
.catch((reason) => {
|
||
|
console.log(reason);
|
||
|
});
|