mirror of
https://github.com/tcsenpai/Zundler.git
synced 2025-06-07 12:05:41 +00:00
Handle non-existing favicons
This commit is contained in:
parent
9840d92932
commit
c60bee22b2
@ -24,6 +24,7 @@ var _base64ToArrayBuffer = function (base64) {
|
|||||||
|
|
||||||
|
|
||||||
var set_favicon = function(href) {
|
var set_favicon = function(href) {
|
||||||
|
if (!href) {return;}
|
||||||
var favicon = document.createElement("link");
|
var favicon = document.createElement("link");
|
||||||
favicon.setAttribute('rel', 'shortcut icon');
|
favicon.setAttribute('rel', 'shortcut icon');
|
||||||
href = normalize_path(href);
|
href = normalize_path(href);
|
||||||
|
@ -231,10 +231,15 @@ const observer = new MutationObserver((mutationList) => {
|
|||||||
|
|
||||||
|
|
||||||
// Set parent window title and trigger data transmission
|
// Set parent window title and trigger data transmission
|
||||||
|
var favicon = window.document.querySelector("link[rel*='icon']");
|
||||||
|
if (favicon) { favicon = favicon.getAttribute('href'); }
|
||||||
|
var title = window.document.querySelector('head>title');
|
||||||
|
if (title) { title = title.innerText; }
|
||||||
|
|
||||||
window.parent.postMessage({
|
window.parent.postMessage({
|
||||||
action: "set_title",
|
action: "set_title",
|
||||||
argument: {
|
argument: {
|
||||||
title: window.document.querySelector('head>title').innerText,
|
title: title,
|
||||||
favicon: document.querySelector("link[rel*='icon']").getAttribute('href')
|
favicon: favicon
|
||||||
}
|
}
|
||||||
}, '*');
|
}, '*');
|
||||||
|
Loading…
x
Reference in New Issue
Block a user