Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1312,21 +1312,6 @@
"FAIL"
]
},
{
"comment": "This is part of organizing the webdriver bidi implementation, We will remove it one by one",
"testIdPattern": "[worker.spec] *",
"platforms": [
"darwin",
"linux",
"win32"
],
"parameters": [
"webDriverBiDi"
],
"expectations": [
"FAIL"
]
},
{
"comment": "This is part of organizing the webdriver bidi implementation, We will remove it one by one",
"testIdPattern": "[ChromeLauncher.test.ts] *",
Expand Down
14 changes: 14 additions & 0 deletions lib/PuppeteerSharp/Bidi/BidiFrame.cs
Original file line number Diff line number Diff line change
Expand Up @@ -604,6 +604,20 @@
BidiPage.OnPageError(new PageErrorEventArgs(fullStack));
}
};

// Wire up worker events
if (_realms.Default is BidiFrameRealm defaultFrameRealm)
{
defaultFrameRealm.WindowRealm.Worker += (sender, args) =>
{
var worker = BidiWebWorker.From(this, args.Realm);
args.Realm.Destroyed += (o, eventArgs) =>
{
BidiPage.OnWorkerDestroyed(worker);

Check failure on line 616 in lib/PuppeteerSharp/Bidi/BidiFrame.cs

View workflow job for this annotation

GitHub Actions / Demo Project (macos-latest)

'Page.OnWorkerDestroyed(WebWorker)' is inaccessible due to its protection level

Check failure on line 616 in lib/PuppeteerSharp/Bidi/BidiFrame.cs

View workflow job for this annotation

GitHub Actions / FIREFOX-headful-ubuntu-latest-webdriverbidi

'Page.OnWorkerDestroyed(WebWorker)' is inaccessible due to its protection level

Check failure on line 616 in lib/PuppeteerSharp/Bidi/BidiFrame.cs

View workflow job for this annotation

GitHub Actions / FIREFOX-headful-ubuntu-latest-webdriverbidi

'Page.OnWorkerDestroyed(WebWorker)' is inaccessible due to its protection level

Check failure on line 616 in lib/PuppeteerSharp/Bidi/BidiFrame.cs

View workflow job for this annotation

GitHub Actions / FIREFOX-headless-ubuntu-latest-webdriverbidi

'Page.OnWorkerDestroyed(WebWorker)' is inaccessible due to its protection level

Check failure on line 616 in lib/PuppeteerSharp/Bidi/BidiFrame.cs

View workflow job for this annotation

GitHub Actions / FIREFOX-headless-ubuntu-latest-webdriverbidi

'Page.OnWorkerDestroyed(WebWorker)' is inaccessible due to its protection level

Check failure on line 616 in lib/PuppeteerSharp/Bidi/BidiFrame.cs

View workflow job for this annotation

GitHub Actions / CHROME-headless-shell-ubuntu-latest-cdp

'Page.OnWorkerDestroyed(WebWorker)' is inaccessible due to its protection level

Check failure on line 616 in lib/PuppeteerSharp/Bidi/BidiFrame.cs

View workflow job for this annotation

GitHub Actions / CHROME-headless-shell-ubuntu-latest-cdp

'Page.OnWorkerDestroyed(WebWorker)' is inaccessible due to its protection level

Check failure on line 616 in lib/PuppeteerSharp/Bidi/BidiFrame.cs

View workflow job for this annotation

GitHub Actions / CHROME-headful-ubuntu-latest-cdp

'Page.OnWorkerDestroyed(WebWorker)' is inaccessible due to its protection level

Check failure on line 616 in lib/PuppeteerSharp/Bidi/BidiFrame.cs

View workflow job for this annotation

GitHub Actions / CHROME-headful-ubuntu-latest-cdp

'Page.OnWorkerDestroyed(WebWorker)' is inaccessible due to its protection level

Check failure on line 616 in lib/PuppeteerSharp/Bidi/BidiFrame.cs

View workflow job for this annotation

GitHub Actions / CHROME-headless-windows-latest-cdp

'Page.OnWorkerDestroyed(WebWorker)' is inaccessible due to its protection level

Check failure on line 616 in lib/PuppeteerSharp/Bidi/BidiFrame.cs

View workflow job for this annotation

GitHub Actions / CHROME-headless-windows-latest-cdp

'Page.OnWorkerDestroyed(WebWorker)' is inaccessible due to its protection level

Check failure on line 616 in lib/PuppeteerSharp/Bidi/BidiFrame.cs

View workflow job for this annotation

GitHub Actions / CHROME-headful-windows-latest-cdp

'Page.OnWorkerDestroyed(WebWorker)' is inaccessible due to its protection level

Check failure on line 616 in lib/PuppeteerSharp/Bidi/BidiFrame.cs

View workflow job for this annotation

GitHub Actions / CHROME-headful-windows-latest-cdp

'Page.OnWorkerDestroyed(WebWorker)' is inaccessible due to its protection level

Check failure on line 616 in lib/PuppeteerSharp/Bidi/BidiFrame.cs

View workflow job for this annotation

GitHub Actions / CHROME-headless-shell-windows-latest-cdp

'Page.OnWorkerDestroyed(WebWorker)' is inaccessible due to its protection level

Check failure on line 616 in lib/PuppeteerSharp/Bidi/BidiFrame.cs

View workflow job for this annotation

GitHub Actions / CHROME-headless-shell-windows-latest-cdp

'Page.OnWorkerDestroyed(WebWorker)' is inaccessible due to its protection level
};
BidiPage.OnWorkerCreated(worker);

Check failure on line 618 in lib/PuppeteerSharp/Bidi/BidiFrame.cs

View workflow job for this annotation

GitHub Actions / Demo Project (macos-latest)

'Page.OnWorkerCreated(WebWorker)' is inaccessible due to its protection level

Check failure on line 618 in lib/PuppeteerSharp/Bidi/BidiFrame.cs

View workflow job for this annotation

GitHub Actions / FIREFOX-headful-ubuntu-latest-webdriverbidi

'Page.OnWorkerCreated(WebWorker)' is inaccessible due to its protection level

Check failure on line 618 in lib/PuppeteerSharp/Bidi/BidiFrame.cs

View workflow job for this annotation

GitHub Actions / FIREFOX-headful-ubuntu-latest-webdriverbidi

'Page.OnWorkerCreated(WebWorker)' is inaccessible due to its protection level

Check failure on line 618 in lib/PuppeteerSharp/Bidi/BidiFrame.cs

View workflow job for this annotation

GitHub Actions / FIREFOX-headless-ubuntu-latest-webdriverbidi

'Page.OnWorkerCreated(WebWorker)' is inaccessible due to its protection level

Check failure on line 618 in lib/PuppeteerSharp/Bidi/BidiFrame.cs

View workflow job for this annotation

GitHub Actions / FIREFOX-headless-ubuntu-latest-webdriverbidi

'Page.OnWorkerCreated(WebWorker)' is inaccessible due to its protection level

Check failure on line 618 in lib/PuppeteerSharp/Bidi/BidiFrame.cs

View workflow job for this annotation

GitHub Actions / CHROME-headless-shell-ubuntu-latest-cdp

'Page.OnWorkerCreated(WebWorker)' is inaccessible due to its protection level

Check failure on line 618 in lib/PuppeteerSharp/Bidi/BidiFrame.cs

View workflow job for this annotation

GitHub Actions / CHROME-headless-shell-ubuntu-latest-cdp

'Page.OnWorkerCreated(WebWorker)' is inaccessible due to its protection level

Check failure on line 618 in lib/PuppeteerSharp/Bidi/BidiFrame.cs

View workflow job for this annotation

GitHub Actions / CHROME-headful-ubuntu-latest-cdp

'Page.OnWorkerCreated(WebWorker)' is inaccessible due to its protection level

Check failure on line 618 in lib/PuppeteerSharp/Bidi/BidiFrame.cs

View workflow job for this annotation

GitHub Actions / CHROME-headful-ubuntu-latest-cdp

'Page.OnWorkerCreated(WebWorker)' is inaccessible due to its protection level

Check failure on line 618 in lib/PuppeteerSharp/Bidi/BidiFrame.cs

View workflow job for this annotation

GitHub Actions / CHROME-headless-windows-latest-cdp

'Page.OnWorkerCreated(WebWorker)' is inaccessible due to its protection level

Check failure on line 618 in lib/PuppeteerSharp/Bidi/BidiFrame.cs

View workflow job for this annotation

GitHub Actions / CHROME-headless-windows-latest-cdp

'Page.OnWorkerCreated(WebWorker)' is inaccessible due to its protection level

Check failure on line 618 in lib/PuppeteerSharp/Bidi/BidiFrame.cs

View workflow job for this annotation

GitHub Actions / CHROME-headful-windows-latest-cdp

'Page.OnWorkerCreated(WebWorker)' is inaccessible due to its protection level

Check failure on line 618 in lib/PuppeteerSharp/Bidi/BidiFrame.cs

View workflow job for this annotation

GitHub Actions / CHROME-headful-windows-latest-cdp

'Page.OnWorkerCreated(WebWorker)' is inaccessible due to its protection level

Check failure on line 618 in lib/PuppeteerSharp/Bidi/BidiFrame.cs

View workflow job for this annotation

GitHub Actions / CHROME-headless-shell-windows-latest-cdp

'Page.OnWorkerCreated(WebWorker)' is inaccessible due to its protection level

Check failure on line 618 in lib/PuppeteerSharp/Bidi/BidiFrame.cs

View workflow job for this annotation

GitHub Actions / CHROME-headless-shell-windows-latest-cdp

'Page.OnWorkerCreated(WebWorker)' is inaccessible due to its protection level
};
}
}

private void CreateFrameTarget(BrowsingContext browsingContext)
Expand Down
2 changes: 2 additions & 0 deletions lib/PuppeteerSharp/Bidi/BidiFrameRealm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ internal class BidiFrameRealm(WindowRealm realm, BidiFrame frame) : BidiRealm(re

internal BidiFrame Frame => frame;

internal WindowRealm WindowRealm => _realm;

public static BidiFrameRealm From(WindowRealm realm, BidiFrame frame)
{
var frameRealm = new BidiFrameRealm(realm, frame);
Expand Down
31 changes: 27 additions & 4 deletions lib/PuppeteerSharp/Bidi/BidiWebWorker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,42 @@
// * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// * SOFTWARE.

using System;
using System.Threading.Tasks;
using PuppeteerSharp.Bidi.Core;

namespace PuppeteerSharp.Bidi;

internal class BidiWebWorker : WebWorker
{
public BidiWebWorker(string url) : base(url)
private readonly BidiFrame _frame;
private readonly BidiWorkerRealm _realm;

private BidiWebWorker(BidiFrame frame, DedicatedWorkerRealm realm) : base(realm.Origin)
{
_frame = frame;
_realm = BidiWorkerRealm.From(realm, this);
}

public override ICDPSession Client => throw new NotSupportedException();

public override Task CloseAsync()
{
// BiDi doesn't support closing workers directly
// Workers are closed when they terminate themselves or when the owning page/frame closes
throw new NotSupportedException("WebWorker.CloseAsync() is not supported in BiDi protocol");
}

public override ICDPSession Client { get; }
internal static BidiWebWorker From(BidiFrame frame, DedicatedWorkerRealm realm)
{
return new BidiWebWorker(frame, realm);
}

internal override IsolatedWorld World => throw new NotSupportedException();

Check failure on line 54 in lib/PuppeteerSharp/Bidi/BidiWebWorker.cs

View workflow job for this annotation

GitHub Actions / CHROME-headless-ubuntu-latest-cdp

A property should not follow a method

Check failure on line 54 in lib/PuppeteerSharp/Bidi/BidiWebWorker.cs

View workflow job for this annotation

GitHub Actions / CHROME-headless-ubuntu-latest-cdp

A property should not follow a method

Check failure on line 54 in lib/PuppeteerSharp/Bidi/BidiWebWorker.cs

View workflow job for this annotation

GitHub Actions / Demo Project (macos-latest)

Check failure on line 54 in lib/PuppeteerSharp/Bidi/BidiWebWorker.cs

View workflow job for this annotation

GitHub Actions / FIREFOX-headful-ubuntu-latest-webdriverbidi

Check failure on line 54 in lib/PuppeteerSharp/Bidi/BidiWebWorker.cs

View workflow job for this annotation

GitHub Actions / FIREFOX-headful-ubuntu-latest-webdriverbidi

Check failure on line 54 in lib/PuppeteerSharp/Bidi/BidiWebWorker.cs

View workflow job for this annotation

GitHub Actions / FIREFOX-headless-ubuntu-latest-webdriverbidi

Check failure on line 54 in lib/PuppeteerSharp/Bidi/BidiWebWorker.cs

View workflow job for this annotation

GitHub Actions / FIREFOX-headless-ubuntu-latest-webdriverbidi

Check failure on line 54 in lib/PuppeteerSharp/Bidi/BidiWebWorker.cs

View workflow job for this annotation

GitHub Actions / CHROME-headless-shell-ubuntu-latest-cdp

Check failure on line 54 in lib/PuppeteerSharp/Bidi/BidiWebWorker.cs

View workflow job for this annotation

GitHub Actions / CHROME-headless-shell-ubuntu-latest-cdp

Check failure on line 54 in lib/PuppeteerSharp/Bidi/BidiWebWorker.cs

View workflow job for this annotation

GitHub Actions / CHROME-headful-ubuntu-latest-cdp

Check failure on line 54 in lib/PuppeteerSharp/Bidi/BidiWebWorker.cs

View workflow job for this annotation

GitHub Actions / CHROME-headful-ubuntu-latest-cdp

Check failure on line 54 in lib/PuppeteerSharp/Bidi/BidiWebWorker.cs

View workflow job for this annotation

GitHub Actions / CHROME-headless-windows-latest-cdp

Check failure on line 54 in lib/PuppeteerSharp/Bidi/BidiWebWorker.cs

View workflow job for this annotation

GitHub Actions / CHROME-headless-windows-latest-cdp

Check failure on line 54 in lib/PuppeteerSharp/Bidi/BidiWebWorker.cs

View workflow job for this annotation

GitHub Actions / CHROME-headful-windows-latest-cdp

Check failure on line 54 in lib/PuppeteerSharp/Bidi/BidiWebWorker.cs

View workflow job for this annotation

GitHub Actions / CHROME-headful-windows-latest-cdp

Check failure on line 54 in lib/PuppeteerSharp/Bidi/BidiWebWorker.cs

View workflow job for this annotation

GitHub Actions / CHROME-headless-shell-windows-latest-cdp

Check failure on line 54 in lib/PuppeteerSharp/Bidi/BidiWebWorker.cs

View workflow job for this annotation

GitHub Actions / CHROME-headless-shell-windows-latest-cdp


internal override Realm GetMainRealm() => _realm;

internal override IsolatedWorld World { get; }
internal BidiFrame Frame => _frame;

Check failure on line 58 in lib/PuppeteerSharp/Bidi/BidiWebWorker.cs

View workflow job for this annotation

GitHub Actions / CHROME-headless-ubuntu-latest-cdp

A property should not follow a method

Check failure on line 58 in lib/PuppeteerSharp/Bidi/BidiWebWorker.cs

View workflow job for this annotation

GitHub Actions / CHROME-headless-ubuntu-latest-cdp

A property should not follow a method

Check failure on line 58 in lib/PuppeteerSharp/Bidi/BidiWebWorker.cs

View workflow job for this annotation

GitHub Actions / Demo Project (macos-latest)

Check failure on line 58 in lib/PuppeteerSharp/Bidi/BidiWebWorker.cs

View workflow job for this annotation

GitHub Actions / FIREFOX-headful-ubuntu-latest-webdriverbidi

Check failure on line 58 in lib/PuppeteerSharp/Bidi/BidiWebWorker.cs

View workflow job for this annotation

GitHub Actions / FIREFOX-headful-ubuntu-latest-webdriverbidi

Check failure on line 58 in lib/PuppeteerSharp/Bidi/BidiWebWorker.cs

View workflow job for this annotation

GitHub Actions / FIREFOX-headless-ubuntu-latest-webdriverbidi

Check failure on line 58 in lib/PuppeteerSharp/Bidi/BidiWebWorker.cs

View workflow job for this annotation

GitHub Actions / FIREFOX-headless-ubuntu-latest-webdriverbidi

Check failure on line 58 in lib/PuppeteerSharp/Bidi/BidiWebWorker.cs

View workflow job for this annotation

GitHub Actions / CHROME-headless-shell-ubuntu-latest-cdp

Check failure on line 58 in lib/PuppeteerSharp/Bidi/BidiWebWorker.cs

View workflow job for this annotation

GitHub Actions / CHROME-headless-shell-ubuntu-latest-cdp

Check failure on line 58 in lib/PuppeteerSharp/Bidi/BidiWebWorker.cs

View workflow job for this annotation

GitHub Actions / CHROME-headful-ubuntu-latest-cdp

Check failure on line 58 in lib/PuppeteerSharp/Bidi/BidiWebWorker.cs

View workflow job for this annotation

GitHub Actions / CHROME-headful-ubuntu-latest-cdp

Check failure on line 58 in lib/PuppeteerSharp/Bidi/BidiWebWorker.cs

View workflow job for this annotation

GitHub Actions / CHROME-headless-windows-latest-cdp

Check failure on line 58 in lib/PuppeteerSharp/Bidi/BidiWebWorker.cs

View workflow job for this annotation

GitHub Actions / CHROME-headless-windows-latest-cdp

Check failure on line 58 in lib/PuppeteerSharp/Bidi/BidiWebWorker.cs

View workflow job for this annotation

GitHub Actions / CHROME-headful-windows-latest-cdp

Check failure on line 58 in lib/PuppeteerSharp/Bidi/BidiWebWorker.cs

View workflow job for this annotation

GitHub Actions / CHROME-headful-windows-latest-cdp

Check failure on line 58 in lib/PuppeteerSharp/Bidi/BidiWebWorker.cs

View workflow job for this annotation

GitHub Actions / CHROME-headless-shell-windows-latest-cdp


public override Task CloseAsync() => throw new System.NotImplementedException();
internal TimeoutSettings TimeoutSettings => _frame.TimeoutSettings;
}
91 changes: 91 additions & 0 deletions lib/PuppeteerSharp/Bidi/BidiWorkerRealm.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
// * MIT License
// *
// * Copyright (c) Darío Kondratiuk
// *
// * Permission is hereby granted, free of charge, to any person obtaining a copy
// * of this software and associated documentation files (the "Software"), to deal
// * in the Software without restriction, including without limitation the rights
// * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// * copies of the Software, and to permit persons to whom the Software is
// * furnished to do so, subject to the following conditions:
// *
// * The above copyright notice and this permission notice shall be included in all
// * copies or substantial portions of the Software.
// *
// * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// * SOFTWARE.

using System.Threading.Tasks;
using PuppeteerSharp.Bidi.Core;
using PuppeteerSharp.Helpers;

namespace PuppeteerSharp.Bidi;

internal class BidiWorkerRealm : BidiRealm
{
private readonly DedicatedWorkerRealm _realm;
private readonly BidiWebWorker _worker;
private readonly TaskQueue _puppeteerUtilQueue = new();
private IJSHandle _puppeteerUtil;

private BidiWorkerRealm(DedicatedWorkerRealm realm, BidiWebWorker worker)
: base(realm, worker.TimeoutSettings)
{
_realm = realm;
_worker = worker;
}

internal override IEnvironment Environment => _worker;

internal BidiWebWorker Worker => _worker;

public static BidiWorkerRealm From(DedicatedWorkerRealm realm, BidiWebWorker worker)
{
var workerRealm = new BidiWorkerRealm(realm, worker);
workerRealm.Initialize();
return workerRealm;
}

public override async Task<IJSHandle> GetPuppeteerUtilAsync()
{
var scriptInjector = _realm.Session.ScriptInjector;

await _puppeteerUtilQueue.Enqueue(async () =>
{
if (_puppeteerUtil == null)
{
await scriptInjector.InjectAsync(
async (script) =>
{
if (_puppeteerUtil != null)
{
await _puppeteerUtil.DisposeAsync().ConfigureAwait(false);
}

_puppeteerUtil = await EvaluateExpressionHandleAsync(script).ConfigureAwait(false);
},
_puppeteerUtil == null).ConfigureAwait(false);
}
}).ConfigureAwait(false);

return _puppeteerUtil;
}

protected override void Initialize()
{
base.Initialize();

_realm.Destroyed += (sender, args) => Dispose();
_realm.Updated += (sender, args) =>
{
// Reset PuppeteerUtil when the realm is updated
_puppeteerUtil = null;
TaskManager.RerunAll();
};
}
}
56 changes: 54 additions & 2 deletions lib/PuppeteerSharp/Bidi/Core/DedicatedWorkerRealm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,21 +20,27 @@
// * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// * SOFTWARE.

using System;
using System.Collections.Concurrent;
using System.Linq;
using PuppeteerSharp.Helpers;
using WebDriverBiDi.Script;

namespace PuppeteerSharp.Bidi.Core;

internal class DedicatedWorkerRealm : Realm
internal class DedicatedWorkerRealm : Realm, IDedicatedWorkerOwnerRealm
{
private readonly ConcurrentSet<IDedicatedWorkerOwnerRealm> _owners = [];
private readonly ConcurrentDictionary<string, DedicatedWorkerRealm> _workers = [];

private DedicatedWorkerRealm(BrowsingContext context, IDedicatedWorkerOwnerRealm owner, string id, string origin)
: base(context, id, origin)
{
_owners.Add(owner);
}

public event EventHandler<WorkerRealmEventArgs> Worker;

public override Session Session => _owners.FirstOrDefault()?.Session;

public static DedicatedWorkerRealm From(BrowsingContext context, IDedicatedWorkerOwnerRealm owner, string id, string origin)
Expand All @@ -44,8 +50,54 @@ public static DedicatedWorkerRealm From(BrowsingContext context, IDedicatedWorke
return realm;
}

public override void Dispose()
{
foreach (var worker in _workers.Values)
{
worker.Dispose();
}

base.Dispose();
}

private void Initialize()
{
throw new System.NotImplementedException();
// Listen to realm destruction
Session.Driver.Script.OnRealmDestroyed.AddObserver(OnRealmDestroyed);

// Listen to nested worker creation
Session.Driver.Script.OnRealmCreated.AddObserver(OnDedicatedRealmCreated);
}

private void OnRealmDestroyed(RealmDestroyedEventArgs args)
{
if (args.RealmId != Id)
{
return;
}

Dispose("Realm already destroyed.");
}

private void OnDedicatedRealmCreated(RealmCreatedEventArgs args)
{
if (args.Type != RealmType.DedicatedWorker)
{
return;
}

var dedicatedWorkerInfo = args.As<DedicatedWorkerRealmInfo>();

if (!dedicatedWorkerInfo.Owners.Contains(Id))
{
return;
}

var realm = DedicatedWorkerRealm.From(Context, this, dedicatedWorkerInfo.RealmId, dedicatedWorkerInfo.Origin);
_workers.TryAdd(realm.Id, realm);
realm.Destroyed += (sender, args) => _workers.TryRemove(realm.Id, out _);
OnWorker(realm);
}

private void OnWorker(DedicatedWorkerRealm realm) => Worker?.Invoke(this, new WorkerRealmEventArgs(realm));
}
12 changes: 7 additions & 5 deletions lib/PuppeteerSharp/WebWorker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,6 @@
/// </summary>
public abstract ICDPSession Client { get; }

/// <inheritdoc/>
Realm IEnvironment.MainRealm => World;

internal abstract IsolatedWorld World { get; }

/// <summary>
/// Executes a script in browser context.
/// </summary>
Expand Down Expand Up @@ -99,5 +94,12 @@
/// </summary>
/// <returns>A <see cref="Task"/> that completes when the worker is closed.</returns>
public abstract Task CloseAsync();

internal abstract IsolatedWorld World { get; }

Check failure on line 98 in lib/PuppeteerSharp/WebWorker.cs

View workflow job for this annotation

GitHub Actions / CHROME-headless-ubuntu-latest-cdp

A property should not follow a method

Check failure on line 98 in lib/PuppeteerSharp/WebWorker.cs

View workflow job for this annotation

GitHub Actions / CHROME-headless-ubuntu-latest-cdp

A property should not follow a method

Check failure on line 98 in lib/PuppeteerSharp/WebWorker.cs

View workflow job for this annotation

GitHub Actions / Demo Project (macos-latest)

Check failure on line 98 in lib/PuppeteerSharp/WebWorker.cs

View workflow job for this annotation

GitHub Actions / FIREFOX-headful-ubuntu-latest-webdriverbidi

Check failure on line 98 in lib/PuppeteerSharp/WebWorker.cs

View workflow job for this annotation

GitHub Actions / FIREFOX-headless-ubuntu-latest-webdriverbidi

Check failure on line 98 in lib/PuppeteerSharp/WebWorker.cs

View workflow job for this annotation

GitHub Actions / CHROME-headless-shell-ubuntu-latest-cdp

Check failure on line 98 in lib/PuppeteerSharp/WebWorker.cs

View workflow job for this annotation

GitHub Actions / CHROME-headful-ubuntu-latest-cdp

Check failure on line 98 in lib/PuppeteerSharp/WebWorker.cs

View workflow job for this annotation

GitHub Actions / CHROME-headless-windows-latest-cdp

Check failure on line 98 in lib/PuppeteerSharp/WebWorker.cs

View workflow job for this annotation

GitHub Actions / CHROME-headful-windows-latest-cdp

Check failure on line 98 in lib/PuppeteerSharp/WebWorker.cs

View workflow job for this annotation

GitHub Actions / CHROME-headless-shell-windows-latest-cdp

Check failure on line 98 in lib/PuppeteerSharp/WebWorker.cs

View workflow job for this annotation

GitHub Actions / CHROME-headless-shell-windows-latest-cdp


internal virtual Realm GetMainRealm() => World;

/// <inheritdoc/>
Realm IEnvironment.MainRealm => GetMainRealm();

Check failure on line 103 in lib/PuppeteerSharp/WebWorker.cs

View workflow job for this annotation

GitHub Actions / CHROME-headless-ubuntu-latest-cdp

A property should not follow a method

Check failure on line 103 in lib/PuppeteerSharp/WebWorker.cs

View workflow job for this annotation

GitHub Actions / CHROME-headless-ubuntu-latest-cdp

A property should not follow a method

Check failure on line 103 in lib/PuppeteerSharp/WebWorker.cs

View workflow job for this annotation

GitHub Actions / Demo Project (macos-latest)

Check failure on line 103 in lib/PuppeteerSharp/WebWorker.cs

View workflow job for this annotation

GitHub Actions / FIREFOX-headful-ubuntu-latest-webdriverbidi

Check failure on line 103 in lib/PuppeteerSharp/WebWorker.cs

View workflow job for this annotation

GitHub Actions / FIREFOX-headless-ubuntu-latest-webdriverbidi

Check failure on line 103 in lib/PuppeteerSharp/WebWorker.cs

View workflow job for this annotation

GitHub Actions / CHROME-headless-shell-ubuntu-latest-cdp

Check failure on line 103 in lib/PuppeteerSharp/WebWorker.cs

View workflow job for this annotation

GitHub Actions / CHROME-headful-ubuntu-latest-cdp

Check failure on line 103 in lib/PuppeteerSharp/WebWorker.cs

View workflow job for this annotation

GitHub Actions / CHROME-headless-windows-latest-cdp

Check failure on line 103 in lib/PuppeteerSharp/WebWorker.cs

View workflow job for this annotation

GitHub Actions / CHROME-headful-windows-latest-cdp

Check failure on line 103 in lib/PuppeteerSharp/WebWorker.cs

View workflow job for this annotation

GitHub Actions / CHROME-headless-shell-windows-latest-cdp

}
}
Loading