Skip to content

Commit ccf4575

Browse files
authored
chore(1.43): roll 1.43-beta driver (#1539)
1 parent 90aa457 commit ccf4575

File tree

6 files changed

+2
-75
lines changed

6 files changed

+2
-75
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Playwright is a Java library to automate [Chromium](https://www.chromium.org/Hom
1111

1212
| | Linux | macOS | Windows |
1313
| :--- | :---: | :---: | :---: |
14-
| Chromium <!-- GEN:chromium-version -->124.0.6367.18<!-- GEN:stop --> | :white_check_mark: | :white_check_mark: | :white_check_mark: |
14+
| Chromium <!-- GEN:chromium-version -->124.0.6367.8<!-- GEN:stop --> | :white_check_mark: | :white_check_mark: | :white_check_mark: |
1515
| WebKit <!-- GEN:webkit-version -->17.4<!-- GEN:stop --> ||||
1616
| Firefox <!-- GEN:firefox-version -->124.0<!-- GEN:stop --> | :white_check_mark: | :white_check_mark: | :white_check_mark: |
1717

playwright/src/main/java/com/microsoft/playwright/BrowserContext.java

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -44,23 +44,6 @@
4444
*/
4545
public interface BrowserContext extends AutoCloseable {
4646

47-
/**
48-
* <strong>NOTE:</strong> Only works with Chromium browser's persistent context.
49-
*
50-
* <p> Emitted when new background page is created in the context.
51-
* <pre>{@code
52-
* Page backgroundPage = context.waitForBackgroundPage(() -> {
53-
* page.getByText("activate extension").click();
54-
* });
55-
* System.out.println(backgroundPage.evaluate("location.href"));
56-
* }</pre>
57-
*/
58-
void onBackgroundPage(Consumer<Page> handler);
59-
/**
60-
* Removes handler that was previously added with {@link #onBackgroundPage onBackgroundPage(handler)}.
61-
*/
62-
void offBackgroundPage(Consumer<Page> handler);
63-
6447
/**
6548
* Emitted when Browser context gets closed. This might happen because of one of the following:
6649
* <ul>
@@ -568,14 +551,6 @@ public WaitForPageOptions setTimeout(double timeout) {
568551
* @since v1.8
569552
*/
570553
void addInitScript(Path script);
571-
/**
572-
* <strong>NOTE:</strong> Background pages are only supported on Chromium-based browsers.
573-
*
574-
* <p> All existing background pages in the context.
575-
*
576-
* @since v1.11
577-
*/
578-
List<Page> backgroundPages();
579554
/**
580555
* Returns the browser instance of the context. If it was launched as a persistent context null gets returned.
581556
*

playwright/src/main/java/com/microsoft/playwright/impl/BrowserContextImpl.java

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ class BrowserContextImpl extends ChannelOwner implements BrowserContext {
4747
private final TracingImpl tracing;
4848
private final APIRequestContextImpl request;
4949
final List<PageImpl> pages = new ArrayList<>();
50-
final List<PageImpl> backgroundPages = new ArrayList<>();
5150

5251
final Router routes = new Router();
5352
private boolean closeWasCalled;
@@ -83,7 +82,6 @@ static class HarRecorder {
8382
}
8483

8584
enum EventType {
86-
BACKGROUNDPAGE,
8785
CLOSE,
8886
CONSOLE,
8987
DIALOG,
@@ -131,16 +129,6 @@ String effectiveCloseReason() {
131129
return null;
132130
}
133131

134-
@Override
135-
public void onBackgroundPage(Consumer<Page> handler) {
136-
listeners.add(EventType.BACKGROUNDPAGE, handler);
137-
}
138-
139-
@Override
140-
public void offBackgroundPage(Consumer<Page> handler) {
141-
listeners.remove(EventType.BACKGROUNDPAGE, handler);
142-
}
143-
144132
@Override
145133
public void onClose(Consumer<BrowserContext> handler) {
146134
listeners.add(EventType.CLOSE, handler);
@@ -337,11 +325,6 @@ public void addInitScript(Path path) {
337325
});
338326
}
339327

340-
@Override
341-
public List<Page> backgroundPages() {
342-
return new ArrayList<>(backgroundPages);
343-
}
344-
345328
private void addInitScriptImpl(String script) {
346329
JsonObject params = new JsonObject();
347330
params.addProperty("source", script);
@@ -730,10 +713,6 @@ protected void handleEvent(String event, JsonObject params) {
730713
if (page.opener() != null && !page.opener().isClosed()) {
731714
page.opener().notifyPopup(page);
732715
}
733-
} else if ("backgroundPage".equals(event)) {
734-
PageImpl page = connection.getExistingObject(params.getAsJsonObject("page").get("guid").getAsString());
735-
backgroundPages.add(page);
736-
listeners.notify(EventType.BACKGROUNDPAGE, page);
737716
} else if ("bindingCall".equals(event)) {
738717
BindingCall bindingCall = connection.getExistingObject(params.getAsJsonObject("binding").get("guid").getAsString());
739718
BindingCallback binding = bindings.get(bindingCall.name());

playwright/src/main/java/com/microsoft/playwright/impl/PageImpl.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,6 @@ void notifyPopup(PageImpl popup) {
203203
void didClose() {
204204
isClosed = true;
205205
browserContext.pages.remove(this);
206-
browserContext.backgroundPages.remove(this);
207206
listeners.notify(EventType.CLOSE, this);
208207
}
209208

playwright/src/test/java/com/microsoft/playwright/TestLaunch.java

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -59,30 +59,4 @@ public static boolean canRunHeaded() {
5959
public static boolean canRunExtensionTest() {
6060
return canRunHeaded() && isChromium();
6161
}
62-
63-
@Test
64-
@EnabledIf(value="com.microsoft.playwright.TestLaunch#canRunExtensionTest", disabledReason="Only Chromium Headed")
65-
void shouldReturnBackgroundPages(@TempDir Path tmpDir) throws IOException {
66-
Path profileDir = tmpDir.resolve("profile");
67-
Files.createDirectories(profileDir);
68-
String extensionPath = Paths.get("src/test/resources/simple-extension").toAbsolutePath().toString();
69-
initBrowserType();
70-
BrowserContext context = browserType.launchPersistentContext(profileDir, new BrowserType.LaunchPersistentContextOptions()
71-
.setHeadless(false)
72-
.setArgs(asList(
73-
"--disable-extensions-except=" + extensionPath,
74-
"--load-extension=" + extensionPath
75-
)));
76-
List<Page> backgroundPages = context.backgroundPages();
77-
context.onBackgroundPage(page1 -> backgroundPages.add(page1));
78-
context.waitForCondition(() -> !backgroundPages.isEmpty(),
79-
new BrowserContext.WaitForConditionOptions().setTimeout(10_000));
80-
Page backgroundPage = backgroundPages.get(0);
81-
assertNotNull(backgroundPage);
82-
assertTrue(context.backgroundPages().contains(backgroundPage));
83-
assertFalse(context.pages().contains(backgroundPage));
84-
context.close();
85-
assertEquals(0, context.pages().size());
86-
assertEquals(0, context.backgroundPages().size());
87-
}
8862
}

scripts/CLI_VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.44.0-alpha-2024-04-02
1+
1.43.0-beta-1712173949000

0 commit comments

Comments
 (0)