Last active
January 29, 2026 00:29
-
-
Save mica/5c9427fab98da699f1fe70fd2730212e to your computer and use it in GitHub Desktop.
Bookmarklet that opens a Facebook user's Markeplace profile. Get it here: https://bookmarkl.ink/mica/5c9427fab98da699f1fe70fd2730212e
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
| //bookmarklet_title: FB Marketplace Profile | |
| //bookmarklet_about: From a user's main FB page, click this bookmarklet for their Marketplace profile | |
| if (location.host == 'www.facebook.com') { | |
| if (location.pathname == '/profile.php') { | |
| location.href = 'https://www.facebook.com/marketplace/profile/' + new URLSearchParams(location.search).get('id'); | |
| } else if (location.pathname == '/friends/suggestions/') { | |
| location.href = 'https://www.facebook.com/marketplace/profile/' + new URLSearchParams(location.search).get('profile_id'); | |
| } else { | |
| let xhr = new XMLHttpRequest(); | |
| xhr.open("GET", location.origin + location.pathname); | |
| xhr.send(); | |
| xhr.onload = () => { | |
| if (xhr.response.includes('userID":"')) { | |
| location.href = 'https://www.facebook.com/marketplace/profile/' + xhr.response.match(/(?<=userID":")\d*/g)[0]; | |
| } | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment