File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed
packages/wxt/src/utils/content-script-ui Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -22,6 +22,7 @@ export function createIframeUi<TMounted>(
2222 let mounted : TMounted | undefined = undefined ;
2323 const mount = ( ) => {
2424 applyPosition ( wrapper , iframe , options ) ;
25+ options . onBeforeMount ?.( wrapper , iframe ) ;
2526 mountUi ( wrapper , options ) ;
2627 mounted = options . onMount ?.( wrapper , iframe ) ;
2728 } ;
@@ -73,4 +74,9 @@ export type IframeContentScriptUiOptions<TMounted> =
7374 * Optionally return a value that can be accessed at `ui.mounted` or in the `onRemove` callback.
7475 */
7576 onMount ?: ( wrapper : HTMLElement , iframe : HTMLIFrameElement ) => TMounted ;
77+ /**
78+ * Callback executed before mounting the UI. Use this function to customize the iframe or wrapper
79+ * elements before they are injected into the DOM. It is called every time `ui.mount()` is called.
80+ */
81+ onBeforeMount ?: ( wrapper : HTMLElement , iframe : HTMLIFrameElement ) => void ;
7682 } ;
You can’t perform that action at this time.
0 commit comments