Script Oficial by Hausky Tutoriales 2019
Script Oficial by Hausky Tutoriales 2019
(function () {
var getDesignCookie = function (cookie) {
//Find existing preferences
var prefs = cookie.split("; ").filter(function (v) {
return v.indexOf("PREF=") === 0;
})[0];
//No preferences, return new ones with design setting
if (!prefs) {
console.log("prefs not set in cookie");
return "PREF=f6=8";
}
//Process all settings
var entries = prefs.substr(5).split('&');
var set = false;
for (var i = 0; i < entries.length; i++) {
if (entries[i].indexOf("f6=") === 0) {
set = true;
//Set the old design flag
var value = +entries[i].substr(3);
if ((value & 8) === 0) {
console.log("Activating old design and reloading...");
entries[i] = "f6=" + (value | 8);
window.setTimeout(location.reload.bind(location,true),100);
}
else{
console.log("Old design already active. Doing nothing");
}
}
}
//Design flag setting doesn't exists. Adding it instead
if (!set) {
console.log("Activating old design and reloading...");
entries.push("f6=8");
window.setTimeout(location.reload.bind(location,true),100);
}
//Build cookie
return "PREF=" + entries.join('&');
};
//Update cookie
document.cookie = getDesignCookie(document.cookie) +
";domain=.youtube.com;path=/";
})();
/*
LICENSE:
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike
4.0 International License.
The full license text can be found here: http://creativecommons.org/licenses/by-nc-
sa/4.0/
The link has an easy to understand version of the license and the full license
text.
DISCLAIMER:
THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED WARRANTIES,
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS
BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS
OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
THE POSSIBILITY OF SUCH DAMAGE.
*/