puppeteer.js 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /**
  2. * Copyright 2017 Google Inc. All rights reserved.
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. export * from 'puppeteer-core/internal/common/Device.js';
  17. export * from 'puppeteer-core/internal/common/Errors.js';
  18. export * from 'puppeteer-core/internal/common/PredefinedNetworkConditions.js';
  19. export * from 'puppeteer-core/internal/common/Puppeteer.js';
  20. export * from 'puppeteer-core/internal/node/BrowserFetcher.js';
  21. /**
  22. * @deprecated Use the query handler API defined on {@link Puppeteer}
  23. */
  24. export * from 'puppeteer-core/internal/common/QueryHandler.js';
  25. import { PuppeteerNode } from 'puppeteer-core/internal/node/PuppeteerNode.js';
  26. import { PUPPETEER_REVISIONS } from 'puppeteer-core/internal/revisions.js';
  27. const productName = (process.env['PUPPETEER_PRODUCT'] ||
  28. process.env['npm_config_puppeteer_product'] ||
  29. process.env['npm_package_config_puppeteer_product']);
  30. let preferredRevision;
  31. switch (productName) {
  32. case 'firefox':
  33. preferredRevision = PUPPETEER_REVISIONS.firefox;
  34. break;
  35. default:
  36. preferredRevision = PUPPETEER_REVISIONS.chromium;
  37. }
  38. /**
  39. * @public
  40. */
  41. const puppeteer = new PuppeteerNode({
  42. preferredRevision,
  43. isPuppeteerCore: false,
  44. productName,
  45. });
  46. export const { connect,
  47. /** @deprecated Import {@link BrowserFetcher} directly and use the constructor. */
  48. createBrowserFetcher, defaultArgs, executablePath, launch, } = puppeteer;
  49. export default puppeteer;
  50. //# sourceMappingURL=puppeteer.js.map