Forked from asportnoy/open-youtube-app.user.js
Last active
September 30, 2024 04:04
-
-
Save codexss/eb5ae8fa5ff85112e091d6f4e0f48f3f to your computer and use it in GitHub Desktop.
Open Twitter App Userscript | See https://github.com/BandarHL/OpenTwitterSafariExtension
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
// ==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