Skip to content

Commit

Permalink
mod_cookie_consent: Make the selector for the cookie-consented slight…
Browse files Browse the repository at this point in the history
…ly more general (#3308)

This allows strict frontend frameworks like Elm to replace the `<script>` with some other element and still have it work.
Ideally, we would use a `<template>` instead of a `<script>`, but that also causes problems in Elm at the moment: elm/virtual-dom#185

Co-authored-by: Colin de Roos <colin@driebit.nl>
  • Loading branch information
cdfa and Colin de Roos committed Feb 28, 2023
1 parent 66bc219 commit 569bd81
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion modules/mod_cookie_consent/lib/js/z.cookie_consent.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
break;
default:
// Replace with stored content
const $consented = $elt.find('script[type="text/x-cookie-consented"]');
const $consented = $elt.find('[type="text/x-cookie-consented"]');
if ($consented.length > 0) {
let $replace = $(html_unescape($consented.text()));
$elt.replaceWith($replace);
Expand Down

0 comments on commit 569bd81

Please sign in to comment.