how can i check in javascript if user has granted my site the publish stream permission
?
Looks like is not supported. At least is not documented.
You may read from javascript once the permission is granted though.