RobloxDev to Roblox Wiki API Reference

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

Du musst eine Erweiterung wie Tampermonkey, Greasemonkey oder Violentmonkey installieren, um dieses Skript zu installieren.

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.

Sie müssten eine Skript Manager Erweiterung installieren damit sie dieses Skript installieren können

(Ich habe schon ein Skript Manager, Lass mich es installieren!)

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.

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

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

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

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

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

// ==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);
}());