Media Manager (since 3.5): How to show an empty Media Library when creating a media frame?

It’s not a pretty solution but I used the post__in attribute for this once in a custom plugin. Basically you usually define an array of attachment id’s to show in the media library.

library: {
        type: 'image', post__in:[23,25,26]  // or a javascript variable that contained the array of id's
    }

My code was originally built for that at that time. This was great for posts where the attachments were already attached to the post. But then I needed to show nothing for new posts. And what happened was that if the javascript variable containing the id’s was empty it would show the entire contents of the media library instead.

I figured I could try using a hardcoded id which certainly had no attachment associated with it. So I did this:

library: {
            type: 'image', post__in:[0]  // zero just to be sure
        }

And by God, it worked. I hope it does for you aswell.