G
G
genesis11112019-05-08 18:54:03
JavaScript
genesis1111, 2019-05-08 18:54:03

How can I check if a website doesn't exist with a chrome extension?

Hello!
I have an array of sites, there are inactive sites in it: not delegated, expired domains, etc. For example: sdfhbsdjnfjnn323.ru
The extension opens each site in turn and listens to the response (onMessage)
If the site is not working, then content_scripts is not loaded, and accordingly the background page does not receive any response.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander +, 2019-07-28
@genezis1111

The site "starts" only when it is successfully downloaded from the web server, which means you don't need such crutches with an extension in principle. Send a HEAD request to the domain, if the code is not 200 then the site is defective, you can also connect 301-302 codes if suddenly the redirect is worth it.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question