web-ext 6.6.0 → 7.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (94) hide show
  1. package/README.md +17 -8
  2. package/bin/web-ext.js +13 -0
  3. package/index.js +12 -0
  4. package/lib/cmd/build.js +226 -0
  5. package/lib/cmd/build.js.map +1 -0
  6. package/lib/cmd/docs.js +16 -0
  7. package/lib/cmd/docs.js.map +1 -0
  8. package/lib/cmd/index.js +47 -0
  9. package/lib/cmd/index.js.map +1 -0
  10. package/lib/cmd/lint.js +50 -0
  11. package/lib/cmd/lint.js.map +1 -0
  12. package/lib/cmd/run.js +191 -0
  13. package/lib/cmd/run.js.map +1 -0
  14. package/lib/cmd/sign.js +140 -0
  15. package/lib/cmd/sign.js.map +1 -0
  16. package/lib/config.js +144 -0
  17. package/lib/config.js.map +1 -0
  18. package/{src → lib}/errors.js +26 -35
  19. package/lib/errors.js.map +1 -0
  20. package/lib/extension-runners/base.js +2 -0
  21. package/lib/extension-runners/base.js.map +1 -0
  22. package/{src → lib}/extension-runners/chromium.js +123 -179
  23. package/lib/extension-runners/chromium.js.map +1 -0
  24. package/{src → lib}/extension-runners/firefox-android.js +168 -326
  25. package/lib/extension-runners/firefox-android.js.map +1 -0
  26. package/{src → lib}/extension-runners/firefox-desktop.js +73 -114
  27. package/lib/extension-runners/firefox-desktop.js.map +1 -0
  28. package/lib/extension-runners/index.js +311 -0
  29. package/lib/extension-runners/index.js.map +1 -0
  30. package/lib/firefox/index.js +362 -0
  31. package/lib/firefox/index.js.map +1 -0
  32. package/lib/firefox/package-identifiers.js +5 -0
  33. package/lib/firefox/package-identifiers.js.map +1 -0
  34. package/{src → lib}/firefox/preferences.js +27 -70
  35. package/lib/firefox/preferences.js.map +1 -0
  36. package/{src → lib}/firefox/rdp-client.js +98 -105
  37. package/lib/firefox/rdp-client.js.map +1 -0
  38. package/{src → lib}/firefox/remote.js +55 -129
  39. package/lib/firefox/remote.js.map +1 -0
  40. package/lib/main.js +9 -0
  41. package/lib/main.js.map +1 -0
  42. package/lib/program.js +657 -0
  43. package/lib/program.js.map +1 -0
  44. package/lib/util/adb.js +322 -0
  45. package/lib/util/adb.js.map +1 -0
  46. package/lib/util/artifacts.js +52 -0
  47. package/lib/util/artifacts.js.map +1 -0
  48. package/lib/util/desktop-notifier.js +27 -0
  49. package/lib/util/desktop-notifier.js.map +1 -0
  50. package/{src → lib}/util/file-exists.js +7 -14
  51. package/lib/util/file-exists.js.map +1 -0
  52. package/{src → lib}/util/file-filter.js +31 -59
  53. package/lib/util/file-filter.js.map +1 -0
  54. package/lib/util/is-directory.js +20 -0
  55. package/lib/util/is-directory.js.map +1 -0
  56. package/lib/util/logger.js +79 -0
  57. package/lib/util/logger.js.map +1 -0
  58. package/{src → lib}/util/manifest.js +18 -50
  59. package/lib/util/manifest.js.map +1 -0
  60. package/{src → lib}/util/promisify.js +6 -9
  61. package/lib/util/promisify.js.map +1 -0
  62. package/{src → lib}/util/stdin.js +3 -7
  63. package/lib/util/stdin.js.map +1 -0
  64. package/{src → lib}/util/temp-dir.js +47 -52
  65. package/lib/util/temp-dir.js.map +1 -0
  66. package/lib/util/updates.js +16 -0
  67. package/lib/util/updates.js.map +1 -0
  68. package/lib/watcher.js +78 -0
  69. package/lib/watcher.js.map +1 -0
  70. package/package.json +52 -54
  71. package/CODE_OF_CONDUCT.md +0 -10
  72. package/bin/web-ext +0 -7
  73. package/dist/web-ext.js +0 -2
  74. package/index.mjs +0 -13
  75. package/src/cmd/build.js +0 -319
  76. package/src/cmd/docs.js +0 -33
  77. package/src/cmd/index.js +0 -57
  78. package/src/cmd/lint.js +0 -102
  79. package/src/cmd/run.js +0 -266
  80. package/src/cmd/sign.js +0 -198
  81. package/src/config.js +0 -187
  82. package/src/extension-runners/base.js +0 -40
  83. package/src/extension-runners/index.js +0 -381
  84. package/src/firefox/index.js +0 -541
  85. package/src/firefox/package-identifiers.js +0 -14
  86. package/src/main.js +0 -19
  87. package/src/program.js +0 -765
  88. package/src/util/adb.js +0 -433
  89. package/src/util/artifacts.js +0 -69
  90. package/src/util/desktop-notifier.js +0 -41
  91. package/src/util/is-directory.js +0 -23
  92. package/src/util/logger.js +0 -131
  93. package/src/util/updates.js +0 -21
  94. package/src/watcher.js +0 -114
@@ -1,541 +0,0 @@
1
- /* @flow */
2
- import nodeFs from 'fs';
3
- import path from 'path';
4
- import {promisify} from 'util';
5
-
6
- import {default as defaultFxRunner} from 'fx-runner';
7
- import FirefoxProfile from 'firefox-profile';
8
- import {fs} from 'mz';
9
- import eventToPromise from 'event-to-promise';
10
-
11
- import isDirectory from '../util/is-directory';
12
- import {isErrorWithCode, UsageError, WebExtError} from '../errors';
13
- import {getPrefs as defaultPrefGetter} from './preferences';
14
- import {getManifestId} from '../util/manifest';
15
- import {findFreeTcpPort as defaultRemotePortFinder} from './remote';
16
- import {createLogger} from '../util/logger';
17
- // Import flow types
18
- import type {
19
- PreferencesAppName,
20
- PreferencesGetterFn,
21
- FirefoxPreferences,
22
- } from './preferences';
23
- import type {ExtensionManifest} from '../util/manifest';
24
-
25
-
26
- const log = createLogger(__filename);
27
-
28
- const defaultAsyncFsStat: typeof fs.stat = fs.stat.bind(fs);
29
-
30
- const defaultUserProfileCopier = FirefoxProfile.copyFromUserProfile;
31
-
32
- export const defaultFirefoxEnv = {
33
- XPCOM_DEBUG_BREAK: 'stack',
34
- NS_TRACE_MALLOC_DISABLE_STACKS: '1',
35
- };
36
-
37
- // defaultRemotePortFinder types and implementation.
38
-
39
-
40
- export type RemotePortFinderFn =
41
- () => Promise<number>;
42
-
43
- // Declare the needed 'fx-runner' module flow types.
44
-
45
- export type FirefoxRunnerParams = {|
46
- binary: ?string,
47
- profile?: string,
48
- 'new-instance'?: boolean,
49
- 'no-remote'?: boolean,
50
- 'foreground'?: boolean,
51
- 'listen': number,
52
- 'binary-args'?: Array<string> | string,
53
- 'env'?: {
54
- // This match the flowtype signature for process.env (and prevent flow
55
- // from complaining about differences between their type signature)
56
- [key: string]: string | void
57
- },
58
- 'verbose'?: boolean,
59
- |};
60
-
61
- export interface FirefoxProcess extends events$EventEmitter {
62
- stderr: events$EventEmitter;
63
- stdout: events$EventEmitter;
64
- kill: Function;
65
- }
66
-
67
- export type FirefoxRunnerResults = {|
68
- process: FirefoxProcess,
69
- binary: string,
70
- args: Array<string>,
71
- |}
72
-
73
- export type FirefoxRunnerFn =
74
- (params: FirefoxRunnerParams) => Promise<FirefoxRunnerResults>;
75
-
76
-
77
- export type FirefoxInfo = {|
78
- firefox: FirefoxProcess,
79
- debuggerPort: number,
80
- |}
81
-
82
- // Run command types and implementaion.
83
-
84
- export type FirefoxRunOptions = {|
85
- fxRunner?: FirefoxRunnerFn,
86
- findRemotePort?: RemotePortFinderFn,
87
- firefoxBinary?: string,
88
- binaryArgs?: Array<string>,
89
- args?: Array<any>,
90
- |};
91
-
92
- /*
93
- * Runs Firefox with the given profile object and resolves a promise on exit.
94
- */
95
- export async function run(
96
- profile: FirefoxProfile,
97
- {
98
- fxRunner = defaultFxRunner,
99
- findRemotePort = defaultRemotePortFinder,
100
- firefoxBinary, binaryArgs,
101
- }: FirefoxRunOptions = {}
102
- ): Promise<FirefoxInfo> {
103
-
104
- log.debug(`Running Firefox with profile at ${profile.path()}`);
105
-
106
- const remotePort = await findRemotePort();
107
-
108
- const results = await fxRunner({
109
- // if this is falsey, fxRunner tries to find the default one.
110
- 'binary': firefoxBinary,
111
- 'binary-args': binaryArgs,
112
- // This ensures a new instance of Firefox is created. It has nothing
113
- // to do with the devtools remote debugger.
114
- 'no-remote': true,
115
- 'listen': remotePort,
116
- 'foreground': true,
117
- 'profile': profile.path(),
118
- 'env': {
119
- ...process.env,
120
- ...defaultFirefoxEnv,
121
- },
122
- 'verbose': true,
123
- });
124
-
125
- const firefox = results.process;
126
-
127
- log.debug(`Executing Firefox binary: ${results.binary}`);
128
- log.debug(`Firefox args: ${results.args.join(' ')}`);
129
-
130
- firefox.on('error', (error) => {
131
- // TODO: show a nice error when it can't find Firefox.
132
- // if (/No such file/.test(err) || err.code === 'ENOENT') {
133
- log.error(`Firefox error: ${error}`);
134
- throw error;
135
- });
136
-
137
- log.info(
138
- 'Use --verbose or open Tools > Web Developer > Browser Console ' +
139
- 'to see logging');
140
-
141
- firefox.stderr.on('data', (data) => {
142
- log.debug(`Firefox stderr: ${data.toString().trim()}`);
143
- });
144
-
145
- firefox.stdout.on('data', (data) => {
146
- log.debug(`Firefox stdout: ${data.toString().trim()}`);
147
- });
148
-
149
- firefox.on('close', () => {
150
- log.debug('Firefox closed');
151
- });
152
-
153
- return { firefox, debuggerPort: remotePort };
154
- }
155
-
156
-
157
- // isDefaultProfile types and implementation.
158
-
159
- const DEFAULT_PROFILES_NAMES = [
160
- 'default',
161
- 'dev-edition-default',
162
- ];
163
-
164
- export type IsDefaultProfileFn = (
165
- profilePathOrName: string,
166
- ProfileFinder?: typeof FirefoxProfile.Finder,
167
- fsStat?: typeof fs.stat,
168
- ) => Promise<boolean>;
169
-
170
- /*
171
- * Tests if a profile is a default Firefox profile (both as a profile name or
172
- * profile path).
173
- *
174
- * Returns a promise that resolves to true if the profile is one of default Firefox profile.
175
- */
176
- export async function isDefaultProfile(
177
- profilePathOrName: string,
178
- ProfileFinder?: typeof FirefoxProfile.Finder = FirefoxProfile.Finder,
179
- fsStat?: typeof fs.stat = fs.stat,
180
- ): Promise<boolean> {
181
- if (DEFAULT_PROFILES_NAMES.includes(profilePathOrName)) {
182
- return true;
183
- }
184
-
185
- const baseProfileDir = ProfileFinder.locateUserDirectory();
186
- const profilesIniPath = path.join(baseProfileDir, 'profiles.ini');
187
- try {
188
- await fsStat(profilesIniPath);
189
- } catch (error) {
190
- if (isErrorWithCode('ENOENT', error)) {
191
- log.debug(`profiles.ini not found: ${error}`);
192
-
193
- // No profiles exist yet, default to false (the default profile name contains a
194
- // random generated component).
195
- return false;
196
- }
197
-
198
- // Re-throw any unexpected exception.
199
- throw error;
200
- }
201
-
202
- // Check for profile dir path.
203
- const finder = new ProfileFinder(baseProfileDir);
204
- const readProfiles = promisify((...args) => finder.readProfiles(...args));
205
-
206
- await readProfiles();
207
-
208
- const normalizedProfileDirPath = path.normalize(
209
- path.join(path.resolve(profilePathOrName), path.sep)
210
- );
211
-
212
- for (const profile of finder.profiles) {
213
- // Check if the profile dir path or name is one of the default profiles
214
- // defined in the profiles.ini file.
215
- if (DEFAULT_PROFILES_NAMES.includes(profile.Name) ||
216
- profile.Default === '1') {
217
- let profileFullPath;
218
-
219
- // Check for profile name.
220
- if (profile.Name === profilePathOrName) {
221
- return true;
222
- }
223
-
224
- // Check for profile path.
225
- if (profile.IsRelative === '1') {
226
- profileFullPath = path.join(baseProfileDir, profile.Path, path.sep);
227
- } else {
228
- profileFullPath = path.join(profile.Path, path.sep);
229
- }
230
-
231
- if (path.normalize(profileFullPath) === normalizedProfileDirPath) {
232
- return true;
233
- }
234
- }
235
- }
236
-
237
- // Profile directory not found.
238
- return false;
239
- }
240
-
241
- // configureProfile types and implementation.
242
-
243
- export type ConfigureProfileOptions = {|
244
- app?: PreferencesAppName,
245
- getPrefs?: PreferencesGetterFn,
246
- customPrefs?: FirefoxPreferences,
247
- |};
248
-
249
- export type ConfigureProfileFn = (
250
- profile: FirefoxProfile,
251
- options?: ConfigureProfileOptions
252
- ) => Promise<FirefoxProfile>;
253
-
254
- /*
255
- * Configures a profile with common preferences that are required to
256
- * activate extension development.
257
- *
258
- * Returns a promise that resolves with the original profile object.
259
- */
260
- export function configureProfile(
261
- profile: FirefoxProfile,
262
- {
263
- app = 'firefox',
264
- getPrefs = defaultPrefGetter,
265
- customPrefs = {},
266
- }: ConfigureProfileOptions = {},
267
- ): Promise<FirefoxProfile> {
268
- // Set default preferences. Some of these are required for the add-on to
269
- // operate, such as disabling signatures.
270
- const prefs = getPrefs(app);
271
- Object.keys(prefs).forEach((pref) => {
272
- profile.setPreference(pref, prefs[pref]);
273
- });
274
- if (Object.keys(customPrefs).length > 0) {
275
- const customPrefsStr = JSON.stringify(customPrefs, null, 2);
276
- log.info(`Setting custom Firefox preferences: ${customPrefsStr}`);
277
- Object.keys(customPrefs).forEach((custom) => {
278
- profile.setPreference(custom, customPrefs[custom]);
279
- });
280
- }
281
- profile.updatePreferences();
282
- return Promise.resolve(profile);
283
- }
284
-
285
- export type getProfileFn = (profileName: string) => Promise<string | void>;
286
-
287
- export type CreateProfileFinderParams = {|
288
- userDirectoryPath?: string,
289
- FxProfile?: typeof FirefoxProfile
290
- |}
291
-
292
- export function defaultCreateProfileFinder(
293
- {
294
- userDirectoryPath,
295
- FxProfile = FirefoxProfile,
296
- }: CreateProfileFinderParams = {}
297
- ): getProfileFn {
298
- const finder = new FxProfile.Finder(userDirectoryPath);
299
- const readProfiles = promisify((...args) => finder.readProfiles(...args));
300
- const getPath = promisify((...args) => finder.getPath(...args));
301
- return async (profileName: string): Promise<string | void> => {
302
- try {
303
- await readProfiles();
304
- const hasProfileName = finder.profiles.filter(
305
- (profileDef) => profileDef.Name === profileName).length !== 0;
306
- if (hasProfileName) {
307
- return await getPath(profileName);
308
- }
309
- } catch (error) {
310
- if (!isErrorWithCode('ENOENT', error)) {
311
- throw error;
312
- }
313
- log.warn('Unable to find Firefox profiles.ini');
314
- }
315
- };
316
- }
317
-
318
- // useProfile types and implementation.
319
-
320
- export type UseProfileParams = {
321
- app?: PreferencesAppName,
322
- configureThisProfile?: ConfigureProfileFn,
323
- isFirefoxDefaultProfile?: IsDefaultProfileFn,
324
- customPrefs?: FirefoxPreferences,
325
- createProfileFinder?: typeof defaultCreateProfileFinder,
326
- };
327
-
328
- // Use the target path as a Firefox profile without cloning it
329
-
330
- export async function useProfile(
331
- profilePath: string,
332
- {
333
- app,
334
- configureThisProfile = configureProfile,
335
- isFirefoxDefaultProfile = isDefaultProfile,
336
- customPrefs = {},
337
- createProfileFinder = defaultCreateProfileFinder,
338
- }: UseProfileParams = {},
339
- ): Promise<FirefoxProfile> {
340
- const isForbiddenProfile = await isFirefoxDefaultProfile(profilePath);
341
- if (isForbiddenProfile) {
342
- throw new UsageError(
343
- 'Cannot use --keep-profile-changes on a default profile' +
344
- ` ("${profilePath}")` +
345
- ' because web-ext will make it insecure and unsuitable for daily use.' +
346
- '\nSee https://github.com/mozilla/web-ext/issues/1005'
347
- );
348
- }
349
-
350
- let destinationDirectory;
351
- const getProfilePath = createProfileFinder();
352
-
353
- const profileIsDirPath = await isDirectory(profilePath);
354
- if (profileIsDirPath) {
355
- log.debug(`Using profile directory "${profilePath}"`);
356
- destinationDirectory = profilePath;
357
- } else {
358
- log.debug(`Assuming ${profilePath} is a named profile`);
359
- destinationDirectory = await getProfilePath(profilePath);
360
- if (!destinationDirectory) {
361
- throw new UsageError(
362
- `The request "${profilePath}" profile name ` +
363
- 'cannot be resolved to a profile path'
364
- );
365
- }
366
- }
367
-
368
- const profile = new FirefoxProfile({destinationDirectory});
369
- return await configureThisProfile(profile, {app, customPrefs});
370
- }
371
-
372
-
373
- // createProfile types and implementation.
374
-
375
- export type CreateProfileParams = {
376
- app?: PreferencesAppName,
377
- configureThisProfile?: ConfigureProfileFn,
378
- customPrefs?: FirefoxPreferences,
379
- };
380
-
381
- /*
382
- * Creates a new temporary profile and resolves with the profile object.
383
- *
384
- * The profile will be deleted when the system process exits.
385
- */
386
- export async function createProfile(
387
- {
388
- app,
389
- configureThisProfile = configureProfile,
390
- customPrefs = {},
391
- }: CreateProfileParams = {},
392
- ): Promise<FirefoxProfile> {
393
- const profile = new FirefoxProfile();
394
- return await configureThisProfile(profile, {app, customPrefs});
395
- }
396
-
397
-
398
- // copyProfile types and implementation.
399
-
400
- export type CopyProfileOptions = {|
401
- app?: PreferencesAppName,
402
- configureThisProfile?: ConfigureProfileFn,
403
- copyFromUserProfile?: Function,
404
- customPrefs?: FirefoxPreferences,
405
- |};
406
-
407
- /*
408
- * Copies an existing Firefox profile and creates a new temporary profile.
409
- * The new profile will be configured with some preferences required to
410
- * activate extension development.
411
- *
412
- * It resolves with the new profile object.
413
- *
414
- * The temporary profile will be deleted when the system process exits.
415
- *
416
- * The existing profile can be specified as a directory path or a name of
417
- * one that exists in the current user's Firefox directory.
418
- */
419
- export async function copyProfile(
420
- profileDirectory: string,
421
- {
422
- app,
423
- configureThisProfile = configureProfile,
424
- copyFromUserProfile = defaultUserProfileCopier,
425
- customPrefs = {},
426
- }: CopyProfileOptions = {},
427
- ): Promise<FirefoxProfile> {
428
-
429
- const copy = promisify(FirefoxProfile.copy);
430
- const copyByName = promisify(copyFromUserProfile);
431
-
432
- try {
433
- const dirExists = await isDirectory(profileDirectory);
434
-
435
- let profile;
436
-
437
- if (dirExists) {
438
- log.debug(`Copying profile directory from "${profileDirectory}"`);
439
- profile = await copy({profileDirectory});
440
- } else {
441
- log.debug(`Assuming ${profileDirectory} is a named profile`);
442
- profile = await copyByName({name: profileDirectory});
443
- }
444
-
445
- return configureThisProfile(profile, {app, customPrefs});
446
- } catch (error) {
447
- throw new WebExtError(
448
- `Could not copy Firefox profile from ${profileDirectory}: ${error}`);
449
- }
450
- }
451
-
452
-
453
- // installExtension types and implementation.
454
-
455
- export type InstallExtensionParams = {|
456
- asProxy?: boolean,
457
- manifestData: ExtensionManifest,
458
- profile: FirefoxProfile,
459
- extensionPath: string,
460
- asyncFsStat?: typeof defaultAsyncFsStat,
461
- |};
462
-
463
- /*
464
- * Installs an extension into the given Firefox profile object.
465
- * Resolves when complete.
466
- *
467
- * The extension is copied into a special location and you need to turn
468
- * on some preferences to allow this. See extensions.autoDisableScopes in
469
- * ./preferences.js.
470
- *
471
- * When asProxy is true, a special proxy file will be installed. This is a
472
- * text file that contains the path to the extension source.
473
- */
474
- export async function installExtension(
475
- {
476
- asProxy = false,
477
- manifestData,
478
- profile,
479
- extensionPath,
480
- asyncFsStat = defaultAsyncFsStat,
481
- }: InstallExtensionParams): Promise<any> {
482
- // This more or less follows
483
- // https://github.com/saadtazi/firefox-profile-js/blob/master/lib/firefox_profile.js#L531
484
- // (which is broken for web extensions).
485
- // TODO: maybe uplift a patch that supports web extensions instead?
486
-
487
- if (!profile.extensionsDir) {
488
- throw new WebExtError('profile.extensionsDir was unexpectedly empty');
489
- }
490
-
491
- try {
492
- await asyncFsStat(profile.extensionsDir);
493
- } catch (error) {
494
- if (isErrorWithCode('ENOENT', error)) {
495
- log.debug(`Creating extensions directory: ${profile.extensionsDir}`);
496
- await fs.mkdir(profile.extensionsDir);
497
- } else {
498
- throw error;
499
- }
500
- }
501
-
502
- const id = getManifestId(manifestData);
503
- if (!id) {
504
- throw new UsageError(
505
- 'An explicit extension ID is required when installing to ' +
506
- 'a profile (applications.gecko.id not found in manifest.json)');
507
- }
508
-
509
- if (asProxy) {
510
- log.debug(`Installing as an extension proxy; source: ${extensionPath}`);
511
-
512
- const isDir = await isDirectory(extensionPath);
513
- if (!isDir) {
514
- throw new WebExtError(
515
- 'proxy install: extensionPath must be the extension source ' +
516
- `directory; got: ${extensionPath}`);
517
- }
518
-
519
- // Write a special extension proxy file containing the source
520
- // directory. See:
521
- // https://developer.mozilla.org/en-US/Add-ons/Setting_up_extension_development_environment#Firefox_extension_proxy_file
522
- const destPath = path.join(profile.extensionsDir, `${id}`);
523
- const writeStream = nodeFs.createWriteStream(destPath);
524
- writeStream.write(extensionPath);
525
- writeStream.end();
526
- return await eventToPromise(writeStream, 'close');
527
- } else {
528
- // Write the XPI file to the profile.
529
- const readStream = nodeFs.createReadStream(extensionPath);
530
- const destPath = path.join(profile.extensionsDir, `${id}.xpi`);
531
- const writeStream = nodeFs.createWriteStream(destPath);
532
-
533
- log.debug(`Installing extension from ${extensionPath} to ${destPath}`);
534
- readStream.pipe(writeStream);
535
-
536
- return await Promise.all([
537
- eventToPromise(readStream, 'close'),
538
- eventToPromise(writeStream, 'close'),
539
- ]);
540
- }
541
- }
@@ -1,14 +0,0 @@
1
- /* @flow */
2
-
3
- export default [
4
- 'org.mozilla.fennec',
5
- 'org.mozilla.fenix',
6
- 'org.mozilla.geckoview_example',
7
- 'org.mozilla.geckoview',
8
- 'org.mozilla.firefox',
9
- 'org.mozilla.reference.browser',
10
- ];
11
-
12
- export const defaultApkComponents = {
13
- 'org.mozilla.reference.browser': '.BrowserActivity',
14
- };
package/src/main.js DELETED
@@ -1,19 +0,0 @@
1
- /* @flow */
2
- import {main} from './program';
3
- import cmd from './cmd';
4
- import * as logger from './util/logger';
5
-
6
- // This only exposes util/logger and a subset of util/adb so far.
7
- // Do we need anything else?
8
- const util = {
9
- logger,
10
- // Lazy load the adb module when util.adb is accessed for the first time, to defer loading
11
- // the npm dependencies used by the adb module to when actually needed.
12
- // This is being done to continue the courtesy of web-ext issue #1301
13
- get adb(): Object {
14
- const {listADBDevices, listADBFirefoxAPKs} = require('./util/adb');
15
- return {listADBDevices, listADBFirefoxAPKs};
16
- },
17
- };
18
-
19
- export default {main, cmd, util};