Use main() function in inject.js

This commit is contained in:
Adrian Vollmer 2022-10-10 17:41:22 +02:00
parent c0951bc3c0
commit 649324d576

View File

@ -232,6 +232,7 @@ const observer = new MutationObserver((mutationList) => {
}); });
var main = function() {
// Set parent window title and trigger data transmission // Set parent window title and trigger data transmission
var favicon = window.document.querySelector("link[rel*='icon']"); var favicon = window.document.querySelector("link[rel*='icon']");
if (favicon) { favicon = favicon.getAttribute('href'); } if (favicon) { favicon = favicon.getAttribute('href'); }
@ -245,4 +246,10 @@ window.parent.postMessage({
favicon: favicon favicon: favicon
} }
}, '*'); }, '*');
};
window.addEventListener('load', main);
//# inject.js //# inject.js