RS: Wikia to Wiki

Redirects from RS Fandom to RS Wiki

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         RS: Wikia to Wiki
// @version      1.0.0
// @description  Redirects from RS Fandom to RS Wiki
// @author       nysos3
// @match        *://runescape.fandom.com/wiki/*
// @match        *://www.google.com/search*
// @namespace https://greasyfork.org/users/316895
// ==/UserScript==
var url = window.location.href;
if (url.indexOf('://runescape.fandom.com/wiki/') > 0) {
    var article = url.substr(url.indexOf('/wiki/') + 6);
    window.location.href = 'https://runescape.wiki/w/' + article;
} else if (url.indexOf('://www.google.com/search') > 0) {
    var anhorTags = document.getElementsByTagName('a');
    Array.prototype.forEach.call(anhorTags, function (el) {
        var href = el.href;
        if (href.indexOf('://runescape.fandom.com/wiki') < 0) {
            return
        }
        if (href.indexOf('webcache.google') >= 0) {
            return
        }
        var article = href.substr(href.indexOf('/wiki/') + 6);
        el.href = 'https://runescape.wiki/w/' + article;
    });
}