Exemple #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);
            }
        }
 /// <inheritdoc />
 public Task CloseAsync(PageCloseOptions options = null) => throw new NotImplementedException();