Created
November 28, 2022 12:22
-
-
Save t-wy/66faed8679d127793891ecb775efdaa9 to your computer and use it in GitHub Desktop.
Get Facebook canonical Post ID (share URL) without pfbid parameter
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
| javascript: fbid = /share_fbid":"(\d+)"/g.exec([...document.getElementsByTagName("script")].filter(x => x.innerHTML.includes("share_fbid"))[0].innerHTML)[1]; alert(location.href.split("/").slice(0, -1).join("/") + "/" + fbid); | |
| // can be used in console / bookmark / address bar (remember to add back javascript if the browser strips it automatically) |
due to some Facebook updates, this only works if you're not logged in, otherwise it still works but returns some wrong information related too the profileAnchor selecting the wrong profile, and displaying the wrong name. But it still returns the correct post id, and works fine if you're not logged in.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thx God @JZersche !!!