Skip to content

Commit

Permalink
add default type text/javascript of none is defined to correct functi…
Browse files Browse the repository at this point in the history
…on updateAllowedElementScript (#37)

An update to fix for issue #33 - Scripts without type="text/javascript" gets initialized as type="undefined" and doesn't fire
Previous fix added fallback only to `updateAllowedElementOther()`, but it was needed in `updateAllowedElementScript()` too.
  • Loading branch information
donatasben authored Nov 24, 2024
1 parent dbcdc2f commit 9f6fb60
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/js/PrivacyWire.js
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,7 @@ class PrivacyWire {
for (const key of Object.keys(dataset)) {
newEl.dataset[key] = el.dataset[key]
}
newEl.type = dataset.type
newEl.type = dataset.type ?? 'text/javascript'
if (dataset.src) {
newEl.src = dataset.src
}
Expand Down

0 comments on commit 9f6fb60

Please sign in to comment.