Skip to content

Instantly share code, notes, and snippets.

@TheAndrey
Last active August 15, 2023 15:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save TheAndrey/2b4ad36b2728d02c59a0843df39aa4ec to your computer and use it in GitHub Desktop.
Save TheAndrey/2b4ad36b2728d02c59a0843df39aa4ec to your computer and use it in GitHub Desktop.
// ==UserScript==
// @name Yandex UnTurbo
// @namespace https://theandrey.name/
// @version 1.0
// @description Automatic redirection from turbo pages
// @author TheAndrey
// @match https://yandex.ru/turbo/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=yandex.ru
// @updateURL https://gist.github.com/TheAndrey/2b4ad36b2728d02c59a0843df39aa4ec/raw/yandex-unturbo.user.js
// @grant none
// ==/UserScript==
(function(window) {
'use strict';
const url = new URL(window.location.href);
const redirectTo = url.pathname.replace(/^\/turbo\/s\//, 'https://').replace(/^\/turbo\//, 'https://').replace(/\/s\//, '\/');
window.location.href = redirectTo;
})(window);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment