Skip to content

Instantly share code, notes, and snippets.

@erhaem
Last active August 16, 2023 13:02
Show Gist options
  • Select an option

  • Save erhaem/ec079a3f695e98790a4c1107f2bdd6ad to your computer and use it in GitHub Desktop.

Select an option

Save erhaem/ec079a3f695e98790a4c1107f2bdd6ad to your computer and use it in GitHub Desktop.
Facebook Tool: View Full Size Image. Copy the bookmarklet version, paste it on the bookmark bar; then click it.
javascript:(function(a){var b=new URL(a.location);0>b.hostname.indexOf("facebook.com")?alert("Only works on Facebook's domains"):"/photo.php"!==b.pathname?alert("Only works at *.facebook.com/photo.php"):(b=b.searchParams.get("fbid"))?a.location.replace("https://m.facebook.com/photo/view_full_size/?fbid="+b):alert("`fbid` not found")})(window)
/**
* Facebook Tool: View Full Size Image
* @author Rifqi Haidar
*/
(function(e) {
const currentUrl = new URL(e.location);
if (currentUrl.hostname.indexOf("facebook.com") < 0) {
alert("Only works on Facebook's domains");
return
}
if (currentUrl.pathname !== "/photo.php") {
alert("Only works at *.facebook.com/photo.php");
return
}
const fbid = currentUrl.searchParams.get("fbid");
if (!fbid) {
alert("`fbid` not found");
return
}
// console.log("Redirecting to full size image URL..");
e.location.replace(`https://m.facebook.com/photo/view_full_size/?fbid=${fbid}`)
})(window)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment