Let’s say that this is the comment link:
I want to do this thing:
Check if current page URL requesting a comment or not (have #comment-x or not).
If current page URL is requesting a comment get the comment id from the URL.
Read more here:: How can get comment id from comment link?