1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-07-11 13:06:03 +02:00
bitwarden-browser/apps
Daniel James Smith 42128d41f0
[PS-815] MV3: Replace usage of delayed/periodic operations with AlarmsAPI (#4103)
* Register alarms and listen to them

* Wire up alarms and actions

Register actions(commands) which can be executed by an alarm
Create methods in alarm-state to persists actions and execution times
Flesh out AlarmListener to iterate over registered commands and check if they need to execute
Simplify clearClipboard action as it only handles the action instead of also worrying if it should fire.
Enable previously disabled clear-clipboard tests (#3532)
Adjust clear-clipboard tests to new simpler execution

Co-authored-by: Matt Gibson <mgibson@bitwarden.com>

* Make linter happy

* Revert accidentally commited with merging master

* Add jsdoc per PR comment

* Fixed types to simplify adding new alarm actions

Create a new alarm action (i.e `clear-clipboard.ts`)
Export a name for the alarm action (`clearClipboardAlarmName`)

`alarm-state.ts`
Import alarm action name
Extend `alarmKeys` and `alarmState`

`on-alarm-listener`
Import alarm action method and alarm action name
Add it to the switch case

* Add comment to clearClipboard action

Add comment to replace clearClipboard impl once clipboardApi's are accessible by service-workers

https://bugs.chromium.org/p/chromium/issues/detail?id=1160302

Co-authored-by: Matt Gibson <mgibson@bitwarden.com>
2022-11-29 18:14:42 +01:00
..
browser [PS-815] MV3: Replace usage of delayed/periodic operations with AlarmsAPI (#4103) 2022-11-29 18:14:42 +01:00
cli [PS-1879] Fix Key Connector Migration Flow (#4080) 2022-11-18 16:38:28 -05:00
desktop Bumped desktop version to 2022.11.0 (#4142) 2022-11-29 12:34:17 +00:00
web Fix build errors for strict templates (#4134) 2022-11-29 09:00:45 +10:00