mirror of
https://github.com/tcsenpai/Zundler.git
synced 2025-06-06 11:35:40 +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) {
|
||||
if (!href) {return;}
|
||||
var favicon = document.createElement("link");
|
||||
favicon.setAttribute('rel', 'shortcut icon');
|
||||
href = normalize_path(href);
|
||||
|
@ -231,10 +231,15 @@ const observer = new MutationObserver((mutationList) => {
|
||||
|
||||
|
||||
// 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({
|
||||
action: "set_title",
|
||||
argument: {
|
||||
title: window.document.querySelector('head>title').innerText,
|
||||
favicon: document.querySelector("link[rel*='icon']").getAttribute('href')
|
||||
title: title,
|
||||
favicon: favicon
|
||||
}
|
||||
}, '*');
|
||||
|
Loading…
x
Reference in New Issue
Block a user