NOTICE: By continued use of this site you understand and agree to the binding Terms of Service and Privacy Policy.
// ==UserScript==
// @name Redirect to english cppreference
// @version 1.1
// @description Redirects cppreference translations to the english original
// @match http://*.cppreference.com/*
// @match https://*.cppreference.com/*
// @copyright 2018, Max Sistemich
// @license MIT
// ==/UserScript==
var old_href = document.location.href;
if (!old_href.startsWith("http://en.cppreference.com") && !old_href.startsWith("https://en.cppreference.com")) {
var new_href = old_href.replace(/^(http|https):\/\/[^\/]+\//, function(_, protocol) {
return protocol + '://en.cppreference.com/'
});
document.location.href = new_href;
}