const changeFavicon = link => {
let $favicon = ('link[rel="icon"]');
// If a <link rel="icon"> element already exists,
// change its href to the given link.
if ($favicon !== null) {
$ = link;
// Otherwise, create a new element and append it to <head>.
} else {
$favicon = ("link");
$ = "icon";
$ = link;
($favicon);
}
};
let icon = ''; // 图片地址
changeFavicon(icon); // 动态修改网站图标
let title = ''; // 网站标题
= title; // 动态修改网站标题