mirror of
https://github.com/bitwarden/browser
synced 2025-12-16 16:23:44 +00:00
[PM-8869] Autofill features broken on Safari
This commit is contained in:
@@ -1,6 +1,12 @@
|
|||||||
import { AutofillPort } from "../enums/autofill-port.enums";
|
import { AutofillPort } from "../enums/autofill-port.enums";
|
||||||
import { FillableFormFieldElement, FormFieldElement } from "../types";
|
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>) {
|
export function requestIdleCallbackPolyfill(callback: () => void, options?: Record<string, any>) {
|
||||||
if ("requestIdleCallback" in globalThis) {
|
if ("requestIdleCallback" in globalThis) {
|
||||||
return globalThis.requestIdleCallback(() => callback(), options);
|
return globalThis.requestIdleCallback(() => callback(), options);
|
||||||
|
|||||||
Reference in New Issue
Block a user