Skip to content

Instantly share code, notes, and snippets.

@CynicalApe
Last active February 1, 2018 20:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save CynicalApe/37bc6f2fedca07713a4ccce84ce98fa7 to your computer and use it in GitHub Desktop.
Save CynicalApe/37bc6f2fedca07713a4ccce84ce98fa7 to your computer and use it in GitHub Desktop.
directs wikipedia results on Google to 0.wikipedia
// ==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