Last active
February 27, 2021 20:28
-
-
Save trey/ff975086c55aec0fe1a04e30b456813d to your computer and use it in GitHub Desktop.
Remove Tumblr URL cruft.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.tmblr-iframe—app-cta-button { | |
display: none !important; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(document).ready(function() { | |
// Remove Tumblr redirects (inspired by magnusthemes@tumblr) | |
$('a[href*="href.li"]').each(function() { | |
let originalURL = $(this).attr('href'); | |
let replaceURL = originalURL.replace('https://href.li/?', '').replace(/\?b\=.+$/, ''); | |
$(this).attr('href', replaceURL); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Inspired by:
MagnusThemes | Remove Tumblr’s redirects