Optimizes the guest browsing experience on Facebook desktop by removing login barriers and enhancing feed navigation, content expansion, and post data export tools.
A guest browsing optimization userscript for Facebook Desktop site.
Automatically removes login barriers, enables page search, provides content extraction tools, and improves browsing stability for logged-out guest users.
This userscript is designed to optimize the guest browsing experience on Facebook Desktop. It hides login prompts and overlays, and resolves specific limitations on guest access (such as search functionality and scroll locking) to provide a stable reading environment.
🚨 Group Page (/groups/) Restrictions:
Many Facebook Group pages enforce logins to view content. This is a server-side permission limit that cannot be bypassed by scripts.🚨 VPN / Cloudflare WARP Compatibility:
Using Cloudflare WARP or specific VPN IPs may trigger guest access denials from Facebook, resulting in blank feeds. Disabling the proxy or changing the IP address is recommended.Server-Side Rate Limiting:
Infinite scrolling depends on server-side session responses. Extended browsing sessions may trigger rate limiting where API calls stop returning new posts. Opening a new Incognito window resets the session.💡 Recommended in "Incognito Window":
In standard browsing mode, Facebook may not serve full DOM elements or expose complete ID metrics, causing URL parsing failures. Running in an Incognito window ensures optimal DOM layouts and higher extraction success rates.💡 Self-Hosting Alternatives:
For self-hosting environments, using Phice via Docker is recommended. Inspired by Nitter and Invidious, Phice is a lightweight, privacy-oriented Facebook alternative front-end that does not require an account or trackers to view public feeds.
This script declares several GM (Greasemonkey) API permissions to deliver a complete feature experience. All operations are run locally, and no user data is collected or uploaded. Below is the purpose of each declared permission:
| API Permission (@grant) | Specific Purpose |
|---|---|
| GM_getValue, GM_setValue | Saves and loads user configurations, video volume settings, and offline bookmark database locally. |
| GM_deleteValue, GM_listValues | Manages cache, resets configurations, and clears bookmark storage space. |
| GM_setClipboard | Copies post content (formatted), canonical URLs, and revealed IDs directly to the system clipboard. |
| GM_addValueChangeListener, GM_removeValueChangeListener |
Enables inter-tab communication (IPC) between the main tab and background Workers (e.g., syncing URL resolution status). |
| GM_openInTab | Opens post URLs in background tabs silently (Worker mode) to asynchronously resolve clean canonical URLs. |
| GM_registerMenuCommand, GM_unregisterMenuCommand |
Registers entries in the script manager extension menu (e.g., opening the settings panel). |
| GM_xmlhttpRequest | Used for post screenshots. Facebook avatars and media are stored on CDNs; this API downloads them asynchronously (bypassing CORS) to convert them into local Base64 Data URLs for canvas rendering. |
| window.close | Closes the background worker tab automatically after resolving URL metrics to save resources. |
While this script operates independently, combining it with uBlock Origin (uBO) filters is recommended to hide login prompts before script execution:
Add the following filters to the "My filters" tab in your uBO dashboard:
facebook.com##+js(trusted-click-element, body > div[id^="mount"] #scrollview ~ div div[role="button"]:has(> div[data-visualcompletion="ignore"]) ) facebook.com##div[id^="mount"] div:not([id]):not([class]):not([style]) > div[data-nosnippet] facebook.com##+js(aeld, scroll) facebook.com##body > div[class*="__fb-light-mode"] ! click cookies facebook.com##+js(trusted-click-element, [role="dialog"]:has([href="https://www.facebook.com/policies/cookies/"]) [aria-hidden="true"] + [aria-label][tabindex="0"], , 1000) ! hide the fixed top-banner "send a message" facebook.com##.rq0escxv.du4w35lb.rek2kq2y.lpgh02oy[style*="top: 56px;"] ! un-fix the login banner (will scroll) facebook.com##div[role="banner"] > *, div[role="banner"] > div:not(:first-child) > div > div:has([aria-label="Facebook"]):style( position: absolute !important; ) facebook.com##div[role="banner"] + div div[style="top: 56px; z-index: 1;"]:style( position: static !important; )
⚠️ Requirement: You must ensure that "Allow custom filters requiring trust" is checked under the "My filters" tab for trusted-click-element rules to function.
This project references and integrates logic from the following community resources:
This project uses a modern web development toolchain for modular refactoring and building: