Skip to content

Custom settings are wiped when using a temp override #587

Description

@VitaKaninen

For example, I go to YouTube, then select gstatic in the list of scripts, and select custom, and then select YouTube for the site, and then set the custom permissions, this means that when I am on YouTube, gstatic uses those permissions there. But then if I go to another site, and do the same thing, then I can have specific settings for each site.

The problem is that if I go to a 3rd site, and set gstatic to temp allowed, it wipes all the gstatic settings completely and sets it back to default for all sites.

If I use standard settings, and not custom, then when the temp settings expires, it returns to the saved settings, and does not wipe it.

This is a big pain, since it means a lot of extra clicking through menus and using custom settings each time I want to trial and error a site to find out what is breaking. Or it means that I need to remember to export all my settings before setting anything to temporarily allowed.

Can you please make it so that using temp allowed, does not wipe all the custom settings for a site?

Here is a brief summary from Claude Code:

All of a sub-resource's per-site rules live inside one policy.sites entry, as perms.contextual — a map of top-site → permissions. So every gstatic rule you've built shares a single entry's fate.

When you pick a plain preset (TRUSTED/DEFAULT/UNTRUSTED) for the gstatic row, src/ui/ui.js does:

row.contextMatch = null;
delete row._customPerms;
this.policy.set(siteMatch, policyPreset);
and Policy.set() opens with sites.delete(siteKey), then stores the shared preset object, whose contextual map is empty.

Running your sequence:

  1. baseline entry=yes contextual=[youtube.com, news.example.com]
  2. after temp preset entry=yes contextual=[] <-- already gone
  3. after revokeTemp() entry=NONE contextual=[]
    Line 2 is the whole story. Your per-site rules are gone the instant you select the temp preset. Expiry just removes the leftover husk — and since temp entries are excluded from Policy.dry(), nothing was ever persisted, so there's nothing to restore and gstatic lands on DEFAULT.

So it isn't "temp expiry wipes settings." It's "switching a site to a plain preset discards all its per-site rules, and choosing a temporary preset means that destruction is never written down anywhere you could recover it from." Any preset click does the damage; the temp flag just removes your last chance to notice before it's unrecoverable.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions