Akryum / Akryum/vue-cli-plugin-apollo

Failed to read the 'localStorage' property from 'Window': Access is denied for this document.

オープン
#422 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
JavaScript
スター
477
フォーク
109
PR マージ指標
30日以内にマージされた PR はありません

説明

Through Sentry I've noticed one of my users is running into the following error:
```
Network error: Failed to read the 'localStorage' property from 'Window': Access is denied for this document.
```
It seems to originate from [defaultGetAuth accessing localStorage](https://github.com/Akryum/vue-cli-plugin-apollo/blob/master/graphql-client/src/index.js#L217)

It's triggered when a user has disabled third party cookies and a site with an iframe loads a site from a different domain that uses localStorage. Lovely combination of circumstances. More info:
- 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
- https://stackoverflow.com/questions/30481516/iframe-in-chrome-error-failed-to-read-localstorage-from-window-access-deni

localStorage access should always include some checks. For Safari in private mode you even need a try catch:
https://stackoverflow.com/questions/35607724/ios-safari-private-browsing-localstorage-and-sessionstorage-support/43670472

(I know the vue-apollo.js file also uses localStorage in `onLogin` and `onLogout`, but I'm not using those.)

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。