@dune2/tools 0.5.0 → 0.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/i18n/duneI18n.ts +7 -1
- package/src/i18n/enums.ts +2 -0
package/package.json
CHANGED
package/src/i18n/duneI18n.ts
CHANGED
|
@@ -157,7 +157,13 @@ export class DuneI18n {
|
|
|
157
157
|
this.emit("localeChange", combinedLocale);
|
|
158
158
|
// 默认需要 同步到 localStorage
|
|
159
159
|
if (syncToStorage) {
|
|
160
|
-
|
|
160
|
+
//https://www.chromium.org/for-testers/bug-reporting-guidelines/uncaught-securityerror-failed-to-read-the-localstorage-property-from-window-access-is-denied-for-this-document/
|
|
161
|
+
//fix: Failed to read the 'localStorage' property from 'Window': Access is denied for this document.
|
|
162
|
+
try {
|
|
163
|
+
localStorage.setItem(this.config.storageKey, combinedLocale);
|
|
164
|
+
} catch (error) {
|
|
165
|
+
console.error("set localStorage error", error);
|
|
166
|
+
}
|
|
161
167
|
}
|
|
162
168
|
};
|
|
163
169
|
|