Embeddit

By chocolateboy Last update Jul 5, 2009 — Installed 137 times. Daily Installs: 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0

There are 4 previous versions of this script.

// ==UserScript==
// @name        Embeddit
// @namespace   http://www.chocolatey.com/code/js
// @description Adds a full screen button to embedded YouTube videos on reddit
// @version     0.04
// @author      chocolateboy
// @license     GPL: http://www.gnu.org/copyleft/gpl.html
// @include     http://reddit.com/*
// @include     http://*.reddit.com/*
// ==/UserScript==

var $old_unsafe = unsafeWindow.$.unsafe;

unsafeWindow.$.unsafe = function($html) {
    $html = $old_unsafe($html);
    $html = $html.replace(/<param /, '<param name="allowFullScreen" value="true"></param><param ');
    $html = $html.replace(/("http:\/\/www\.youtube(-nocookie)?\.com\/v\/[^"]+)"/g, '$1&fs=1"');
    $html = $html.replace(/<embed /, '<embed allowfullscreen="true" ');
    return $html;
}