Drupal is a registered trademark of Dries Buytaert
cms 2.1.2 Update released for Drupal core (2.1.2)! drupal 11.1.10 Update released for Drupal core (11.1.10)! drupal 10.5.10 Update released for Drupal core (10.5.10)! drupal 10.4.10 Update released for Drupal core (10.4.10)! drupal 11.2.12 Update released for Drupal core (11.2.12)! drupal 11.3.10 Update released for Drupal core (11.3.10)! drupal 10.6.9 Update released for Drupal core (10.6.9)! drupal 10.6.8 Update released for Drupal core (10.6.8)! drupal 11.3.9 Update released for Drupal core (11.3.9)! drupal 11.3.8 Update released for Drupal core (11.3.8)! drupal 11.3.7 Update released for Drupal core (11.3.7)! drupal 11.2.11 Update released for Drupal core (11.2.11)! drupal 10.6.7 Update released for Drupal core (10.6.7)! drupal 10.5.9 Update released for Drupal core (10.5.9)! cms 2.1.1 Update released for Drupal core (2.1.1)! drupal 11.3.6 Update released for Drupal core (11.3.6)! drupal 10.6.6 Update released for Drupal core (10.6.6)! cms 2.1.0 Update released for Drupal core (2.1.0)! linkit 7.0.15 Minor update available for module linkit (7.0.15). views_data_export 8.x-1.10 Minor update available for module views_data_export (8.x-1.10).

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

Total releases
1
First release
Apr 2026
Latest release
1 month ago
Release cadence
Stability
0% stable

Releases

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