Reddit & YouTube URL download page

Работает со ссылками на посты с видео Reddit, а также с видео-ссылками YouTube.

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name        Reddit & YouTube URL download page
// @version        0.0.2
// @author         donotblink
// @description    Работает со ссылками на посты с видео Reddit, а также с видео-ссылками YouTube.
// @match        *://*.reddit.com/*
// @match        *://*.youtube.com/*
// @match        *://*.google.com/*
// @match        *://*.google.ru/*
// @namespace https://greasyfork.org/users/675552
// ==/UserScript==

document.addEventListener('mousedown', e => {
  if (event.button === 2 && e.ctrlKey) {
    const a = document.querySelector('a:hover');
    if (a) {
        var myStr = a.href;
        var newStr = myStr.replace(/reddit.com/g, "ssreddit.com");
        var newStr2 = newStr.replace(/www.youtube.com/g, "www.youtube-y2mate.com");
        window.open(newStr2, '_blank').focus();
      e.preventDefault();
    }
  }
})