mirror of
https://github.com/bitwarden/browser.git
synced 2025-01-25 21:51:30 +01:00
[PM-8869] Autofill features broken on Safari
This commit is contained in:
parent
2e2061e34a
commit
15e4a24b9f
@ -1,6 +1,12 @@
|
||||
import { AutofillPort } from "../enums/autofill-port.enums";
|
||||
import { FillableFormFieldElement, FormFieldElement } from "../types";
|
||||
|
||||
/**
|
||||
* Polyfills the requestIdleCallback API with a setTimeout fallback.
|
||||
*
|
||||
* @param callback - The callback function to run when the browser is idle.
|
||||
* @param options - The options to pass to the requestIdleCallback function.
|
||||
*/
|
||||
export function requestIdleCallbackPolyfill(callback: () => void, options?: Record<string, any>) {
|
||||
if ("requestIdleCallback" in globalThis) {
|
||||
return globalThis.requestIdleCallback(() => callback(), options);
|
||||
|
Loading…
Reference in New Issue
Block a user