all data urls in bg. also fix setmeta to only split on the first equal sign (#889)

This commit is contained in:
Mike Sawka 2024-09-26 23:07:06 -07:00 committed by GitHub
parent c5770a6903
commit 5d8fa2e8d9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 1 deletions

View File

@ -28,7 +28,7 @@ func init() {
func parseMetaSets(metaSets []string) (map[string]interface{}, error) { func parseMetaSets(metaSets []string) (map[string]interface{}, error) {
meta := make(map[string]interface{}) meta := make(map[string]interface{})
for _, metaSet := range metaSets { for _, metaSet := range metaSets {
fields := strings.Split(metaSet, "=") fields := strings.SplitN(metaSet, "=", 2)
if len(fields) != 2 { if len(fields) != 2 {
return nil, fmt.Errorf("invalid meta set: %q", metaSet) return nil, fmt.Errorf("invalid meta set: %q", metaSet)
} }

View File

@ -172,6 +172,9 @@ function processBackgroundUrls(cssText: string): string {
hasJSUrl = true; hasJSUrl = true;
return; return;
} }
if (originalUrl.startsWith("data:")) {
return;
}
const newUrl = encodeFileURL(originalUrl); const newUrl = encodeFileURL(originalUrl);
node.value = newUrl; node.value = newUrl;
}, },