Drupal is a registered trademark of Dries Buytaert
Release: Leaflet 10.4.11 Minor update available for module leaflet (10.4.11). Release: Admin Audit Trail 1.0.11 Minor update available for module admin_audit_trail (1.0.11). Release: Session Inspector 1.0.8 Minor update available for module session_inspector (1.0.8). Release: Migrate QA 2.0.4 Minor update available for module migrate_qa (2.0.4). Release: CKEditor Description List 3.0.0 Major update available for module ckeditor_descriptionlist (3.0.0). Release: FlowDrop 2.4.0 Minor update available for module flowdrop (2.4.0). Release: Changelogify 1.3.0 Minor update available for module changelogify (1.3.0). Release: Page Swap 1.0.3 Minor update available for module page_swap (1.0.3). Usage Milestone: Role Theme Switcher Module role_theme_switcher crossed 1,000 active installs. Module Revived: Decoupled Router 2.0.7 Module decoupled_router updated after 11 months of inactivity (2.0.7).

This module allows you to embed self-contained websites or applications directly into Drupal using iframes. It offers features like URL validation, automatic thumbnail generation from screenshots, and integration with Content Security Policy to ensure secure embedding.

The Media Snippet module provides a Drupal Media source for embedding self-contained websites or applications using iframes. It is designed to work with the iframe module and includes features like URL validation, thumbnail generation using a screenshot of the URL, and Content Security Policy (CSP) integration.

Features

  • Media Source Plugin: Adds a "Snippet" media source that uses an iframe field.
  • URL Validation: Validates source URLs against a configurable list of allowed patterns (with wildcard support) and checks for `X-Frame-Options` headers to ensure the content can be actually be embedded.
  • Automated Thumbnails: Can automatically fetch and store screenshots of the target URL using the thum.io service.
  • CSP Integration: Automatically updates Content Security Policy `frame-src` directives when the `csp` module is enabled, based on the allowed URLs configured for the media source.
  • Media Library Support: Includes a custom add form for the Media Library to streamline the creation of snippet media items.
  • Metadata Mapping: Supports mapping metadata like page title and HTML content from the source URL.

This media type can also be used to support any kind of iframe embeds such as the following providers, without needing additional modules:

  • ArcGIS
  • Google Calendar
  • Google Forms
  • Google Maps
  • Microsoft Power BI

Post-Installation

  1. Go to Structure > Media types and add or edit a media type.
  2. Select Snippet as the Media source.
  3. In the source configuration, you can:
    • Define a list of Allowed URLs (one per line, wildcards allowed)
    • Enable Screenshot thumbnails via thum.io and specify the storage directory.
    • Save the media type.

Additional Requirements

Similar projects

Activity

Tracked releases
1
Tracked since
Apr 2026
Latest release
4 months ago
Releases (12 mo)
1 ▲ from 0
Maintenance
Active

Releases

Version Type Release date
1.0.x-dev Dev Apr 10, 2026