Detect Safari desktop browser and include the detection in a shortcode

You can use WordPress global variable $is_safari like following to detect whether the browser is safari browser.

global $is_safari;

if ( $is_safari ) {
    // This is safari browser
}

To detect whether the browser is safari desktop browser, you can use condition like following.

global $is_safari;

if ( ! wp_is_mobile() && $is_safari ) {
    // This is desktop safari browser
}