I'm browsing a json file with Firefox to navigate, I have to copy and paste the links in the document.
Is there a possibility to make these links hyperlink-style clickable?
I'm browsing a json file with Firefox to navigate, I have to copy and paste the links in the document.
Is there a possibility to make these links hyperlink-style clickable?
Use following GreaseMonkey script (optionally fire it for JSON paths on your domain too).
// ==UserScript==
// @name JSON links
// @namespace http://example.com/json-links
// @description Clickable links in JSON
// @include http://localhost/*
// @version 1
// @grant none
// ==/UserScript==
setTimeout(function() {
Array.forEach(
document.querySelectorAll('.objectBox-string'),
function(span) {
var url = span.firstChild.nodeValue;
url = /^\s*"((?:http|https|ftp):\/\/.*)"\s*$/.exec(url);
if(!url) return;
url = url[1];
var a = document.createElement('a');
a.href = url;
a.appendChild(span.firstChild);
span.parentNode.replaceChild(a, span);
}
);
}, 300); // FF dev tools transform JSON into HTML dynamically therefore timeout
If you need to run it on local files too, see this answer:
(although I don't know if it works in the current version of Firefox).