Skip to content

Commit 167e29f

Browse files
chore(docs): remove any old Carbonads scripts from <head> (#5422)
* chore(docs): remove any old Carbonads scripts from `<head>` * Update carbon-ad.js * Update carbon-ad.js Co-authored-by: Jacob Müller <jacob.mueller.elz@gmail.com>
1 parent f098f40 commit 167e29f

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

docs/components/carbon-ad.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,15 @@ export default {
3030
}
3131
},
3232
mounted() {
33+
// Remove any leftover Carbonads scripts from the `<head>`
34+
const $nodes = document.querySelectorAll('head > script[id="_carbonads_projs"]')
35+
for (const $node of $nodes) {
36+
try {
37+
$node.parentNode.removeChild($node)
38+
} catch {}
39+
}
40+
41+
// Show the new ad
3342
this.$nextTick(() => {
3443
requestAnimationFrame(() => {
3544
this.mounted = true

0 commit comments

Comments
 (0)