MCPcopy Create free account
hub / github.com/pgadmin-org/pgadmin4 / copyToClipboard

Function copyToClipboard

web/pgadmin/static/js/clipboard.js:3–11  ·  view source on GitHub ↗
(text)

Source from the content-addressed store, hash-verified

1import pgAdmin from 'sources/pgadmin';
2
3export async function copyToClipboard(text) {
4 try {
5 await navigator.clipboard.writeText(text);
6 } catch {
7 /* Suppress error */
8 pgAdmin.Browser.notifier.error('Does not have clipboard access');
9 }
10 localStorage.setItem('clipboard', text);
11}
12
13export function getFromClipboard() {
14 return localStorage.getItem('clipboard');

Callers 3

psql_terminal_ioFunction · 0.90
CopyButtonFunction · 0.90
postTreeReadyFunction · 0.90

Calls 1

errorMethod · 0.80

Tested by

no test coverage detected