cookies.js 905 B

12345678910111213141516171819202122232425262728293031
  1. module.exports.name = 'cookies'
  2. module.exports.description = 'List all iOS cookies'
  3. // Specify this reporter requires a backup.
  4. // The second parameter to func() is now a backup instead of the path to one.
  5. module.exports.requiresBackup = true
  6. // Specify this reporter supports the promises API for allowing chaining of reports.
  7. module.exports.usesPromises = true
  8. module.exports.func = function (program, backup, resolve, reject) {
  9. backup.getCookies()
  10. .then((items) => {
  11. // Use the configured formatter to print the rows.
  12. const result = program.formatter.format(items, {
  13. // Color formatting?
  14. program: program,
  15. // Columns to be displayed in human-readable printouts.
  16. // Some formatters, like raw or CSV, ignore these.
  17. columns: {
  18. 'domain': el => el.domain,
  19. 'url': el => el.cookie.url
  20. }
  21. })
  22. resolve(result)
  23. })
  24. .catch(reject)
  25. }