F365 Temporary Refresh Fix

Append random variable to links

  1. // ==UserScript==
  2. // @name F365 Temporary Refresh Fix
  3. // @description Append random variable to links
  4. // @grant none
  5. // @match http://forum.football365.com/*
  6. // @version 0.0.1.20150908100349
  7. // @namespace https://greasyfork.org/users/14019
  8. // ==/UserScript==
  9.  
  10. $('a').each(function(){
  11. if (this.href.indexOf("?") > -1) {
  12. var randomString = '&'+Math.random().toString(36).replace(/[^a-z]+/g, '').substr(0, 5);
  13. if (this.href.indexOf("#") > -1) {
  14. this.href = this.href.slice(0, this.href.indexOf("#")) + randomString + this.href.slice(this.href.indexOf("#"));
  15. } else {
  16. this.href += randomString
  17. }
  18. }
  19. })