I'm working on a react application. In my application I have feature by which user can enter URL to refer something and save them for later use.
Some sample target url eg: Slack channel link for contact, SSO authenticated git hub repo link, google drive document link, box document link etc.
Now the scenario is that sometimes User entered URLs fail to load target url content, when I try to open the saved URLs later. Some possible cases:
So, I want to implement Target URL checker functionality in my react web application something like chrome bookmark checker extension (https://chrome.google.com/webstore/detail/bookmarks-checker/eeckiajfclogcacnhgigljkcgabfcmco?hl=en) functionality, by which I can ensure that the Targeting URL is loadable in browser with 200 status or not and content availability in the document.
I tried to hit the target url by axios and checked the response status received in it but that approach was not working for Some cases like:
Please do suggest some approach. Thanks!
With a frontend-only solution such as you are building at the moment, I don't think you can solve the problem very well. You will stumble upon a number of challenges that might make the endeavour impossible, for example:
I would propose that you move the URL checks to a backend system that can freely open HTTP(s) connections without the restrictions of a browser.