@pixelfed
A bit late to the party, but it sure looks like you are overengineering a solution to a problem that was already solved in standards using link types noreferer and noopener.
https://developer.mozilla.org/en-US/docs/Web/HTML/Link_types/noreferrer