Last active
August 15, 2023 15:01
-
-
Save TheAndrey/2b4ad36b2728d02c59a0843df39aa4ec to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==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