예제 #1
0
        /// <inheritdoc cref="IPage.CloseAsync(PageCloseOptions)"/>
        public async Task CloseAsync(PageCloseOptions options = null)
        {
            if (IsClosed)
            {
                return;
            }

            if (_disconnected)
            {
                throw new PlaywrightSharpException("Protocol error: Connection closed. Most likely the page has been closed.");
            }

            bool runBeforeUnload = options?.RunBeforeUnload ?? false;
            await Delegate.ClosePageAsync(runBeforeUnload).ConfigureAwait(false);

            if (!runBeforeUnload)
            {
                await _closeTsc.Task.ConfigureAwait(false);
            }
        }
예제 #2
0
 /// <inheritdoc />
 public Task CloseAsync(PageCloseOptions options = null) => throw new NotImplementedException();