I am trying to make a very simple Manifest v3 chrome extension that blocks an "automatic redirect" on a website.
I like to use an overseas online merchant ("foo.com") but when you click into a product's details, it sends me to sso.foo.com
to login w/ a free account. I can tap the browser stop button when the product page shows up, but before the "redirect" executes (i think its more like a JS triggered window.location) - and i can work around it that way; but i'd rather just make a chrome extension for myself that blocks this.
I tried creating a declarative_new_request that blocks requests to sso.foo.com
[{
"id" : 1,
"priority": 1,
"action" : { "type" : "block" },
"condition" : {
"urlFilter" : "sso.foo.com",
"domains" : ["foo.com"],
"resourceTypes" : ["script", "main_frame", "sub_frame"]
}
}]
...And this almost works, however the browser blocks the "end" of the request to https://sso.foo.com
- so instead of "stopping" on the Product page, i see a chrome page saying "sso.foo.com" was blocked by an extension. What i want, is to block the navigation to https://soo.foo.com/*
but leave me on the current page ... is this possible? Thoughts on how i can do this?