mirror of
https://github.com/owncast/owncast.git
synced 2024-10-10 19:16:02 +00:00
Add to anchor rel attributes do not overwrite
This commit is contained in:
parent
d91f682d21
commit
64a2fbd3e8
@ -15,7 +15,9 @@ export default function setupNoLinkReferrer(observationRoot: HTMLElement): void
|
||||
const config = { attributes: false, childList: true, subtree: true };
|
||||
|
||||
const addNoReferrer = (node: Element): void => {
|
||||
node.setAttribute('rel', 'noopener noreferrer ');
|
||||
const existingAttributes = node.getAttribute('rel');
|
||||
const attributes = `${existingAttributes} noopener noreferrer`;
|
||||
node.setAttribute('rel', attributes);
|
||||
};
|
||||
|
||||
// Callback function to execute when mutations are observed
|
||||
|
Loading…
x
Reference in New Issue
Block a user