Block network redirects

Recently, there was a question on Stack Overflow related to being able to inspect the local storage of a redirecting page.

So I was wondering whether such use cases would be handled best by adding an option to prevent all redirects a page triggers, be it via JavaScript, HTML <meta> element, or HTTP header.

I imagine a toggle option within the Network Monitor and a global hint that this option is enabled so that developers don’t forget that this option is set and/or one when redirection got blocked.

Does that sound reasonable and feasible?

Sebastian

Hi Sebastian, I suppose this would be relevant to sites that send a 200 response and include either a meta tag or script in the page to accomplish the redirect. Sites that send a 301 or 302 redirect probably cannot set or read any local storage. Perhaps an add-on script blocker plus something to get rid of any meta refresh tags would do the job for now?

It would be simpler to have a detailed Storage Inspector panel for URLs other than the currently displayed page, but I don’t know whether that is something that might happen.

@jscher2000 Basically, whenever there could be something worth inspecting besides the network request, but I guess you’re right that for immediate redirects where the request body is not evaluated, there’s no need to block the redirect.

I’m not sure whether it’d be good to let the Storage Inspector display contents of other URLs. It might be more confusing than helping to show there contents of other page contexts, but that depends on a proper UI.
Anyway, the idea of blocking the redirects allows more than just inspecting the data shown in the Storage Inspector.

This functionality could also be put into an add-on, though I assume it’d need an additional Web Extension API to manipulate the request body before it’s parsed because removing <meta> elements via JavaScript still causes the redirect to be executed.

Sebastian