Swap icky stringification for a proper clone

This commit is contained in:
Oliver Blanthorn 2026-07-10 19:21:42 +02:00
parent e921cb901e
commit b742bbeab5
No known key found for this signature in database
GPG key ID: 2BB8C36BB504BFF3
2 changed files with 4 additions and 2 deletions

View file

@ -1,6 +1,6 @@
{
"firefox": {
"minimumVersion": "91.1.0",
"minimumVersion": "94.0",
"manifestVersionPath": [
"applications",
"gecko",

View file

@ -21,6 +21,8 @@ import * as binding from "@src/lib/binding"
import * as platform from "@src/lib/platform"
import { DeepPartial } from "tsdef"
declare function structuredClone<T>(value: T): T // delete me once we move off typescript 3
/* Remove all nulls from objects recursively
* NB: also applies to arrays
*/
@ -2205,7 +2207,7 @@ export async function clear() {
*/
export async function save() {
const settingsobj = o({})
settingsobj[CONFIGNAME] = JSON.parse(JSON.stringify(USERCONFIG))
settingsobj[CONFIGNAME] = structuredClone(USERCONFIG)
return store(() => browser.storage.local.set(settingsobj))
}