fill-profile.js 897 B

123456789101112131415161718192021222324252627282930
  1. (function attachBackgroundStep5(root, factory) {
  2. root.MultiPageBackgroundStep5 = factory();
  3. })(typeof self !== 'undefined' ? self : globalThis, function createBackgroundStep5Module() {
  4. function createStep5Executor(deps = {}) {
  5. const {
  6. addLog,
  7. generateRandomBirthday,
  8. generateRandomName,
  9. sendToContentScript,
  10. } = deps;
  11. async function executeStep5() {
  12. const { firstName, lastName } = generateRandomName();
  13. const { year, month, day } = generateRandomBirthday();
  14. await addLog(`步骤 5:已生成姓名 ${firstName} ${lastName},生日 ${year}-${month}-${day}`);
  15. await sendToContentScript('signup-page', {
  16. type: 'EXECUTE_STEP',
  17. step: 5,
  18. source: 'background',
  19. payload: { firstName, lastName, year, month, day },
  20. });
  21. }
  22. return { executeStep5 };
  23. }
  24. return { createStep5Executor };
  25. });