Safaridriver: handle OS alert

Hi,
I am trying to accept a Safari browser alert. This is the situation:
1- I click on a “Download pdf” button on the website.
2- Safari pops up an alert saying: Do you want to download “file.pdf”?, with buttons “View” and “Download”.
As far as I know, Selenium can’t handle this kind of OS alert. How could I handle them? In this case, I would like to click on the “Download” button.

So far I have tried to disable these alerts by using the following commands in Java before the alert is shown:

((JavascriptExecutor)browser).executeScript("confirm = function(message){return true;};");

((JavascriptExecutor)browser).executeScript("alert = function(message){return true;};");

((JavascriptExecutor)browser).executeScript("prompt = function(message){return true;}");

I got these commands from: https://github.com/seleniumhq/selenium-google-code-issue-archive/issues/3862

How could I handle this alert?