I'm using Array.map() to list files in cache:
<div data-offline></div>
    <script>
    var version = 'v1:'; 
        if (navigator && navigator.serviceWorker) {
            caches.open(version + "pages").then(function (cache) {
                cache.keys().then(function (keys) {
                    var offline = document.querySelector('[data-offline]');
                    offline.innerHTML =
                    "<ul class=\"li-list\">" +
                    keys.map(function(key) {
                                    return '<li>› <a href="' + key.url + '">' + key.url + '</a></li>';
                                }).join('') +
                    "</ul>";
                });
            });
        }
    </script>
So I get a list of all html pages - as the cache is for html files only - withe the full URL, e.g. "https://www.example.com/about/" etc.
I'd like to change <a href="' + key.url + '">' + key.url + '</a> in order to show in the text of the link only the host (example.com) and pathname (/about/)
But I do not know how to implement it in this script.
 
    