-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathAdd-experimental-launch-flag.patch
27 lines (26 loc) · 1.07 KB
/
Add-experimental-launch-flag.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
diff --git a/packages/flutter_tools/lib/src/web/chrome.dart b/packages/flutter_tools/lib/src/web/chrome.dart
index 43a1e2f60e..f75facb8e5 100644
--- a/packages/flutter_tools/lib/src/web/chrome.dart
+++ b/packages/flutter_tools/lib/src/web/chrome.dart
@@ -194,6 +194,22 @@ class ChromiumLauncher {
}
final int port = debugPort ?? await _operatingSystemUtils.findFreePort();
+
+ // Enable experimental web platform features for the new browser instance.
+ final String json = jsonEncode(<String, dynamic>{
+ 'browser': <String, dynamic>{
+ 'enabled_labs_experiments': <String>[
+ 'enable-experimental-web-platform-features',
+ 'enable-web-bluetooth-new-permissions-backend@1',
+ 'enable-web-bluetooth@1',
+ ]
+ }
+ });
+
+ final File file = _fileSystem.file('${userDataDir.path}/Local State');
+ await file.create(recursive: true);
+ await file.writeAsString(json);
+
final List<String> args = <String>[
chromeExecutable,
// Using a tmp directory ensures that a new instance of chrome launches