Hi,
I am not able to find an form ID, or anything else that I can capture to send a submit
It’s like the form has processing in other place, out of index
The form is into divs, with elements inputs and send button, and it’s is all.
no <form or something like that.
Searching by form key I found it:
window[Symbol.for('MAR_POST_CLIENT_eppiocemhmnlbhjplcgkofciiegomcon')] = new (class PostClient {
constructor(name, destination) {
this.name = name;
this.destination = destination;
this.serverListeners = {};
this.bgRequestsListeners = {};
this.bgEventsListeners = {};
window.addEventListener('message', (message) => {
const data = message.data;
const isNotForMe = !(data.destination && data.destination === this.name);
const hasNotEventProp = !data.event;
if (isNotForMe || hasNotEventProp) {
return;
}
if (data.event === 'MAR_POST_SERVER__BG_RESPONSE') {
const response = data.args;
if (this.hasBgRequestListener(response.requestId)) {
try {
this.bgRequestsListeners[response.requestId](response.response);
}
catch (e) {
console.log(e);
}
delete this.bgRequestsListeners[response.requestId];
}
}
else if (data.event === 'MAR_POST_SERVER__BG_EVENT') {
const response = data.args;
if (this.hasBgEventListener(response.event)) {
try {
this.bgEventsListeners[data.id](response.payload);
}
catch (e) {
console.log(e);
}
}
}
else if (this.hasServerListener(data.event)) {
try {
this.serverListeners[data.event](data.args);
}
catch (e) {
console.log(e);
}
}
else {
console.log(`event not handled: ${data.event}`);
}
});
}
emitToServer(event, args) {
const id = this.generateUIID();
const message = {
args,
destination: this.destination,
event,
id,
};
window.postMessage(message, location.origin);
return id;
}
emitToBg(bgEventName, args) {
const requestId = this.generateUIID();
const request = { bgEventName, requestId, args };
this.emitToServer('MAR_POST_SERVER__BG_REQUEST', request);
return requestId;
}
hasServerListener(event) {
return !!this.serverListeners[event];
}
hasBgRequestListener(requestId) {
return !!this.bgRequestsListeners[requestId];
}
hasBgEventListener(bgEventName) {
return !!this.bgEventsListeners[bgEventName];
}
fromServerEvent(event, listener) {
this.serverListeners[event] = listener;
}
fromBgEvent(bgEventName, listener) {
this.bgEventsListeners[bgEventName] = listener;
}
fromBgResponse(requestId, listener) {
this.bgRequestsListeners[requestId] = listener;
}
generateUIID() {
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
const r = Math.random() * 16 | 0, v = c === 'x' ? r : (r & 0x3 | 0x8);
return v.toString(16);
});
}
})('MAR_POST_CLIENT_eppiocemhmnlbhjplcgkofciiegomcon', 'MAR_POST_SERVER_eppiocemhmnlbhjplcgkofciiegomcon')
request.types = {
html: 'text/html',
json: 'application/json',
xml: 'application/xml',
urlencoded: 'application/x-www-form-urlencoded',
'form': 'application/x-www-form-urlencoded',
'form-data': 'application/x-www-form-urlencoded'
};
request.serialize = {
'application/x-www-form-urlencoded': serialize,
'application/json': JSON.stringify
};
request.parse = {
'application/x-www-form-urlencoded': parseString,
'application/json': JSON.parse
};
Request.prototype.attach = function(field, file, filename){
this._getFormData().append(field, file, filename || file.name);
return this;
};
Request.prototype._getFormData = function(){
if (!this._formData) {
this._formData = new root.FormData();
}
return this._formData;
};
request.post = function(url, data, fn){
var req = request('POST', url);
if ('function' == typeof data) fn = data, data = null;
if (data) req.send(data);
if (fn) req.end(fn);
return req;
};
/**
* PUT `url` with optional `data` and callback `fn(res)`.
*
* @param {String} url
* @param {Mixed|Function} data or fn
* @param {Function} fn
* @return {Request}
* @api public
*/
request.put = function(url, data, fn){
var req = request('PUT', url);
if ('function' == typeof data) fn = data, data = null;
if (data) req.send(data);
if (fn) req.end(fn);
return req;
};
Can’t paste all it here to avoid junk
Here is the .har session, with load page and after some seconds the submit action
Someone with more knowhow can take a look?
linkremoved, see below
Anyway, i’m sure it’s possible, just as it’s possible to submit the form with a real browser, the question is: how to pass these instructions to the puppeteer.
What options I have? need open my mind
Thanks