Last active
February 1, 2018 20:24
-
-
Save CynicalApe/37bc6f2fedca07713a4ccce84ce98fa7 to your computer and use it in GitHub Desktop.
directs wikipedia results on Google to 0.wikipedia
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Wikifix | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description try to take over the world! | |
// @author You | |
// @match https://www.google.com.tr/* | |
// @grant none | |
// ==/UserScript== | |
(function() { | |
'use strict'; | |
document.querySelectorAll("a").forEach(element => { | |
element.href = element.href.replace("https://en.wikipedia.org/", | |
"https://en.0wikipedia.org/"); | |
}); | |
var x = document.title; | |
if (x == "Redirect Notice") { | |
var link = document.querySelector("a"); | |
var linkstring = link + ""; | |
if (linkstring.includes("https://en.0wikipedia.org/")) | |
document.querySelector("a").click(); | |
} | |
// Your code here... | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment