Skip to content

Commit 057f598

Browse files
authored
[MV3 Debug Extension] Small fixes for building the extension (#1990)
1 parent 28a090e commit 057f598

File tree

4 files changed

+13
-3
lines changed

4 files changed

+13
-3
lines changed

Diff for: dwds/debug_extension_mv3/tool/build_extension.dart

+3
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,9 @@ Future<int> run({required bool isProd, required bool isMV3}) async {
6060
// Return non-zero exit code to indicate failure:
6161
return 1;
6262
}
63+
// If we're compiling for prod, skip updating the manifest.json:
64+
if (isProd) return 0;
65+
// Update manifest.json for dev:
6366
_logInfo('Updating manifest.json in /compiled directory.');
6467
final updateStep = await Process.start(
6568
'dart',

Diff for: dwds/debug_extension_mv3/tool/update_dev_files.dart

+8
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,14 @@ Future<void> _updateManifestJson() async {
3030
newValue: extensionKey,
3131
),
3232
];
33+
} else if (_matchesKey(line: line, key: 'default_icon')) {
34+
return [
35+
_newKeyValue(
36+
oldLine: line,
37+
newKey: 'default_icon',
38+
newValue: 'static_assets/dart_dev.png',
39+
)
40+
];
3341
} else {
3442
return [line];
3543
}

Diff for: dwds/debug_extension_mv3/web/manifest_mv2.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"manifest_version": 2,
55
"devtools_page": "static_assets/devtools.html",
66
"browser_action": {
7-
"default_icon": "static_assets/dart_dev.png"
7+
"default_icon": "static_assets/dart_grey.png"
88
},
99
"externally_connectable": {
1010
"ids": ["nbkbficgbembimioedhceniahniffgpl"]
@@ -16,7 +16,6 @@
1616
"tabs",
1717
"webNavigation"
1818
],
19-
"host_permissions": ["<all_urls>"],
2019
"background": {
2120
"scripts": ["background.dart.js"]
2221
},

Diff for: dwds/debug_extension_mv3/web/manifest_mv3.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"manifest_version": 3,
55
"devtools_page": "static_assets/devtools.html",
66
"action": {
7-
"default_icon": "static_assets/dart_dev.png"
7+
"default_icon": "static_assets/dart_grey.png"
88
},
99
"externally_connectable": {
1010
"ids": ["nbkbficgbembimioedhceniahniffgpl"]

0 commit comments

Comments
 (0)