Merge pull request #354 from madrang/beta

Fixed theme loading with extensions.
This commit is contained in:
cmdr2 2022-10-18 12:52:48 +05:30 committed by GitHub
commit b6ef18b0d8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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