Xhamster - No related Video links (Remove their "#mlrelated" part in address bar) v.0.36

Remove "#mlrelated" part in address bar (when you open a related video from the Video page)

您需要先安装一个扩展,例如 篡改猴Greasemonkey暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴Userscripts ,之后才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。

您需要先安装用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name            Xhamster - No related Video links (Remove their "#mlrelated" part in address bar) v.0.36
// @version 0.36
// @description	    Remove "#mlrelated" part in address bar (when you open a related video from the Video page)
//
// @namespace https://greasyfork.org/users/7434
// @author janvier57

// @include https://*xhamster.com/movies/*
// @include https://xhamster.com/videos/*

// @include      https://*.xhamster.com/movies/*
// @include      https://*.xhamster.com/videos/*

// @require http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js
// @autor Phlegomatic  / janvier56
// FROM:  https://greasyfork.org/forum/discussion/comment/54300/#Comment_54300
// @grant none
// @run-at document-start

// ==/UserScript==

var Check = "#mlrelated"; // what you removed
var currentLocation = window.location.href; // get current URL

if(currentLocation.includes(Check)){ // check if contains
var URL = currentLocation.replace(Check, ""); // replace
window.location = URL; // goto adjusted URL
}