Skip to content
Merged
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 @@ -46,7 +46,6 @@ class BrowserContextImpl extends ChannelOwner implements BrowserContext {
private final APIRequestContextImpl request;
private final ClockImpl clock;
final List<PageImpl> pages = new ArrayList<>();
final List<PageImpl> backgroundPages = new ArrayList<>();

final Router routes = new Router();
final WebSocketRouter webSocketRoutes = new WebSocketRouter();
Expand Down Expand Up @@ -81,7 +80,6 @@ static class HarRecorder {
}

enum EventType {
BACKGROUNDPAGE,
CLOSE,
CONSOLE,
DIALOG,
Expand Down Expand Up @@ -133,12 +131,10 @@ String effectiveCloseReason() {

@Override
public void onBackgroundPage(Consumer<Page> handler) {
listeners.add(EventType.BACKGROUNDPAGE, handler);
}

@Override
public void offBackgroundPage(Consumer<Page> handler) {
listeners.remove(EventType.BACKGROUNDPAGE, handler);
}

@Override
Expand Down Expand Up @@ -340,7 +336,7 @@ public void addInitScript(Path path) {

@Override
public List<Page> backgroundPages() {
return new ArrayList<>(backgroundPages);
return Collections.emptyList();
}

@Override
Expand Down Expand Up @@ -719,10 +715,6 @@ protected void handleEvent(String event, JsonObject params) {
if (page.opener() != null && !page.opener().isClosed()) {
page.opener().notifyPopup(page);
}
} else if ("backgroundPage".equals(event)) {
PageImpl page = connection.getExistingObject(params.getAsJsonObject("page").get("guid").getAsString());
backgroundPages.add(page);
listeners.notify(EventType.BACKGROUNDPAGE, page);
} else if ("bindingCall".equals(event)) {
BindingCall bindingCall = connection.getExistingObject(params.getAsJsonObject("binding").get("guid").getAsString());
BindingCallback binding = bindings.get(bindingCall.name());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,6 @@ void notifyPopup(PageImpl popup) {
void didClose() {
isClosed = true;
browserContext.pages.remove(this);
browserContext.backgroundPages.remove(this);
listeners.notify(EventType.CLOSE, this);
}

Expand Down