Fixed theme loading with extensions.

This commit is contained in:
Marc-Andre Ferland 2022-10-18 03:21:59 -04:00
parent efffca83fe
commit 372484f976

View File

@ -1757,7 +1757,7 @@ function getThemeName(theme) {
// init themefield
function initTheme() {
Array.from(document.styleSheets)
.filter(sheet => sheet.href.startsWith(window.location.origin))
.filter(sheet => sheet.href?.startsWith(window.location.origin))
.flatMap(sheet => Array.from(sheet.cssRules))
.forEach(rule => {
var selector = rule.selectorText; // TODO: also do selector == ":root", re-run un-set props