RobloxDev to Roblox Wiki API Reference

Adds a button to view the API reference on the Roblox Wiki instead of RobloxDev

이 스크립트를 설치하려면 Tampermonkey, Greasemonkey 또는 Violentmonkey와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 Tampermonkey와 같은 확장 프로그램을 설치해야 합니다.

이 스크립트를 설치하려면 Tampermonkey 또는 Violentmonkey와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 Tampermonkey 또는 Userscripts와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 Tampermonkey와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 유저 스크립트 관리자 확장 프로그램이 필요합니다.

(이미 유저 스크립트 관리자가 설치되어 있습니다. 설치를 진행합니다!)

이 스타일을 설치하려면 Stylus와 같은 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 Stylus와 같은 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 Stylus와 같은 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 유저 스타일 관리자 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 유저 스타일 관리자 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 유저 스타일 관리자 확장 프로그램이 필요합니다.

(이미 유저 스타일 관리자가 설치되어 있습니다. 설치를 진행합니다!)

// ==UserScript==
// @name     RobloxDev to Roblox Wiki API Reference
// @description Adds a button to view the API reference on the Roblox Wiki instead of RobloxDev
// @version  1.3
// @grant    none
// @match  *://www.robloxdev.com/api-reference/*
// @namespace Blupo
// ==/UserScript==

(function () {
	"use strict";
	
	var buttonAlreadyExists = document.getElementById("robloxwiki-btn");
	if (buttonAlreadyExists) { return true };
	
	var text = "View on the Roblox Wiki";
	
	var button = document.createElement("a");
	button.setAttribute("class", "btn secondary-btn");
	button.setAttribute("id", "robloxwiki-btn");
	button.setAttribute("style", "border-radius: 2px; color: #00a2ff;");
	button.setAttribute("href", "https://wiki.roblox.com/index.php?title=API:Class/" + window.location.href.match('api\-reference\/(property|class|event|function|callback)\/(.+)')[2] + "&studiomode=true");
	
	var buttonText = document.createTextNode(text);
	button.appendChild(buttonText);
	
	var apiContent = document.getElementsByClassName("api-content")[0];
	if (!apiContent) { return true };
	
	apiContent.insertAdjacentElement("beforebegin", button);
}());