1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-09-18 02:41:15 +02:00
bitwarden-browser/apps/browser/src
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
..
_locales Autosync the updated translations (#4132) 2022-11-28 16:47:15 +01:00
alarms [PS-815] MV3: Replace usage of delayed/periodic operations with AlarmsAPI (#4103) 2022-11-29 18:14:42 +01:00
background [PS-1854] Split services between background and visualizations (#4075) 2022-11-23 16:26:57 -06:00
browser Ps 1291 fix extension icon updates (#3571) 2022-10-19 08:55:57 -05:00
clipboard [PS-815] MV3: Replace usage of delayed/periodic operations with AlarmsAPI (#4103) 2022-11-29 18:14:42 +01:00
commands [PS-816] Add Autofill Shortcut to MV3 Extension (#3131) 2022-08-09 21:30:26 -04:00
content [PS-1734] Send saved urls to autofill script (#3861) 2022-11-04 10:44:21 -05:00
decorators [PS-1854] Split services between background and visualizations (#4075) 2022-11-23 16:26:57 -06:00
images [PS-1693] feat(browser): implement theming for notification bar (#3805) 2022-10-27 19:34:47 +02:00
listeners [PS-1854] Split services between background and visualizations (#4075) 2022-11-23 16:26:57 -06:00
models [PS-1854] Split services between background and visualizations (#4075) 2022-11-23 16:26:57 -06:00
notification [PS-1693] feat(browser): implement theming for notification bar (#3805) 2022-10-27 19:34:47 +02:00
popup [SM-252] Enable strict templates (#3601) 2022-11-28 18:59:46 +01:00
safari [EC-661] Add web worker code bundles to Safari browser extension (#3986) 2022-11-08 11:15:12 +10:00
scripts [EC-183] Mono Repository - Browser (#2531) 2022-05-03 19:38:55 +02:00
services [PS-1854] Split services between background and visualizations (#4075) 2022-11-23 16:26:57 -06:00
types [PS-817] Add Generate Password Shortcut to MV3 (#3575) 2022-10-18 13:03:09 -04:00
background.html [EC-183] Mono Repository - Browser (#2531) 2022-05-03 19:38:55 +02:00
background.ts [PS-815] MV3: Replace usage of delayed/periodic operations with AlarmsAPI (#4103) 2022-11-29 18:14:42 +01:00
flags.ts [EC-473] Add feature flags to common code (#3324) 2022-08-26 13:00:14 +10:00
globals.d.ts Ps 1291 fix extension icon updates (#3571) 2022-10-19 08:55:57 -05:00
managed_schema.json [SM-88] [BEEEP] Add support for chrome.storage.managed for environment urls (#3120) 2022-08-08 07:40:09 -04:00
manifest.json [PS-1693] feat(browser): implement theming for notification bar (#3805) 2022-10-27 19:34:47 +02:00
manifest.v3.json [PS-1693] feat(browser): implement theming for notification bar (#3805) 2022-10-27 19:34:47 +02:00