'how to retrieve the status code of a web request while building a chrome browser extension
This is my first time building a chrome web browser extension and i am trying to figure out how to get the status code of a form after the user has submitted the request. (After clicking the button: "Create")
Let's assume the form below:
<Form onSubmit={handleSubmit}>
...
<div className="some-class-Name">
<Button id="create-user-button" variant="primary" type="submit">Create</Button>
</div>
</Form>
I am trying to access the status code of this payload from the chrome web browser extension codes. (maybe targeting the id of the button?)
I know that browser.webRequest.onCompleted... (https://developer.chrome.com/docs/extensions/reference/webRequest/#event-onCompleted) is what need to be used based on the documentation but im not sure to understand the syntax correctly or what i am missing exactly in the codes below.
browser.webRequest.onCompleted.addListener(
function(details) {
console.log("Get status Code: " + details.statusCode);
});
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
