Fix Firefox Android cookie dialog back gestures
This commit is contained in:
@@ -59,6 +59,25 @@ function c1024_2026_disable_w3tc_javascript_lazyload( $can_process ) {
|
||||
}
|
||||
add_filter( 'w3tc_lazyload_can_process', 'c1024_2026_disable_w3tc_javascript_lazyload' );
|
||||
|
||||
/**
|
||||
* Avoid a Firefox Android close watcher for the cookie plugin's CSS-hidden dialog.
|
||||
*
|
||||
* GDPR Cookie Compliance 5.2.2 keeps its native dialog permanently open and manages
|
||||
* visibility/focus itself. Use ARIA semantics without the native close watcher
|
||||
* that consumes Android back gestures (Mozilla bug 2078216).
|
||||
*/
|
||||
function c1024_2026_gdpr_modal_dialog( $html ) {
|
||||
$modal = preg_replace(
|
||||
'/<dialog id="moove_gdpr_cookie_modal" class="gdpr_lightbox-hide" open\b([^>]*)>(.*)<\/dialog>/s',
|
||||
'<div id="moove_gdpr_cookie_modal" class="gdpr_lightbox-hide" role="dialog"$1>$2</div>',
|
||||
$html,
|
||||
1
|
||||
);
|
||||
|
||||
return null !== $modal ? $modal : $html;
|
||||
}
|
||||
add_filter( 'gdpr_modal_base_module', 'c1024_2026_gdpr_modal_dialog' );
|
||||
|
||||
function c1024_2026_block_editor_assets() {
|
||||
// Load the complete canvas stylesheet inside Gutenberg's editor iframe.
|
||||
wp_enqueue_style( 'c1024-2026-editor-style', get_theme_file_uri( '/editor-style.css' ), array(), '1.0.0' );
|
||||
|
||||
Reference in New Issue
Block a user