How to understand that there is a photo in the buffer JavaScript

I want to determine that when I click on the Print Screen button on keyboard, is it written to the console whether it’s a image or not? Needs use buffer like

const checkHaveImageInClipboar = async () => {
        try {
            const clipboardItems = await window.navigator.clipboard.read();
            return clipboardItems[0].types.some(type => /image/.test(type));
        } catch (err) {
            return false;
        }
    };

It is on the button on the keyboard, and not on the button in the DOM . Because there may be a situation where you clicked on the screenshot on the keyboard, but the screen didn’t work, and I just want to check
if there is a photo in the buffer, then output ‘photo’, otherwise output ‘not photo’ . Please help me