Tampermonkey is great for this, because it can log everything and it brings its own XMLHttpRequest:
GM_xmlhttpRequest({
method : 'GET',
url : 'https://myloggingurl/?client='+client+'&url='+encodeURIComponent(window.location.href)+
'&title='+encodeURIComponent(document.title),
responseType : 'json',
onerror : function(e) { console.error('URL-Logger', e); },
});
I've been logging all my web activities since 2018, it's been a great tool. On the server side, I filter out ad spam and other extraneous URLs, and then run a cronjob that converts all new HTML documents it sees to PDFs with wkhtmltopdf. It's been a great tool for finding stuff in those moments where I go "hm, I remember seeing something about this months ago..."