Skip to content

Commit

Permalink
fix: use innerHTML to set script contents
Browse files Browse the repository at this point in the history
  • Loading branch information
danielroe committed Dec 4, 2023
1 parent e4dfe44 commit 3e04bf4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ export default defineNuxtConfig({
head: {
script: [
// Insert your CRISP Script here e.g.:
{ children: 'window.$crisp = []; window.CRISP_WEBSITE_ID = "0000"' },
{ innerHTML: 'window.$crisp = []; window.CRISP_WEBSITE_ID = "0000"' },
{ src: 'https://client.crisp.chat/l.js', async: true, type: 'text/partytown' },
],
},
Expand Down Expand Up @@ -119,7 +119,7 @@ export default defineNuxtConfig({
app: {
head: {
script: [
{ children: 'window.$plausible = [];' },
{ innerHTML: 'window.$plausible = [];' },
// Update this
{
src: 'https://plausible.io/js/script.js',
Expand Down
4 changes: 2 additions & 2 deletions src/module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@ export default defineNuxtModule<ModuleOptions>({
// Use @vueuse/head syntax to inject scripts
nuxt.options.app.head.script = nuxt.options.app.head.script || []
nuxt.options.app.head.script.unshift(
{ children: `partytown = ${renderedConfig}` },
{ children: partytownSnippet }
{ innerHTML: `partytown = ${renderedConfig}` },
{ innerHTML: partytownSnippet }
)
}

Expand Down

0 comments on commit 3e04bf4

Please sign in to comment.