Dotabuff Match Link

Match ID on match pages will launch Dota2 to watch that match.

スクリプトをインストールするには、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          Dotabuff Match Link
// @namespace     http://greasyfork.org/users/2240-doodles
// @author        Doodles
// @version       2
// @description   Match ID on match pages will launch Dota2 to watch that match.
// @include       *://*dotabuff.com/matches/*
// @include       *://*dotabuff.com/players/*
// @grant         none
// @updateVersion 2
// ==/UserScript==
if (document.URL.split('/matches/').length == 2) {
	var titleElement = document.getElementsByClassName('header-content-title')[0].getElementsByTagName('h1')[0];
	var matchID = document.URL.split('/matches/')[1].split('/')[0].split('?')[0];
	titleElement.innerHTML = 'Match <a title="Watch Match in Dota 2 Client" style="color:#92bb35;text-shadow: 1px 1px 1px #000000;" href="dota2://matchid=' + matchID + '">' + matchID + '</a><small>Overview</small>';
} else if (document.URL.split('/players/').length == 2) {
	var titleElement = document.getElementsByClassName('header-content-title')[0].getElementsByTagName('h1')[0];
	var playerId = document.URL.split('/players/')[1].split('/')[0].split('?')[0];
	playerId = '7656119' + (parseInt(playerId) +  7960265728).toString();
	var titleText = titleElement.innerHTML.split('<small>')[0];
	titleElement.innerHTML = '<a title="Steam Profile" style="color:#92bb35;text-shadow: 1px 1px 1px #000000;" href="http://steamcommunity.com/profiles/' + playerId + '">' + titleText + '</a><small>Overview</small>';
}