跳转成人GreasyFork按钮

浏览greasefork或sleazyfork或tampermonkey时,在页面增加一个进入greasefork或者sleazyfork的按钮

// ==UserScript==
// @name         跳转成人GreasyFork按钮
// @namespace    http://tampermonkey.net/
// @version      1.1
// @description  浏览greasefork或sleazyfork或tampermonkey时,在页面增加一个进入greasefork或者sleazyfork的按钮
// @author       xiyue_m
// @license      MIT
// @grant        none
// @match        https://greasyfork.org/*
// @match        https://sleazyfork.org/*
// @match        https://www.tampermonkey.net/*
// @icon         data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAADICAYAAACtWK6eAAAAAXNSR0IArs4c6QAAGZNJREFUeF7tnQuUHGWVx/+3epLp6gTywAVdcQ+CCKIoEGCRhzBmunq6ekJ4SA4CIrogPhKeogi6oLCyKooQQUERRdBlzsor09WvhEEElACbgASJRpY9rOiqeQiZrp7MdN09NQkYYpL+qrqqq7r71jk5OTl97/3u/d36p15ffUWQTQgIgR0SIGEjBITAjgmIQGTvEAI7ISACkd1DCIhAZB8QAv4IyBHEHzfx6hICIpAuabSU6Y+ACMQfN/HqEgIikC5ptJTpj4AIxB838eoSAiKQLmm0lOmPgAjEHzfx6hICIpAuabSU6Y+ACMQfN/HqEgIikC5ptJTpj4AIxB838eoSAiKQLmm0lOmPgAjEHzfx6hICIpAuabSU6Y9AaALRC6VT4eAYgN4IohFynF9UBzNP+kuzvb1mDA/PGkNylob6LKcnMYvYmUXgWcw0C8AsBk3+m5hngchhoAZGjQi2Q6gRowagxsw10mhVnbVVm8z+Z9ubSntkH4pAdKs8BOCUv0dAl9hm+tr2QOMvy6mWdYBGicMIdBgYhwM4zF+kxl5MWEWMZ5loFYGfdWjKirGBvjWNPcVClUDgAtEL5SfAmLOjBJjomFo2/bBqgnG2S95f+SeawnOIeY4DOoQwWffuEee8joHHwLycNHrK4Ymnx0zzdxHn1LbDByoQPV88GaT9505pED1sZ9PHtCuxXqtsaIwcE/oIOLA96qDfEfAIO7jPfuKRe3HllU575B19lgELpPwVED6zc4H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I7qvDT0zVeOXLAwPrwhks+qipYiXnMH+FGO/cTjb326YR1LT918KLQFrQd/djpejB3hrX9wbTnkyUBLPOhCQx64CWZLBOm5/ujxJoPYPXM/MG0hLrmJz1Gmnrue6sr0Nb36NNXV/tra9HX1+tBenHawjL2jXJiYuIaD8GZhDjedZ4RS2buTWMREUgYVCVmB1DQATSMa2UQsIgIAIJg6rE7BgCIpCOaaUUEgYBEUgYVCVmxxAQgXRMK6WQMAiIQMKgKjE7hoAIpGNaKYWEQUAEEgZVidkxBEQgHdNKKSQMAiKQMKhKzI4hIALpmFZKIWEQEIGEQVVidgwBEUjHtFIKCYOACCQMqhKzYwiIQDqmlVJIGAREIGFQlZgdQ0AE0jGtlELCICACCYOqxOwYAv8PY1VVX2E9OFwAAAAASUVORK5CYII=
// ==/UserScript==
 
(function() {
    'use strict';
    //说一下代码
    //代码基本来源于百度AI编写,然后根据个人的想法加之修改,兼容性不详,需自行测试。
	//这一行是创建网页跳转按钮 该功能的代码是借鉴的,跳转按钮的位置、大小、颜色等参数设置在此行代码中
    $("body").append(" <div id='tiaozhuan'; style='right: 3px;width: 45px;height: 45px;font-size: 16px;border-radius:50%; bottom: 100px;background: #FF0000;color:#ffffff;overflow: hidden;z-index: 9999;position: fixed;padding:5px;text-align:center;'>跳转网址</div>");
	var tiaozhuan = document.getElementById("tiaozhuan"); 
    tiaozhuan.addEventListener('click', function (e) {
		var currentUrl = window.location.origin; 
		var searchText1 = "sleazyfork";
		var index1 = currentUrl.indexOf(searchText1); 
		var searchText2 = "tampermonkey";
		var index2 = currentUrl.indexOf(searchText2); 
		if (index1 !== -1) {			
			currentUrl = currentUrl.replace("sleazyfork", "greasyfork") + "/zh-CN/scripts"; 
			//window.open(currentUrl); //新建窗口跳转(如果选择这种方式,把此行代码前的“//”删除,在下一行代码前添加“//”)
			window.location.assign(currentUrl);	//当前窗口跳转(如果选择前一种方式,在此行代码前添加“//”,将上一行代码前的“//”删除)
			//提供了两种跳转方式,可根据个人爱好自行更改,目前使用的是在当前窗口页面跳转,如更改跳转方式,建议同步更改所有的跳转方式
        } else if (index2 !== -1) {
			currentUrl = window.location.origin; 
			currentUrl = currentUrl.replace("www", "sleazyfork"); 
			currentUrl = currentUrl.replace("tampermonkey.net", "org/zh-CN/scripts"); 
   			//window.open(currentUrl); 
			window.location.assign(currentUrl);	
        } else {
			currentUrl = currentUrl.replace("greasyfork", "sleazyfork") + "/zh-CN/scripts"; 
			//window.open(currentUrl); 
			window.location.assign(currentUrl);	
        };		
    });	
})();