From 8bac03f11389e6104ae659032d272f74a4038e9e Mon Sep 17 00:00:00 2001 From: Michael Kaply Date: Wed, 11 Mar 2015 08:14:08 -0500 Subject: [PATCH] Force youtube to be html5 --- modules/webconvergerModule.jsm | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/modules/webconvergerModule.jsm b/modules/webconvergerModule.jsm index 161fe20..487b270 100644 --- a/modules/webconvergerModule.jsm +++ b/modules/webconvergerModule.jsm @@ -36,6 +36,14 @@ var HTTPObserver = { if (gProxyUsername && gProxyPassword) { httpChannel.setRequestHeader("Proxy-Authorization", "Basic "+ btoa(gProxyUsername + ":" + gProxyPassword), false); } + if (/.*\.youtube\.com/.test(httpChannel.URI.host)) { + if (/^(\/watch|\/embed)/.test(httpChannel.URI.path)) { + if (httpChannel.URI.spec.indexOf("html5=true") == -1) { + httpChannel.redirectTo(Services.io.newURI(httpChannel.URI.spec + "&html5=true", null, null)); + } + } + return; + } if (!gForceSafeSearch) { return; }