replace_directly_link

11/19/2021, 9:05:58 AM

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

ستحتاج إلى تثبيت إضافة مثل Stylus لتثبيت هذا النمط.

ستحتاج إلى تثبيت إضافة لإدارة أنماط المستخدم لتتمكن من تثبيت هذا النمط.

ستحتاج إلى تثبيت إضافة لإدارة أنماط المستخدم لتثبيت هذا النمط.

ستحتاج إلى تثبيت إضافة لإدارة أنماط المستخدم لتثبيت هذا النمط.

(لدي بالفعل مثبت أنماط للمستخدم، دعني أقم بتثبيته!)

// ==UserScript==
// @name        replace_directly_link
// @namespace   Violentmonkey Scripts
// @match       *://*oschina*/*
// @grant       none
// @version     1.0
// @author      -
// @description 11/19/2021, 9:05:58 AM
// @license MIT
// ==/UserScript==

(async () => {
  console.info(`oschina_replace_directly_link`);
  let count = 0;
  for(const link of document.querySelectorAll('a')) {
    if(link.href.startsWith('https://www.oschina.net/action/GoToLink?url=')) {
      count ++;
      link.href=new URL(link).searchParams.get('url') 
    } 
  }
  console.info(`oschina_replace_directly_link processed ${count} links`);
})()