8000 chore(docs): remove any old Carbonads scripts from `<head>` · bootstrap-vue/bootstrap-vue@32ea8b3 · GitHub
[go: up one dir, main page]

Skip to content

Commit 32ea8b3

Browse files
authored
chore(docs): remove any old Carbonads scripts from <head>
1 parent cfb83bd commit 32ea8b3

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

docs/components/carbon-ad.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,14 @@ 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 (let node of nodes) {
36+
try {
37+
node.parentNode.removeChild(node)
38+
} catch {}
39+
}
40+
// Show the new ad
3341
this.$nextTick(() => {
3442
requestAnimationFrame(() => {
3543
this.mounted = true

0 commit comments

Comments
 (0)
0