Open evandroamparo opened 2 years ago
@callumlocke can you please confirm that this extension does not work for blob URLs ?
It's been a long time. I don't work on that application anymore but I can try to reproduce the issue when I have some time.
I'm pretty sure this isn't possible, sorry.
But I'm curious, can you give me more of an example of how you might expect this to work? Is there a way that you can currently display a blob URL containing JSON in a browser tab, unformatted? I might be misunderstanding something.
But I'm curious, can you give me more of an example of how you might expect this to work? Is there a way that you can currently display a blob URL containing JSON in a browser tab, unformatted? I might be misunderstanding something.
Hi @callumlocke. You can create a json blob like this:
const obj = { hello: "world" };
const blob = new Blob([JSON.stringify(obj, null, 2)], {
type: "application/json",
});
Then open the blob in a new tab:
const url = URL.createObjectURL(blob);
window.open(url, '_blank');
The content-type header of the response is correct, so I'd expect the extension to format it:
Thank you for the example @AmdJonPugh. When I created this issue in 2022 it was something I used to see almost every day. Maybe it's not possible to format blob URLs due to browsers' limitations but it could help other developers.
I'm working on an application that generates blob URLs like this:
blob:https://domain.com/path
The blos are json data containing responses from APIs.
When I click on the extension icon I see this:
Not sure if it's possible but it would be nice if I you could make formatting work for blobs too.