• Check if the current window has an opener window with the same origin and optional pathname. This is useful for checking if the current window was opened by another window from within the same application.

    Parameters

    • Optionalpathname: string

      Optional pathname to check if the opener window has the same pathname.

    • windowLike: Window = globalThis.window

      The window-like object to use for checking the opener. Default is window.

    Returns boolean

    true if the current window has an opener window with the same origin and optional pathname, otherwise false.

    If the current window was opened by another window, the opener window is accessible via window.opener.

    There could still be an opener if the opener window is closed or navigated away or if the opener window is not from the same origin, but this function will only return true if the opener window is accessible and has the same origin and optional pathname.

MMNEPVFCICPMFPCPTTAAATR