YouTube redirect to mobile

Redirect YouTube desktop site to mobile site

Installer ce script?
Script suggéré par l'auteur

Vous pourriez également aimer youtube profile picture hd.

Installer ce script
// ==UserScript==
// @name        YouTube redirect to mobile
// @namespace   YouTube redirect to mobile
// @match       https://www.youtube.com/*
// @run-at      document-start
// @grant       none
// @version     1.2
// @description Redirect YouTube desktop site to mobile site
// ==/UserScript==

(function() {
    'use strict';
    
    // Check if the current URL is the desktop version of YouTube
    if (window.location.hostname === 'www.youtube.com') {
        // Redirect to the mobile version
        window.location.href = 'https://m.youtube.com' + window.location.pathname + window.location.search;
    }
})();