Skip to content

Commit 08c8470

Browse files
[pre-commit.ci lite] apply automatic fixes
1 parent 0615dad commit 08c8470

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/shareon.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ const urlBuilderMap = {
4141
};
4242

4343
const openUrl = (buttonUrl) => () => {
44-
window.open(buttonUrl, "_blank", "noopener,noreferrer");
44+
globalThis.open(buttonUrl, "_blank", "noopener,noreferrer");
4545
};
4646

4747
const init = () => {
@@ -63,7 +63,7 @@ const init = () => {
6363
child.addEventListener("click", () => {
6464
const url = child.dataset.url ||
6565
container.dataset.url ||
66-
window.location.href;
66+
globalThis.location.href;
6767
navigator.clipboard.writeText(url);
6868
child.classList.add("done");
6969
setTimeout(() => {
@@ -75,7 +75,7 @@ const init = () => {
7575
// if it's "Print"
7676
if (cls === "print") {
7777
child.addEventListener("click", () => {
78-
window.print();
78+
globalThis.print();
7979
});
8080
}
8181

@@ -88,7 +88,7 @@ const init = () => {
8888
text: child.dataset.text || container.dataset.text || "",
8989
url: child.dataset.url ||
9090
container.dataset.url ||
91-
window.location.href,
91+
globalThis.location.href,
9292
};
9393

9494
if (navigator.canShare && navigator.canShare(data)) {
@@ -106,7 +106,7 @@ const init = () => {
106106
url: encodeURIComponent(
107107
child.dataset.url ||
108108
container.dataset.url ||
109-
window.location.href,
109+
globalThis.location.href,
110110
),
111111
title: encodeURIComponent(
112112
child.dataset.title ||

0 commit comments

Comments
 (0)