Draft
Conversation
Collaborator
|
いいですね! |
Owner
|
めちゃくちゃいいですね! |
das08
requested changes
Apr 14, 2023
Owner
|
|
Collaborator
|
設定をONに変更したとき:syncの中身が空の場合(≒同期機能初使用時)に限りlocalからsyncにデータをコピー |
Co-authored-by: das08 <41512077+das08@users.noreply.github.com>
Co-authored-by: das08 <41512077+das08@users.noreply.github.com>
Co-authored-by: das08 <41512077+das08@users.noreply.github.com>
Contributor
Author
|
おっしゃる通りです。localとsyncを切り替える時に初期化されてしまいます。 SettingsのOnChange(?)にtinaxdさんのおっしゃた通りの処理を書こうと思ったのですが、動作がよく分かっていなかった(&じっくり読むのをサボってしまった)ので、syncのオンオフは頻繁に切り替えないだろうという想定の下、リセットを許容することにしてしまいました。 消えるのは課題のチェックぐらいでそんなに困らないだろうだと思っていましたが、そういえばmemoも消えてしまうんでしたね。それは消えると困りそうです。修正してみます。 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
マルチデバイス同期機能追加
Description
chrome.storage.localをchrome.storage.syncに変更することで、複数デバイス間で課題の完了状態・設定を共有できるようにしました。ただし、そのままでは1オブジェクトのサイズ制限に引っかかってしまうため、[hostname]-[key] の形でAssignmentsやQuiz, Settingsなどを別々に保存するように変更しました。
storageに対して変更が加わっていて問題が発生する可能性もあるため、sync機能はデフォルトでオフにし、「開発者設定」として有効化できるようにしています。

chromium版Microsoft Edgeについてはテストを行い、複数デバイス同期に成功しましたが、chrome, firefox, safariについてはテストできていません。(ストアからインストールしないと同期のテストができないため。Edgeについては"拡張機能のパック" 機能を用いてテストができた。)
しかし、chrome, firefoxでchrome.storage.syncに保存できていて、問題なく動いているということ自体は確認できました。
panda.mp4
変更点が多かったので不備があるかもしれません。ご確認よろしくお願いいたします。
Type of change
Levels of review