Re: useful bookmarklet

Improved version of the bookmarklet (which also work for the SPARQL test 
suite, and keeps the link to the external file)

javascript:Array.from(document.querySelectorAll("a[property='mf:action'],a[property='mf:result'],a[property='qt:data'],a[property='qt:graphData'],a[property='qt:query'],a[property='ut:data'],a[property='ut:graph'],a[property='ut:request']")).forEach(a 
=> { fetch(a.href).then(resp => resp.text()).then(text => { let p = 
document.createElement("pre"); p.innerText = text; a.after(p); }) });

Enjoy :)

On 25/02/2026 12:52, Pierre-Antoine Champin wrote:
> Hi all,
>
> for those of you who, like me, spend a lot of time on the test suite 
> these days,
> you might find this useful.
>
> I developed the following bookmarklet:
>
> javascript:Array.from(document.querySelectorAll("*[property='mf:action'],*[property='mf:result']")).map(x 
> => [x.href, x.parentNode]).forEach(([href, dd]) => { 
> fetch(href).then(resp => resp.text()).then(text => dd.innerHTML = 
> "<pre>" + (new Option(text)).innerHTML + "</pre>") })
>
> When you run it on an HTML manifest (e.g. 
> https://w3c.github.io/rdf-tests/rdf/rdf12/rdf-semantics/), it replaces 
> all the links to the ancillary files (action and result) by the 
> content of that file. This way you can browse the test suite without 
> navigating multiple files :)
>
> It needs some adjustments for the SPARQL test suites (which, by the 
> way, are slightly broken, I'm now working on fixing them).
>
>   best
>
>

Received on Wednesday, 25 February 2026 15:05:13 UTC