Skip to content

Instantly share code, notes, and snippets.

@UCyborg
Last active December 15, 2021 20:25
Show Gist options
  • Save UCyborg/100935b7572423a56e28fb0e60596c92 to your computer and use it in GitHub Desktop.
Save UCyborg/100935b7572423a56e28fb0e60596c92 to your computer and use it in GitHub Desktop.
// ==UserScript==
// @name YouTube always-mobile
// @namespace https://github.com/UCyborg
// @description Always redirects desktop YouTube to mobile version
// @version 1.0.1
// @author UCyborg
// @downloadURL https://gist.github.com/UCyborg/100935b7572423a56e28fb0e60596c92/raw/YouTube_always-mobile.user.js
// @include /https:\/\/www\.youtube\.com\/(?!embed\/.*$)/
// @run-at document-start
// @grant none
// ==/UserScript==
'use strict';
(function() {
let url = new URL(window.location);
url.host = 'm.youtube.com';
url.searchParams.set('app', 'm');
url.searchParams.set('persist_app', '1');
window.location.replace(url);
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment