Last active
June 26, 2024 19:34
-
-
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