Skip to content

Instantly share code, notes, and snippets.

@Dark000Soldier
Last active December 4, 2022 18:23
Show Gist options
  • Select an option

  • Save Dark000Soldier/68828a7438d6af562da0cb7a5d6b21d2 to your computer and use it in GitHub Desktop.

Select an option

Save Dark000Soldier/68828a7438d6af562da0cb7a5d6b21d2 to your computer and use it in GitHub Desktop.
fork form : asportnoy/open-youtube-app.user.js
// ==UserScript==
// @name Open Facebook App
// @version 1.0.7
// @author Lentin
// @match https://facebook.com/*
// @match https://mobile.facebook.com/*
// @downloadURL https://gist.github.com/codexss/eb5ae8fa5ff85112e091d6f4e0f48f3f/raw/open-facebook-app.user.js
// @updateURL https://gist.github.com/codexss/eb5ae8fa5ff85112e091d6f4e0f48f3f/raw/open-facebook-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 = `facebook://timeline`
} else {
window.location.href = `facebook://user?screen_name=${locationArr[0]}`
}
} else if (locationArr[0] && locationArr[1] === "status") {
window.location.href = `facebook://status?id=${locationArr[0]}`
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment