From 15e4a24b9fabceaa17c305f442e9ed068352538d Mon Sep 17 00:00:00 2001 From: Cesar Gonzalez Date: Thu, 13 Jun 2024 21:07:39 -0500 Subject: [PATCH] [PM-8869] Autofill features broken on Safari --- apps/browser/src/autofill/utils/index.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/apps/browser/src/autofill/utils/index.ts b/apps/browser/src/autofill/utils/index.ts index ab01f517e3e..e5d20cf9f59 100644 --- a/apps/browser/src/autofill/utils/index.ts +++ b/apps/browser/src/autofill/utils/index.ts @@ -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) { if ("requestIdleCallback" in globalThis) { return globalThis.requestIdleCallback(() => callback(), options);