Widget:Restore CookieWarning
From Notaclue Wiki
Widget to add a button that resets the CookieWarning banner state and reloads the page. Restore CookieWarning banner <script> const addClickHandler = () => {
mw.loader.load( 'mediawiki.api' );
const restoreBtn = document.getElementById( 'widget-restore-CookieWarning-btn' );
restoreBtn.addEventListener(
'click',
() => {
mw.loader.using(
'mediawiki.api',
() => new mw.Api().saveOption( 'cookiewarning_dismissed', '0' ).then( location.reload.bind( location ) )
);
}
);
}; document.addEventListener( 'DOMContentLoaded', addClickHandler );
</script>