donobu
Version:
Create browser automations with an LLM agent and replay them as Playwright scripts.
21 lines (20 loc) • 710 B
JavaScript
(() => {
const donobuMagicString = 'DONOBU_DIALOG_RESPONSE';
const originalConsoleLog = console.log;
const originalPrompt = prompt;
const originalConfirm = confirm;
// Overwrite the global prompt function.
prompt = (message, defaultValue) => {
const response = originalPrompt(message, defaultValue);
originalConsoleLog(donobuMagicString, response);
originalConsoleLog('prompt response: ' + response);
return response;
};
// Overwrite the global confirm function.
confirm = (message) => {
const response = originalConfirm(message);
originalConsoleLog(donobuMagicString, response);
originalConsoleLog('prompt response: ' + response);
return response;
};
})();