Skip to content

Instantly share code, notes, and snippets.

@ozh
Last active March 30, 2024 15:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ozh/435edf5a91567ad2d100b3362793a68b to your computer and use it in GitHub Desktop.
Save ozh/435edf5a91567ad2d100b3362793a68b to your computer and use it in GitHub Desktop.
Fix t911 links
  $('body').find('a').each(function() {
    var href=$(this).attr('onclick');
    if(href) {
      href=href.replace("location.href='", '').replace(/'$/g, '');
      $(this).attr('href',href);
    }

Bookmarklet with https://mrcoles.com/bookmarklet/ : (include jQuery)

javascript:(function()%7Bfunction%20callback()%7B(function(%24)%7Bvar%20jQuery%3D%24%3B%24('body').find('a').each(function()%20%7Bvar%20href%3D%24(this).attr('onclick')%3Bif(href)%20%7Bhref%3Dhref.replace(%22location.href%3D'%22%2C%20'').replace(%2F'%24%2Fg%2C%20'')%3B%24(this).attr('href'%2Chref)%3B%7D%7D)%7D)(jQuery.noConflict(true))%7Dvar%20s%3Ddocument.createElement(%22script%22)%3Bs.src%3D%22https%3A%2F%2Fajax.googleapis.com%2Fajax%2Flibs%2Fjquery%2F1.11.1%2Fjquery.min.js%22%3Bif(s.addEventListener)%7Bs.addEventListener(%22load%22%2Ccallback%2Cfalse)%7Delse%20if(s.readyState)%7Bs.onreadystatechange%3Dcallback%7Ddocument.body.appendChild(s)%3B%7D)()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment