[v1.38.x] Stop fetching scratch.mit.edu/csrf_token and more optimizations - #7647
Conversation
|
Relevant commits from 2022: /csrf_token/ fetched by the background page:Commit apple502j@a35c0a8
@apple502j Was /csrf_token/ fetched by the popup:Commit apple502j@ee2aa38 I believe the PR intended to add incognito support to Scratch Messaging. In Firefox, you can check the messages of the incognito logged-in account through the popup. |
…chAddons#7505) * Remove unnecessary `cleanCsInfoCache` alarm * Fetch messages less often if user inactive * Format code --------- Co-authored-by: WorldLanguages <WorldLanguages@users.noreply.github.com>
Adds the "exact count for studios" option back, but instead of loading the count (which sends a large number of requests to Scratch) every time a studio page is opened, the user has to click the "100+" first.
…ions (ScratchAddons#7647) * Use getAllCookieStores() instead of fetching hack * Call background alarms less often (`msg-count-badge` affected) (ScratchAddons#7505) * Remove unnecessary `cleanCsInfoCache` alarm * Fetch messages less often if user inactive * Format code --------- Co-authored-by: WorldLanguages <WorldLanguages@users.noreply.github.com> * Popup doesn't really need to refetch cookies --------- Co-authored-by: WorldLanguages <WorldLanguages@users.noreply.github.com>
| if (cookieStores.length === 0) throw ""; | ||
| if (cookieStores.some((store) => store.id === CHROME_DEFAULT)) { | ||
| // Chrome | ||
| return CHROME_DEFAULT; |
There was a problem hiding this comment.
Whoops, I forgot to set scratchAddons.cookieStoreId.
There was a problem hiding this comment.
This function is very badly named :P
…7650) * [v1.38.x] Stop fetching scratch.mit.edu/csrf_token and more optimizations (#7647) * Use getAllCookieStores() instead of fetching hack * Call background alarms less often (`msg-count-badge` affected) (#7505) * Remove unnecessary `cleanCsInfoCache` alarm * Fetch messages less often if user inactive * Format code --------- Co-authored-by: WorldLanguages <WorldLanguages@users.noreply.github.com> * Popup doesn't really need to refetch cookies --------- Co-authored-by: WorldLanguages <WorldLanguages@users.noreply.github.com> * Set value of `scratchAddons.cookieStoreId` * Format code * [v1.38.x] Send less requests to `scratch.mit.edu/session` etc. (#7666) * Initial commit * Format code * Fix TODO: handle chrome.storage.session undefined * Remove invalid TODO * Remove console.log * Background: only use cache on first time * Revert canUseCachedSession * exact-count addon changes (profiles) * Change animated-thumb later * Only call refreshFn once * Use underscore for _requestFetchFn attr * Remove outdated comment * Do not reference isScratchGui variable * Add code comment * Fix execution order --------- Co-authored-by: WorldLanguages <WorldLanguages@users.noreply.github.com> --------- Co-authored-by: WorldLanguages <WorldLanguages@users.noreply.github.com>
Resolves #7646
Changes
msg-count-badgeaffected) #7505 into this branch as well.Reason for changes
See PR description: #7646