vincent.valat / Papernest redirect

// ==UserScript==
// @name                Papernest redirect
// @licence             MIT
// @namespace	        http://www.papernest.com
// @description	        allows redirection by changing souscritoo to papernest in case of 404
// @include		        https://bitbucket.org*
// ==/UserScript==

if (document.title.startsWith('404')) {
    var url = window.location.href;
    if (window.location.href.includes('souscritoo')) {
        url = url.replace('souscritoo', 'papernest');
        window.open(url, '_self')
    }
}