'How to get network response code (javascript)

I recently added a linkedin tag to my website for data tracking very similar to google tag or fb pixels.

For me to know the tag is installed correctly, I would need to inspect the network response and ensure the request code for the fired tag is getting a ‘302 response’.

Is there a hardcoded way of validating the network response without manually using the inspect tool?

I would like to create a chrome extension script that would perform this validation using javascript.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source