@ceki/sdk 1.11.2 → 1.12.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.
package/README.md CHANGED
@@ -73,7 +73,7 @@ Close all sessions and the connection.
73
73
  ```typescript
74
74
  await browser.navigate(url) // Navigate to URL
75
75
  await browser.click(x, y) // Click at coordinates
76
- await browser.type(text) // Type text (char-by-char with humanizer)
76
+ await browser.type(text) // Type text — one Ceki.typeText command; extension does per-char keydown/keyUp + humanizer delays
77
77
  await browser.scroll({ deltaY: -300 }) // Scroll
78
78
  await browser.screenshot({ format: 'png' }) // Screenshot as Buffer
79
79
  await browser.screenshot({ format: 'base64' }) // Screenshot as {data: string}
package/dist/cli.js CHANGED
@@ -734,18 +734,11 @@ var Browser = class _Browser {
734
734
  params: { type: "mouseReleased", x: px, y: py, button: "left", clickCount: 1 }
735
735
  });
736
736
  }
737
- for (const char of text) {
738
- await this._sendKeystroke(char);
739
- const delay = this._humanizer.typeDelay();
740
- if (delay > 0) {
741
- await new Promise((r) => setTimeout(r, delay));
742
- }
743
- }
737
+ }
738
+ const human = this._humanizer ? ["natural", "careful"].includes(this._humanizer.profile.name) ? this._humanizer.profile.name : "natural" : null;
739
+ await this.send({ method: "Ceki.typeText", params: { text, human } });
740
+ if (this._humanizer) {
744
741
  await this._humanizer.after("type");
745
- } else {
746
- for (const char of text) {
747
- await this._sendKeystroke(char);
748
- }
749
742
  }
750
743
  }
751
744
  async scroll(opts) {