browser(webkit): support --no-startup-window

b8cb5490a3
This commit is contained in:
Dmitry Gozman 2020-02-20 11:51:39 -08:00
parent 2fabaaf751
commit 1014125884
2 changed files with 10 additions and 7 deletions

View file

@ -1 +1 @@
1152
1153

View file

@ -13960,10 +13960,10 @@ index 0000000000000000000000000000000000000000..00fb6b0006c743091a8bbf8edb18b211
+</Scheme>
diff --git a/Tools/Playwright/mac/AppDelegate.h b/Tools/Playwright/mac/AppDelegate.h
new file mode 100644
index 0000000000000000000000000000000000000000..41b5751cab626971cd12c5066218c6d14c00fba0
index 0000000000000000000000000000000000000000..42ea067d455862eab9275d1b466e655340b71070
--- /dev/null
+++ b/Tools/Playwright/mac/AppDelegate.h
@@ -0,0 +1,55 @@
@@ -0,0 +1,56 @@
+/*
+ * Copyright (C) 2010 Apple Inc. All rights reserved.
+ *
@ -14001,6 +14001,7 @@ index 0000000000000000000000000000000000000000..41b5751cab626971cd12c5066218c6d1
+ NSMutableSet *_headlessWindows;
+ NSMutableSet *_browserContexts;
+ bool _headless;
+ bool _no_startup_window;
+ NSMutableSet *_dialogs;
+ NSString* _initialURL;
+ NSString* _userDataDir;
@ -14021,10 +14022,10 @@ index 0000000000000000000000000000000000000000..41b5751cab626971cd12c5066218c6d1
+@end
diff --git a/Tools/Playwright/mac/AppDelegate.m b/Tools/Playwright/mac/AppDelegate.m
new file mode 100644
index 0000000000000000000000000000000000000000..7fbd8c5426eb43b96a7c8e793a7f85810819053e
index 0000000000000000000000000000000000000000..637029587153f5157a3a046877840dda1a4bdfe1
--- /dev/null
+++ b/Tools/Playwright/mac/AppDelegate.m
@@ -0,0 +1,490 @@
@@ -0,0 +1,492 @@
+/*
+ * Copyright (C) 2010-2016 Apple Inc. All rights reserved.
+ *
@ -14127,6 +14128,7 @@ index 0000000000000000000000000000000000000000..7fbd8c5426eb43b96a7c8e793a7f8581
+ }
+
+ _headless = [arguments containsObject: @"--headless"];
+ _no_startup_window = [arguments containsObject: @"--no-startup-window"];
+ _browserContexts = [[NSMutableSet alloc] init];
+
+ if (_headless) {
@ -14271,7 +14273,8 @@ index 0000000000000000000000000000000000000000..7fbd8c5426eb43b96a7c8e793a7f8581
+- (void)applicationDidFinishLaunching:(NSNotification *)aNotification
+{
+ if (_headless) {
+ [self createNewPage:0];
+ if (!_no_startup_window)
+ [self createNewPage:0];
+ return;
+ }
+
@ -14280,7 +14283,7 @@ index 0000000000000000000000000000000000000000..7fbd8c5426eb43b96a7c8e793a7f8581
+ [webHistory release];
+
+ [self _updateNewWindowKeyEquivalents];
+ if (!_initialURL)
+ if (!_initialURL && !_no_startup_window)
+ [self newWindow:self];
+ _initialURL = nil;
+}