Update the browser, editor, settings, and installer
This commit is contained in:
@@ -19,3 +19,12 @@ test('Malformed storage returns a valid default appearance', () => {
|
||||
assert.deepEqual(parseAppearance(raw), { theme: 'default', mode: 'dark' });
|
||||
}
|
||||
});
|
||||
|
||||
test('Saved image layout restores valid choices and rejects CSS injection', () => {
|
||||
const imageId = '01234567-89ab-cdef-0123-456789abcdef';
|
||||
const restored = parseAppearance(JSON.stringify({ newTabBackground: { imageId, position: 'top left', size: 'auto', overlay: -0.4 } }));
|
||||
assert.deepEqual(restored.newTabBackground, { imageId, position: 'top left', size: 'auto', overlay: -0.4 });
|
||||
const invalid = normalizeAppearance({ newTabBackground: { imageId, position: 'url(https://example.com)', size: '100000px', overlay: Infinity } });
|
||||
assert.deepEqual(invalid.newTabBackground, { imageId, position: 'center', size: 'cover', overlay: 0 });
|
||||
assert.deepEqual(normalizeAppearance({ newTabBackground: { imageId } }).newTabBackground, { imageId, overlay: 0, position: 'center', size: 'cover' });
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user