1
0
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:
Cesar Gonzalez 2024-06-13 21:07:39 -05:00
parent 2e2061e34a
commit 15e4a24b9f
No known key found for this signature in database
GPG Key ID: 3381A5457F8CCECF

View File

@ -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);