Bug 1671147 Comment 4 Edit History

Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.

Thanks starting on this Mattias!

> I implemented the initial functionality of adding a message in the headers panel that the request was blocked. Right now it will add the message from BLOCKED_REASON_MESSAGES in devtools/client/netmonitor/src/constants.js for all blocked requests but I'm not sure if it's better to limit the scope right now to just requests blocked by CORS.

We only the need the message for requests blocked by CORS, so lets limit it to that for now. I'm not sure if we want it for all types of CORS errors but we can look at that later.

> I was also wondering if there is a premade component or similar for rendering the warning box or if I should write my own.

You can use this NotificationBox https://searchfox.org/mozilla-central/search?q=NotificationBox&redirect=false

Feel free to open an in-progress patch.
Thanks starting on this Mattias!

> I implemented the initial functionality of adding a message in the headers panel that the request was blocked. Right now it will add the message from BLOCKED_REASON_MESSAGES in devtools/client/netmonitor/src/constants.js for all blocked requests but I'm not sure if it's better to limit the scope right now to just requests blocked by CORS.

We only the need the notification for requests blocked by CORS, so lets limit it to that for now. I'm not sure if we want it for all types of CORS errors but we can look at that later.

> I was also wondering if there is a premade component or similar for rendering the warning box or if I should write my own.

You can use this NotificationBox https://searchfox.org/mozilla-central/search?q=NotificationBox&redirect=false

Feel free to open an in-progress patch.
Thanks starting on this Mattias!

> I implemented the initial functionality of adding a message in the headers panel that the request was blocked. Right now it will add the message from BLOCKED_REASON_MESSAGES in devtools/client/netmonitor/src/constants.js for all blocked requests but I'm not sure if it's better to limit the scope right now to just requests blocked by CORS.

We only the need the notification for requests blocked by CORS, so lets limit it to that. I'm not sure if we want it for all types of CORS errors but we can look at that later.

> I was also wondering if there is a premade component or similar for rendering the warning box or if I should write my own.

You can use this NotificationBox https://searchfox.org/mozilla-central/search?q=NotificationBox&redirect=false

Feel free to open an in-progress patch.

Back to Bug 1671147 Comment 4