Does cobalt support Factory reset mode or API?

95 Views Asked by At

I would like to ask the cobalt whether existing factory mechanism or related interface? If not, whether will have a related work plan, thank you.

Factory mode: For example, it will delete all useful info, cookies, and other data, and let changed things to restore the original state. make it the same as when the user first used it. then to restart the application.

1

There are 1 best solutions below

4
On

There's no web API to do this, but if you are in control of the implementation, you can just delete the storage and that will cover everything. There are two kinds of storage: SbStorage for user data and Cache storage for cached web resources.

SbStorage

For example, if you use the provided file-based implementation of SbStorage, it writes to $HOME/.starboard.<hash>.storage, so you could just delete that file.

If the platform has a custom implementation of SbStorage, then it will depend on the details of that implementation.

Cache

Cache files are written to the directory specified by the platform response to SbSystemGetPath(kSbSystemPathCacheDirectory, ...). You can just delete that directory to clear any stored data (right now, only application splash screens are cached there).