Class AbstractPageEventHandlers

    • Method Detail

      • chain

         PageEventHandlers chain(PageEventHandlers other)

        Chains another page event handler to the tail of this one.

        All handler groups (load, browse, browser) are chained together. Chained handlers execute in order: this handler's callbacks first, then the other handler's callbacks.

        val baseHandlers = DefaultPageEventHandlers()
        val customHandlers = DefaultPageEventHandlers()
        customHandlers.le.onLoaded.addLast { page -> println("Custom") }
        baseHandlers.chain(customHandlers)  // Custom handler runs after base
        Parameters:
        other - The page event handlers to chain
        Returns:

        This handler instance for fluent chaining