Sleazy Fork is available in English.

xHamster auto-english

Change xHamster default language to english

  1. /*jshint esversion: 6 */
  2. // ==UserScript==
  3. // @name xHamster auto-english
  4. // @namespace http://tampermonkey.net/
  5. // @version 0.1
  6. // @description Change xHamster default language to english
  7. // @author Guillegt
  8. // @match https://*.xhamster.com/*
  9. // @grant none
  10. // @require https://code.jquery.com/jquery-3.3.1.min.js
  11. // @require https://cdn.jsdelivr.net/npm/js-cookie@2/src/js.cookie.min.js
  12. // ==/UserScript==
  13.  
  14. (function() {
  15. 'use strict';
  16. const regex = /(https:\/\/)(.*\.)(xhamster.com.*)/;
  17. if(Cookies.get('lang') !== "en"){
  18. //document.cookie.lang = "en";
  19. Cookies.set('lang', 'en',{domain: '.xhamster.com'});
  20. let url = window.location.href;
  21. let rx = regex.exec(url);
  22. console.log(rx);
  23. if(rx !== null){
  24. window.location.href = rx[1]+rx[3];
  25. }else{
  26. location.reload();
  27. }
  28. }
  29. })();