Skip to content

Instantly share code, notes, and snippets.

@codexss
Forked from asportnoy/open-youtube-app.user.js
Last active September 30, 2024 04:04
Show Gist options
  • Save codexss/eb5ae8fa5ff85112e091d6f4e0f48f3f to your computer and use it in GitHub Desktop.
Save codexss/eb5ae8fa5ff85112e091d6f4e0f48f3f to your computer and use it in GitHub Desktop.
// ==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