Confirmation popup before delete file/image I'm working on a D8 project and in many cases I use file and image upload fields. 

The files and the images are visible above the field and the user can delete them by using the default 'Remove' button. 

What I want to do, is to add a confirmation popup asking if they really want to delete that files/images.

Is there any hook that I could use to make that check? 
If I use javascript, how can I say to drupal that now can proceed to deletion?

Thank you in advance.

EDIT:

I tried to do what @Ivan suggested but I can't make it work.
My form has submit and ajax callback. Should I alter both?

Is there any working example? I am so desperate!!
After long time I managed to find the solution. I didn't manage to make it work server side with modals so I managed to solve it using jQuery.

So I created a javascript file:

    Drupal.behaviors.confirm = {
        attach: function(context, settings) {

            $.each($('.form-submit'), function(){
                var str = $(this).attr('id');
                //find the id for each button
                var remove_btn_id = '#' + $(this).attr('id');

                //apply only to remove buttons and only to those that the functionality is not applied yet. 
                if (str.indexOf("-remove-button") &gt;= 0 &amp;&amp; !$(remove_btn_id).hasClass('custom-handler')){

                    //Drupal.behaviours are triggered every time my ajax was submitted and I ended up with multiple events to each button. 
                    //In order to avoid it, add a class to check if the button already has that functionality. 
                    $(remove_btn_id).addClass('custom-handler');
                    $(remove_btn_id).bindFirst('mousedown', function(e, next) {

                       //Display popup and get user's decision.
                        var choice = confirm('Are you sure you want to delete that?');
                        if(!choice){
                            //if user clicks cancel then do nothing
                            e.stopImmediatePropagation();
                        }
                    });
                }
            });
        }
    }


I'm not sure if this the right way to implement that functionality (I guess is not the Drupal way) but at leat it works!