I think either make the site use indexedDB or just use try catch. But I already tried indexedDB, it's not convenient and I doubt it offers any performance/security improvements (only prevents data from being stolen from malicious dependencies but that is unlikely to happen)
Maybe I'll try to use indexedDB. IDK