Skip to content

@tripo3d/fingerprint / withIframe

Function: withIframe()

ts
function withIframe<T>(
   action, 
   initialHtml?, 
domPollInterval?): Promise<T>;

Defined in: utils/dom.ts:29

Creates and keeps an invisible iframe while the given function runs. The given function is called when the iframe is loaded and has a body. The iframe allows to measure DOM sizes inside itself.

Notice: passing an initial HTML code doesn't work in IE.

Warning for package users: This function is out of Semantic Versioning, i.e. can change unexpectedly. Usage is at your own risk.

Type Parameters

Type Parameter
T

Parameters

ParameterTypeDefault value
action(iframe, iWindow) => MaybePromise<T>undefined
initialHtml?stringundefined
domPollInterval?number50

Returns

Promise<T>

基于 MIT 协议发布(内部使用)