MCPcopy Index your code
hub / github.com/QLHazyCoder/FlowPilot / fillInput

Function fillInput

content/utils.js:218–229  ·  view source on GitHub ↗

* React-compatible form filling. * Sets value via native setter and dispatches input + change events. * @param {HTMLInputElement} el * @param {string} value

(el, value)

Source from the content-addressed store, hash-verified

216 * @param {string} value
217 */
218function fillInput(el, value) {
219 throwIfStopped();
220 const nativeInputValueSetter = Object.getOwnPropertyDescriptor(
221 window.HTMLInputElement.prototype,
222 'value'
223 ).set;
224 nativeInputValueSetter.call(el, value);
225 el.dispatchEvent(new Event('input', { bubbles: true }));
226 el.dispatchEvent(new Event('change', { bubbles: true }));
227 console.log(LOG_PREFIX, `已填写输入框 ${el.name || el.id || el.type}: ${value}`);
228 log(`已填写输入框 [${el.name || el.id || el.type || '未知'}]`);
229}
230
231/**
232 * Fill a select element by setting its value and triggering change.

Callers 9

step3_fillEmailPasswordFunction · 0.85
fillVerificationCodeFunction · 0.85
step6LoginFromEmailPageFunction · 0.85
step5_fillNameBirthdayFunction · 0.85
step9_vpsVerifyFunction · 0.85

Calls 2

logFunction · 0.85
throwIfStoppedFunction · 0.70

Tested by

no test coverage detected