fix: Elementor e-youtube-base widget erkennen (v1.4.2)

Das YouTube-video auf der startseite ist kein .elementor-widget-video, sondern
Elementors neueres element <div class="e-youtube-base" data-e-type="e-youtube"
data-settings='{"source":"https://www.youtube.com/watch?v=..."}'>. Daher griff
weder server-autodetect (kein iframe) noch mein client-handler -> leere box.

- selektor erweitert um .e-youtube-base/.e-vimeo-base und
  [data-e-type^="e-youtube"|"e-vimeo"].
- URL-extraktion liest jetzt auch den key "source" (und "url").
An der echten data-settings der live-seite verifiziert.

+ version 1.4.2 (assets cache-busting).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
s4luorth
2026-06-08 13:15:53 +02:00
parent 1ce9f8121b
commit 176ded0228
2 changed files with 5 additions and 4 deletions

View File

@@ -288,7 +288,7 @@
try { try {
const s = JSON.parse( ds || '{}' ); const s = JSON.parse( ds || '{}' );
const u = s.youtube_url || s.vimeo_url || s.video_url || s.external_url const u = s.youtube_url || s.vimeo_url || s.video_url || s.external_url
|| s.hosted_url || ( s.link && s.link.url ) || ''; || s.hosted_url || s.source || s.url || ( s.link && s.link.url ) || '';
if ( u ) return u; if ( u ) return u;
} catch ( e ) { /* not JSON / no keys */ } } catch ( e ) { /* not JSON / no keys */ }
@@ -316,7 +316,8 @@
* consent placeholder before that happens. */ * consent placeholder before that happens. */
function handleElementorVideos() { function handleElementorVideos() {
const widgets = document.querySelectorAll( const widgets = document.querySelectorAll(
'.elementor-widget-video, .elementor-widget[data-widget_type^="video"]' '.elementor-widget-video, .elementor-widget[data-widget_type^="video"], '
+ '.e-youtube-base, .e-vimeo-base, [data-e-type^="e-youtube"], [data-e-type^="e-vimeo"]'
); );
widgets.forEach( function ( widget ) { widgets.forEach( function ( widget ) {
const container = widget.querySelector( '.elementor-widget-container' ) || widget; const container = widget.querySelector( '.elementor-widget-container' ) || widget;

View File

@@ -3,7 +3,7 @@
* Plugin Name: GDPR Content Blocker * Plugin Name: GDPR Content Blocker
* Plugin URI: https://lucas-orth.de * Plugin URI: https://lucas-orth.de
* Description: DSGVO-konformer Consent-Blocker für externe iframes. Lädt Drittinhalte erst nach aktiver Einwilligung. * Description: DSGVO-konformer Consent-Blocker für externe iframes. Lädt Drittinhalte erst nach aktiver Einwilligung.
* Version: 1.4.1 * Version: 1.4.2
* Author: Lucas Orth * Author: Lucas Orth
* Author URI: https://lucas-orth.de * Author URI: https://lucas-orth.de
* Text Domain: gdpr-content-blocker * Text Domain: gdpr-content-blocker
@@ -15,7 +15,7 @@
defined( 'ABSPATH' ) || exit; defined( 'ABSPATH' ) || exit;
define( 'CB_VERSION', '1.4.1' ); define( 'CB_VERSION', '1.4.2' );
define( 'CB_FILE', __FILE__ ); define( 'CB_FILE', __FILE__ );
define( 'CB_DIR', plugin_dir_path( __FILE__ ) ); define( 'CB_DIR', plugin_dir_path( __FILE__ ) );
define( 'CB_URL', plugin_dir_url( __FILE__ ) ); define( 'CB_URL', plugin_dir_url( __FILE__ ) );