Skip to content

Instantly share code, notes, and snippets.

//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);