single-file 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. #!/usr/bin/env node
  2. /*
  3. * Copyright 2010-2019 Gildas Lormeau
  4. * contact : gildas.lormeau <at> gmail.com
  5. *
  6. * This file is part of SingleFile.
  7. *
  8. * The code in this file is free software: you can redistribute it and/or
  9. * modify it under the terms of the GNU Affero General Public License
  10. * (GNU AGPL) as published by the Free Software Foundation, either version 3
  11. * of the License, or (at your option) any later version.
  12. *
  13. * The code in this file is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero
  16. * General Public License for more details.
  17. *
  18. * As additional permission under GNU AGPL version 3 section 7, you may
  19. * distribute UNMODIFIED VERSIONS OF THIS file without the copy of the GNU
  20. * AGPL normally required by section 4, provided you include this license
  21. * notice and a URL through which recipients can access the Corresponding
  22. * Source.
  23. */
  24. /* global require */
  25. const config = {
  26. "backEnd": "puppeteer",
  27. "browserHeadless": true,
  28. "browserExecutable-path": "",
  29. "browserWidth": 1280,
  30. "browserHeight": 720,
  31. "browserLoadMaxTime": 60000,
  32. "browserWaitUntil": "networkidle0",
  33. "browserDebug": false,
  34. "browserExtensions": [],
  35. "compressCSS": true,
  36. "compressHTML": true,
  37. "filenameTemplate": "",
  38. "groupDuplicateImages": true,
  39. "loadDeferredImages": true,
  40. "loadDeferredImagesMaxIdleTime": 1500,
  41. "maxResourceSizeEnabled": false,
  42. "maxResourceSize": 10,
  43. "removeHiddenElements": true,
  44. "removeUnusedStyles": true,
  45. "removeUnusedFonts": true,
  46. "removeFrames": false,
  47. "removeImports": true,
  48. "removeScripts": true,
  49. "removeAudioSrc": true,
  50. "removeVideoSrc": true,
  51. "removeAlternativeFonts": true,
  52. "removeAlternativeMedias": true,
  53. "removeAlternativeImages": true,
  54. "saveRawPage": false,
  55. "webDriverExecutablePath": ""
  56. };
  57. require("./back-ends/puppeteer.js").getPageData(config).then(pageData => {
  58. });