fix userscript ui

This commit is contained in:
Carmelo Messina
2023-03-22 20:44:59 +01:00
parent 7f076e2456
commit d077cfd8e6
@@ -175,7 +175,7 @@ diff --git a/components/user_scripts/browser/user_script_prefs.cc b/components/u
+ std::unique_ptr<::prefs::DictionaryValueUpdate> update_dict = update.Get();
for (auto key : all_scripts_to_remove) {
- update_dict->RemoveKey(key);
+ update_dict->RemoveWithoutPathExpansion(key);
+ update_dict->RemoveWithoutPathExpansion(key, nullptr);
}
return;
@@ -188,7 +188,7 @@ diff --git a/components/user_scripts/browser/user_script_prefs.cc b/components/u
- update_dict->RemoveKey(script_id);
+ ::prefs::ScopedDictionaryPrefUpdate update(prefs_, kUserScriptsList);
+ std::unique_ptr<::prefs::DictionaryValueUpdate> const update_dict = update.Get();
+ update_dict->RemoveWithoutPathExpansion(script_id);
+ update_dict->RemoveWithoutPathExpansion(script_id, nullptr);
}
void UserScriptsPrefs::SetScriptEnabled(const std::string& script_id, bool is_enabled) {