MCPcopy
hub / github.com/sallar/github-contributions-chart / share

Function share

src/utils/export.js:39–59  ·  view source on GitHub ↗
(canvas)

Source from the content-addressed store, hash-verified

37}
38
39export async function share(canvas) {
40 try {
41 canvas.toBlob(async (blob) => {
42 navigator
43 .share({
44 title: "GitHub Contributions",
45 text: "Check out my #GitHubContributions history over time. A free tool by @sallar and friends. https://github-contributions.vercel.app",
46 files: [
47 new File([blob], "contributions.png", {
48 type: blob.type
49 })
50 ]
51 })
52 .catch(() => {
53 // do nothing
54 });
55 }, "image/png");
56 } catch (err) {
57 console.error(err);
58 }
59}
60
61export async function copyToClipboard(canvas) {
62 if ("ClipboardItem" in window) {

Callers 1

onShareFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected