How to check if upload window came from the featured image link?

There is a filter for the html of the ‘postimagediv’ called ‘admin_post_thumbnail_html’.

There may be more elegant ways, but this works:

add_filter('admin_post_thumbnail_html', 'wpse61502_change_thumbnail_link');

function wpse61502_change_thumbnail_link($content)
{
    return str_replace('media-upload.php?', 'media-upload.php?is_thumbnail=true&', $content);
}

In your plugin / script check the querystring:

if ( isset($_GET['is_thumbnail']) )
{
    // do stuff, actions, enqueue, ...
}

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)