User:K599/Embed-iframe.js

//Author: K599 / Kelvs599

//Code based on https://dev.fandom.com/wiki/MediaWiki:YoutubePlayer/code.js

//Loading this JavaScript allows s to be embedded by inserting the following code: // //Explanations for each parameter can be found on https://developer.mozilla.org/en-US/docs/Web/HTML/Element/iframe //Note that the will only load if it follows Miraheze's Content Security Policy, which can be found on https://github.com/miraheze/puppet/blob/master/modules/varnish/data/csp_whitelist.yaml

mw.hook('wikipage.content').add(function($content) {   $content.find('.embed-iframe:not(.loaded)').each(function { var $this = $(this), data = $this.data;

$this.html(           $(' ', { width: String(data.width || '').trim, height: String(data.height || '').trim, src: String(data.src || '').trim, style: 'border: none;', allow: String(data.allow || '').trim })       ).addClass('loaded'); }); });