您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Adds a link to a user's Marketplace profile on their main page
当前为
// ==UserScript== // @name Facebook Profile Marketplace Link // @description Adds a link to a user's Marketplace profile on their main page // @match https://www.facebook.com/* // @version 0.2 // @author mica // @namespace greasyfork.org/users/12559 // @license MIT // @grant GM_xmlhttpRequest // ==/UserScript== function makeLink(id) { var link = 'https://www.facebook.com/marketplace/profile/' + id; var e = document.querySelectorAll('span'); for (var i = 0; i < e.length; i++) { if (e[i].innerText == 'More') { loc = e[i].closest('div[aria-haspopup]').parentNode; break; } } loc.insertAdjacentHTML('afterend',` <a style=" position: relative; top: 29px; color: rgb(101, 103, 107); font-size: 15px; font-weight: 600; " id="mpLink" href="${link}">Marketplace</a> `); } function getId() { if (new URLSearchParams(location.search).get('id')) { makeLink(new URLSearchParams(location.search).get('id')); } else { GM_xmlhttpRequest({ method: "GET", url: location.origin + location.pathname, onload: (response) => { makeLink(response.responseText.match(/(?<=userID":")\d*/g)[0]); } }); } } function checkProfile() { if (!location.pathname.match(/^\/$|\/friends*|\/groups*|\/messages*|\/marketplace*|\/watch*|\/reel*|\/events*|\/gaming*|\/memories*|\/saved*|\/fundraisers*|\/pages*|\/settings*|\/help*|\/ads*/g)) { setTimeout(() => { if (!document.getElementById('mpLink')) { var e = document.querySelectorAll('circle'); for (var i = 0; i < e.length; i++) { if (e[i].getAttribute('cx') == 84) { getId(); break; } } } }, 600); } } var url; setInterval(() => { if (url != location.href) { url = location.href; checkProfile(); } }, 200);