-
-
Save Dark000Soldier/488df9dc856a0ae77c0b92676e95546e to your computer and use it in GitHub Desktop.
Open Twitter App Userscript | See https://github.com/BandarHL/OpenTwitterSafariExtension
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
| // ==UserScript== | |
| // @name Open Twitter App | |
| // @version 1.0.7 | |
| // @author Lentin | |
| // @match https://twitter.com/* | |
| // @match https://mobile.twitter.com/* | |
| // @downloadURL https://gist.github.com/codexss/eb5ae8fa5ff85112e091d6f4e0f48f3f/raw/open-twitter-app.user.js | |
| // @updateURL https://gist.github.com/codexss/eb5ae8fa5ff85112e091d6f4e0f48f3f/raw/open-twitter-app.user.js | |
| // @homepage https://gist.github.com/codexss/eb5ae8fa5ff85112e091d6f4e0f48f3f/ | |
| // ==/UserScript== | |
| var locationArr = window.location.pathname.split("/").reverse() | |
| if (locationArr[0] && !locationArr[1]) { | |
| if (locationArr[0] === "home") { | |
| window.location.href = `twitter://timeline` | |
| } else { | |
| window.location.href = `twitter://user?screen_name=${locationArr[0]}` | |
| } | |
| } else if (locationArr[0] && locationArr[1] === "status") { | |
| window.location.href = `twitter://status?id=${locationArr[0]}` | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment