Skip to content

Conversation

@swyxio
Copy link
Contributor

@swyxio swyxio commented Aug 29, 2023

per #202

i stopped because it seemed slow/unusable. please pick this up again if it improves

Comment on lines +30 to +48
static codeForInputElement = `var inputElement = document.querySelector('textarea[placeholder*="Ask"]');`;
static codeForSetInputElementValue(prompt) {
return `
var nativeTextAreaValueSetter = Object.getOwnPropertyDescriptor(window.HTMLTextAreaElement.prototype, "value").set;
nativeTextAreaValueSetter.call(inputElement, \`${prompt}\`);
var event = new Event('input', { bubbles: true});
inputElement.dispatchEvent(event);
`;
}
static codeForClickingSubmit = `
var buttons = Array.from(document.querySelectorAll('button.ant-btn-primary'));
var buttonsWithSvgPath = buttons.filter(button => button.querySelector('svg path'));

var button = buttonsWithSvgPath[buttonsWithSvgPath.length - 1];

button.click();
`;
static codeForExtractingResponse = `[...document.querySelectorAll('.ant-space.ant-space-horizontal .ant-typography pre')].slice(-1)[0]`; // dont append semicolon, we will append innerhtml etc

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ignore for now

Comment on lines +52 to +57
var buttons = Array.from(document.querySelectorAll('button.ant-btn-primary'));
var buttonsWithSvgPath = buttons.filter(button => button.querySelector('svg path'));

var button = buttonsWithSvgPath[buttonsWithSvgPath.length - 1];

button.click();
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

to change and verify

Comment on lines +88 to +90
div.ant-col.ant-col-24.css-11zb6yo.ant-col-sm-24.ant-col-md-7.ant-col-xl-5.ant-col-xxl-4.css-lqewvt {
display: none;
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

to change and verify

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants