replace_directly_link

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

スクリプトをインストールするには、Tampermonkey, GreasemonkeyViolentmonkey のような拡張機能のインストールが必要です。

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

スクリプトをインストールするには、TampermonkeyViolentmonkey のような拡張機能のインストールが必要です。

スクリプトをインストールするには、TampermonkeyUserscripts のような拡張機能のインストールが必要です。

このスクリプトをインストールするには、Tampermonkeyなどの拡張機能をインストールする必要があります。

このスクリプトをインストールするには、ユーザースクリプト管理ツールの拡張機能をインストールする必要があります。

(ユーザースクリプト管理ツールは設定済みなのでインストール!)

このスタイルをインストールするには、Stylusなどの拡張機能をインストールする必要があります。

このスタイルをインストールするには、Stylus などの拡張機能をインストールする必要があります。

このスタイルをインストールするには、Stylus tなどの拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

(ユーザースタイル管理ツールは設定済みなのでインストール!)

このスクリプトの質問や評価の投稿はこちら通報はこちらへお寄せください
// ==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`);
})()