Last active
September 11, 2022 20:05
-
-
Save Denubis/36dbe49961e458bc008fe3ea1fbfe29f to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| javascript: (() => { | |
| /*Apache2 License, Brian Ballsun-Stanton*/ | |
| const hostName = window.location.hostname; | |
| const currentDomain = hostName.substring(hostName.lastIndexOf(".", hostName.lastIndexOf(".") - 1) + 1); | |
| /*https://stackoverflow.com/a/19937750*/ | |
| if (currentDomain != "newsblur.com"){ | |
| const newTarget ="https://12ft.io/"+window.location.href; | |
| window.location.href=newTarget; | |
| } else { | |
| Element.prototype.appendAfter = function(element) { | |
| element.parentNode.insertBefore(this, element.nextSibling); | |
| }, false; | |
| /* https://stackoverflow.com/a/32135318*/ | |
| var storyTitles = document.querySelectorAll(".NB-feed-story-title"); | |
| storyTitles.forEach(story => { | |
| const storyHref = "https://12ft.io/"+story.getAttribute('href'); | |
| console.log(storyHref); | |
| const story12ftElement = document.createElement('span'); | |
| story12ftElement.innerHTML = '<a target="_blank" role="button" href="'+storyHref+'">[12ft Ladder]</a>'; | |
| story12ftElement.appendAfter(story) | |
| }); | |
| } | |
| })(); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment