Skip to content

Commit 06ee42f

Browse files
try to patch fathom's script el to support SPAs
1 parent 3143cf5 commit 06ee42f

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

fathom-data-attr.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
const spaValue = "auto";
2+
3+
function addDataAttr() {
4+
const el = document.getElementById("fathom-script");
5+
const dataSpaValue = el.dataset.spa;
6+
7+
if (dataSpaValue === undefined) {
8+
el.dataset.spa = spaValue;
9+
}
10+
}
11+
12+
addDataAttr();

0 commit comments

Comments
 (0)