Gitlab open with Rider

12/30/2025, 2:03:43 PM

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name        Gitlab open with Rider
// @namespace   Violentmonkey Scripts
// @match       https://gitlab.com/tikaiz/dotnet-demo/-/tree/master*
// @grant       none
// @version     1.0
// @author      Tikaiz
// @description 12/30/2025, 2:03:43 PM
// @license MIT
// ==/UserScript==

const Text = 'Jetbrains Rider';

// Not sure if this is the best way of navigating to the correct DOM Location, but it works
var openWithList = document.getElementById('gl-disclosure-dropdown-group-62').nextSibling.nextSibling;

var openWithRiderList = openWithList.lastChild.cloneNode(true);
var openWithRiderText = openWithRiderList.firstChild;
openWithRiderText.innerText = Text;

var RiderBtnGroup = openWithRiderList.lastChild;
var SshBtn = RiderBtnGroup.firstChild;
var HttpsBtn = RiderBtnGroup.lastChild;

SshBtn.href = SshBtn.href.replace('idea','rider');
HttpsBtn.href = HttpsBtn.href.replace('idea','rider');

openWithList.appendChild(openWithRiderList);