MyTube is a content filter that protects visitors' privacy by replacing iframes with local image tags that lazily load the iframe when clicked. In addition, various <iframe> attributes can be automatically set to maximize user privacy when the iframe loads.

MyTube prevents remote-site requests, cookies and similar invasions of privacy from automatically plaguing visitors when they access your page because, until the user clicks play, no remote request is made to the third-party website. See here for an example.

Unlike other filters for embed code, MyTube does not generate any embed code. Instead, it processes existing iframes, modifies them according to the administrator's settings, and converts them into clickable thumbnails. The thumbnails, when activated, will then swap themselves out for the original embed code. To ensure that the user is making an educated choice about whether or not to load the embed (and to show that the administrator cares about their privacy), a disclaimer text is also placed below the thumbnail, with a best-effort attempt to figure out the source, alerting users to the privacy concerns associated with loading an external iframe.

For some video services, MyTube will automatically download thumbnails to serve as a preview of the video content, which will automatically play the first time they're clicked on. For unrecognized embed codes, MyTube will swap it out for a generic thumbnail.

By not automatically loading embedded content, your pages will load faster for end users, making it more accessible to users with old computers or slow internet connections. MyTube also improves compliance with GDPR, CCPA/CPRA and other privacy regulations by allowing users to indicate consent to load a third-party service.

Instructions:

After installing the module, administrators should enable "MyTube Filtering" for any input formats that will allow embeds. It is strongly recommended that administrators then enable the HTML Filter and arrange it before MyTube; failure to do so means it may be possible for users to inject arbitrary scripts into your website using embeds. MyTube will not conflict with the HTML Filter; if you trust your users, you should whitelist each individual tag you wish to allow (MyTube will currently process <embed>, <iframe> and <object>). If you do not trust them (e.g. relatively anonymous users), then you should use a different filter that generates embed code (such as Video Filter) instead of allowing them to submit such dangerous code. Any tags or attributes the administrator wishes to restrict can be restricted without breaking MyTube's ability to filter other authorized (or in the case of video filter, generated) tags. MyTube will make a best-effort attempt to replace all kinds of embed code listed here, and for stability reasons, MyTube will automatically implement the HTML Corrector filter, whether that filter is enabled or not. If enabled, it should be noted that the HTML Corrector will be run twice, but the performance toll is negligible.

Beyond this initial setup, MyTube should require little if any configuration, but offers several customizable options (requires "administer mytube" permissions) for appearance on its settings page. All <embed>, <iframe>, and <object> tags passed through the filter will be replaced with MyTube thumbnails, whether the source is recognized or not. Unrecognized sources will default to an included default.gif thumbnail. For these individual videos, a custom thumbnail can be added by adding thumb="$relative_directory" to the first affected tag. MyTube will also make a best-effort attempt to recognize the video source and display it in the privacy info text. Default thumbnails for YouTube™ and Vimeo™ videos are downloaded to public://mytube automatically and cannot be overridden.

Integrations:

On Drupal 7, the "Apply the MyTube filter to Video Embed Field embed code" setting enables the MyTube filter to be applied to embed code generated by Video Embed Field module. In Video Embed Field version 8.x-2.x, the "lazy load" field formatter enables functionality similar to MyTube, i.e. no integration should be necessary.

Credits:

MyTube was originally developed by the Electronic Frontier Foundation. It was later upgraded by Brian Swaney in collaboration with Tim Jones, the original author. It is currently maintained by Squiggy Rubio and mfb.

Supporting organizations: 

Project information

Releases