2023-05-07 20:24:53 +02:00
|
|
|
import { Tag } from './websetup.classes.tag.js';
|
2020-11-04 18:01:04 +00:00
|
|
|
|
|
|
|
|
export class LinkTag extends Tag {
|
|
|
|
|
constructor(relArg: string, hrefArg: string) {
|
|
|
|
|
super();
|
2026-05-01 18:23:23 +00:00
|
|
|
const linkElement = document.querySelector("link[rel='canonical']") ?? document.createElement('link');
|
2020-11-04 18:01:04 +00:00
|
|
|
linkElement.setAttribute('rel', relArg);
|
|
|
|
|
linkElement.setAttribute('href', hrefArg);
|
|
|
|
|
this.elementRef = linkElement;
|
|
|
|
|
}
|
|
|
|
|
}
|