How to add URL-Parameter for Javascript Widgets?

I think you just need to add it to the query vars

add_filter( 'query_vars', 'my_query_vars' ); 
function my_query_vars( $query_vars ) {     
    $query_vars[] = 'foo';
    return $query_vars;
}