Download Facebook Photos

Here is a quick script that lets you download Facebook Messenger photos if you are on a desktop browser.

You might want to change the value of maxIterations depending on the number of photos you need to download. Or just leave it at 100100 and then delete the photos you don’t want.

Special thanks to ChatGPT for making my two-line code become a function to help me skip all the boring stuff!


  1. Click the first photo you want to download. The script will download that photo, click next and then download the next, and so on. Until it has done it maxIterations times.
  2. Open the Developer Tools by pressing F12 on the keyboard and go to the Console tab if you’re not there yet.
  3. Copy and paste the following code:
var iteration = 0;
var maxIterations = 100;

function performIteration() {
  // Click on "Next photo"
  document.querySelector('div[aria-label="Next photo"]').click();

  // Click on "Download"

  // Increment the iteration counter

  // Check if we've reached the maximum iterations
  if (iteration < maxIterations) {
    // Set a timeout for the next iteration after 400ms
    setTimeout(performIteration, 400);

// Start the loop
Back to Top | Blog RSS Feed