0

I want to get metadata (title, description etc) of a website to show link preview in my chat application.

My plan is to get the webpage of the website using link (by XHR request from my app) and parse it to get metadata. (I want to do everything in browser without needing to contact server for the purposes of link preview)

But in most of the case I get CORS.

My question is:

How do I get around CORS to get a website's main page? If its not possible, how do other chat application implement link preview? Do they all require a server for that?

asdasd
  • 6,050
  • 3
  • 14
  • 32
  • "How do I get around CORS to get a website's main page?" — See the duplicate. – Quentin Jan 24 '19 at 19:43
  • "Do they all require a server for that?" — Using a server *is* getting around the lack of CORS. – Quentin Jan 24 '19 at 19:44
  • @Quentin I know you use server to get around cors. But this question is about link preview. Maybe I am not thinking in right direction? Just need some guidance how other people implement link preview. Thanks. – asdasd Jan 24 '19 at 19:48
  • "But this question is about link preview" — And you want to do that by reading data from the website, which you don't have permission to do from the browser, so you need to do it on the server. – Quentin Jan 24 '19 at 19:50
  • ok. Thanks you. – asdasd Jan 24 '19 at 19:52

0 Answers0