Skip to content

Commit

Permalink
[se] By get data from clipboard
Browse files Browse the repository at this point in the history
  • Loading branch information
GoshaZotov committed Feb 13, 2025
1 parent 0154689 commit 4463223
Showing 1 changed file with 22 additions and 2 deletions.
24 changes: 22 additions & 2 deletions common/clipboard_base.js
Original file line number Diff line number Diff line change
Expand Up @@ -954,6 +954,26 @@
{
if (navigator.clipboard)
{

/*async function getClipboardData() {
try {
const clipboardContents = await navigator.clipboard.read();
for (const item of clipboardContents) {
if (item.types.includes("image/png")) {
}
const blob = await item.getType("image/png");
}
} catch (error) {
//log(error.message);
}
}
getClipboardData();
return;*/


let copy_data = {
data : {},
pushData: function (format, value) {
Expand All @@ -971,8 +991,8 @@
//https://webkit.org/blog/10855/async-clipboard-api/
const data = [new ClipboardItem({
"text/plain" : new Blob([copy_data.data[c_oAscClipboardDataFormat.Text]], {type: "text/plain"}),
"text/html" : new Blob([copy_data.data[c_oAscClipboardDataFormat.Html]], {type: "text/html"}),
"image/png" : copy_data.data[c_oAscClipboardDataFormat.Image]
"text/html" : new Blob([copy_data.data[c_oAscClipboardDataFormat.Html]], {type: "text/html"})
//"image/png" : copy_data.data[c_oAscClipboardDataFormat.Image]
/*"web text/x-custom" : new Blob(["asc_internalData2;" + copy_data.data[c_oAscClipboardDataFormat.Internal]], {type: "web text/x-custom"})/*,//not support
*/
})];
Expand Down

0 comments on commit 4463223

Please sign in to comment.