Greasy Fork

Greasy Fork is available in English.

Facebook Profile ID Extractor (OSINT)

Extracts Facebook profile ID

当前为 2025-02-18 提交的版本,查看 最新版本

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name         Facebook Profile ID Extractor (OSINT)
// @version      1.0
// @description  Extracts Facebook profile ID
// @author       SH3LL
// @match        https://www.facebook.com/*
// @namespace http://greasyfork.icu/users/762057
// ==/UserScript==

(function() {
    'use strict';

    let popup = null; // Store the popup element
    let labelAdded = false;

    function createPopup() {
        popup = document.createElement('div');
        popup.style.cssText = `
            position: fixed;
            top: 65px;
            right: 43%;
            background-color: black;
            border: 1px solid #ccc;
            padding: 10px;
            border-radius: 5px;
            z-index: 9999; /* Ensure it's on top */
            font-weight: bold;
        `;
        document.body.appendChild(popup);
    }

    function extractInfo() {
        if (labelAdded) return;

        try {
            const userIdRegex = /"userID":"(\d+)"/;
            const userIdMatch = document.documentElement.outerHTML.match(userIdRegex);

            if (userIdMatch && userIdMatch[1]) {
                const userId = userIdMatch[1];
                const link = document.createElement('a'); // Create a link element
                link.href = "https://www.facebook.com/profile.php?id=" + userId; // Set the URL
                link.target = "_blank"; // Open in a new tab (optional)
                link.style.color = 'red';
                link.innerText = "User ID: " + userId;


                if (!popup) {
                    createPopup(); // Create popup if it doesn't exist
                }
                popup.appendChild(link); // Add the link to the popup
                labelAdded = true;
            } else {
                console.error("Facebook ID not found.");
                return;
            }
        } catch (e) {
            console.error("Error processing request: " + e.message);
            if (!popup) {
                createPopup();
            }
            return;
        }
    }

    const checkInterval = setInterval(() => {
        if (document.readyState === 'complete') { // Check if the page is fully loaded
            clearInterval(checkInterval);
            extractInfo();
        }
    }, 500);

})();