Skip to content

Commit

Permalink
[pre-commit.ci lite] apply automatic fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
pre-commit-ci-lite[bot] authored Jan 28, 2025
1 parent 0615dad commit 08c8470
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/shareon.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ const urlBuilderMap = {
};

const openUrl = (buttonUrl) => () => {
window.open(buttonUrl, "_blank", "noopener,noreferrer");
globalThis.open(buttonUrl, "_blank", "noopener,noreferrer");
};

const init = () => {
Expand All @@ -63,7 +63,7 @@ const init = () => {
child.addEventListener("click", () => {
const url = child.dataset.url ||
container.dataset.url ||
window.location.href;
globalThis.location.href;
navigator.clipboard.writeText(url);
child.classList.add("done");
setTimeout(() => {
Expand All @@ -75,7 +75,7 @@ const init = () => {
// if it's "Print"
if (cls === "print") {
child.addEventListener("click", () => {
window.print();
globalThis.print();
});
}

Expand All @@ -88,7 +88,7 @@ const init = () => {
text: child.dataset.text || container.dataset.text || "",
url: child.dataset.url ||
container.dataset.url ||
window.location.href,
globalThis.location.href,
};

if (navigator.canShare && navigator.canShare(data)) {
Expand All @@ -106,7 +106,7 @@ const init = () => {
url: encodeURIComponent(
child.dataset.url ||
container.dataset.url ||
window.location.href,
globalThis.location.href,
),
title: encodeURIComponent(
child.dataset.title ||
Expand Down

0 comments on commit 08c8470

Please sign in to comment.