json-viewer icon indicating copy to clipboard operation
json-viewer copied to clipboard

Extension does not work for blob URLs

Open ashmind opened this issue 10 years ago • 4 comments

If I create an URL dynamically using URL.createObjectURL, the extension does not detect JSON when I navigate to it.

Test code:

var blob = new Blob(['{ "lastname": "Dresden", "occupation": "Wizard" }'], {type: 'application/json'});
var url = URL.createObjectURL(blob);
$('body').append($('<a>Link to a JSON blob</a>').attr({
    href: url,
    target: '_blank'
}));

See http://jsfiddle.net/fQKYb/.

ashmind avatar Jun 26 '14 00:06 ashmind

Thanks, it is an important feature. I will fix it.

tulios avatar Jun 26 '14 00:06 tulios

I did a little research and confirmed my first thought about it, chrome extensions has access just to some schemes ( := '*' | 'http' | 'https' | 'file' | 'ftp' | 'chrome-extension') as it says in https://developer.chrome.com/extensions/match_patterns. If you have any ideia of how to fix this problem I will apreciate. Sorry.

tulios avatar Jun 26 '14 01:06 tulios

Thanks for the research! Raised it with Chrome: https://code.google.com/p/chromium/issues/detail?id=388972

ashmind avatar Jun 26 '14 01:06 ashmind

what ever ended up happening with this? it's the end of 2023 and json viewer still doesn't work on blob:https://somewhere.com/abc-123 ?

patrick99e99 avatar Dec 06 '23 18:12 patrick99e99