Commit 3adfa8c
committed
Don't cache script-injection state when a page already has scripts
injectTranslationScripts() returned before its cleanup when a ping showed
the scripts were already present, permanently caching the per-tab
in-progress marker, so all later calls for the tab returned the cached
promise without pinging or injecting. Chromium and Firefox inject content
scripts on every page, so the skipped injection didn't matter there, but
on Safari a tab can reach a page without scripts, e.g., by navigating to
an ungranted site that the user then grants access to, and the on-demand
injection for user actions would silently do nothing for the rest of the
tab's life. Run the cleanup on every path.1 parent 8ebe182 commit 3adfa8c
1 file changed
Lines changed: 5 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
356 | 356 | | |
357 | 357 | | |
358 | 358 | | |
359 | | - | |
360 | | - | |
361 | | - | |
362 | | - | |
363 | | - | |
| 359 | + | |
364 | 360 | | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
365 | 365 | | |
366 | 366 | | |
367 | 367 | | |
| |||
0 commit comments