20 questions
0
votes
2
answers
166
views
Using navigator.clipboard to write multiple entries to clipboard
I have up to four form text inputs that I'm trying to get copied to the windows clipboard as individual entries. Using navigator.clipboard.writeText it will successfully copy any one entry, but ...
1
vote
1
answer
191
views
Why am I unable to copy text to the clipboard using the Clipboard API?
I'm trying to make an HTML element where, when clicked, copies some text to the clipboard. I was originally using the Clipboard API, but it doesn't work.
Does anybody know how I can do a similar thing ...
0
votes
0
answers
42
views
Clipboard API: Leading spaces lost on first HTML paragraph when pasting into PowerPoint
I'm using the Clipboard API to copy styled HTML content with leading spaces into Microsoft PowerPoint, and I found that using a combination of and mso-spacerun:yes works well — except for ...
1
vote
1
answer
98
views
Copy HTML to the clipboard and preserve leading spaces when pasting into PowerPoint
I'm using the Clipboard API to copy styled HTML content to the clipboard. When pasting into Microsoft PowerPoint, I want to retain leading spaces for formatting purposes. However, PowerPoint trims ...
0
votes
1
answer
443
views
Chrome permission for clipboard-write returns 'granted' but prompts user
I'm using the following code to check if the the navigator has permission to write to the clipboard:
window.onload = () => {
navigator.permissions.query({ name: 'clipboard-write' }).then((...
1
vote
0
answers
127
views
Copy Canvas content to clipboard in Javascript in iOS
Trying to copy a Canvas content to the Clipboard within a button click event handler
canvas.toBlob(
blob => { navigator.clipboard.write([new ClipboardItem({'image/png': blob})]) }
)
works well on ...
0
votes
0
answers
60
views
Need help in this code Disable printscreen in Angular 14
My exact requirement is I want to disable the printscreen option for the user.
I found one of the solution to disabling the printscreen.But some methods are
deprecated and looking for the working ...
0
votes
1
answer
625
views
How to Integrate Copy to Clipboard with Rainbow Syntax Highlighter
I am trying to integrate a basic, "copy to clipboard" function with Rainbow syntax highlighting library. Each code snippet on the page receives highlighting and can be copied to the ...
2
votes
0
answers
679
views
Clipboard API copy to clipboard and then open new window? Avoid loosing window focus
Is it possible to open a new browser tab after content has been copied into the clipboard?
Currently I'm getting Uncaught (in promise) DOMException: Document is not focused. which I take it that I can'...
3
votes
1
answer
2k
views
How create link with text and paste it to telegram desktop
Im trying create "copy" button for using clipboard in different apps.
I'm expect that:
ctrl+v in simple text editor will create plain text
ctrl+v in RTF (or in app with "link" ...
0
votes
2
answers
95
views
Changing only the name of a variable appears to break JavaScript code to copy a link to the clipboard
I have written a short JavaScript function to write a link to the clipboard so that it will still appear as a clickable link when pasted into programs that support rich text such as Microsoft Word, ...
3
votes
1
answer
437
views
dispatching ClipboardEvent on textarea element does not work
I wont to simulate paste event trough javascript as shown on snipped below
<!DOCTYPE html>
<html>
<body>
<div class="col-xs-10 col-md-9 col-lg-8 form-field ...
4
votes
1
answer
1k
views
Clipboard API used in conjunction with Axios in click event
TL;DR
Is it possible to get the Clipboard API to write text from the result of an Axios get request in Safari even when the writeText() is a direct result of a user event?
Long version
I have an ...
2
votes
0
answers
300
views
JS: Can't use asynchronous clipboard API for pages that will be minimized or put in the background
Example:
<!DOCTYPE html>
<html>
<body>
<script>
setInterval(myFunction, 1000);
function myFunction() {
window.focus()
navigator.clipboard.readText()
}
</script>
&...
0
votes
2
answers
2k
views
How to properly render a success message upon clipboard click and copy
I'm creating a color palette where I have a clipboard icon within a Tooltip component next to each color. On click it will copy the color's name onto the user's clipboard. When that happens, the ...
1
vote
0
answers
740
views
Using the clipboard API from a Google Apps Script Web Application
I have a simple Web-application (written in Google Apps Script using the HtmlService)
When a user clicks a button, it used to "paste" whatever text is on the clipboard to an input field. ...
7
votes
3
answers
7k
views
How to fix the "Cannot find name 'ClipboardItem'" error?
Getting the error
error TS2304: Cannot find name 'ClipboardItem'
when trying to create a ClipboardItem for navigator.clipboard.write().
const clipboardItemInput = new ClipboardItem({'image/png' : ...
2
votes
1
answer
1k
views
Event listener 'Copy' doesn't work with "Copy Link Address"
I want to modify the clipboard so that it becomes the regex match. And that works - as long as I use Ctrl+C or just "Copy". If I click on "Copy link address" (or "Copy link location"), the event ...
1
vote
1
answer
3k
views
How do I prompt user for clipboard read permission in the popup of the chrome extension?
I am building out my first Google Chrome Extension and want to create something that can read and write to the system clipboard.
I am currently putting all the js in a script imported by the popup....
14
votes
2
answers
4k
views
Jekyll Code snippet copy-to-clipboard button
The Problem
I am building a Jekyll site with the minima theme to publish some tutorial online. The tutorial pages contain many code snippets, for example:
```javascript
/* Global scope: this code is ...