-
Notifications
You must be signed in to change notification settings - Fork 327
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WIP] adding scite assistant #213
base: main
Are you sure you want to change the base?
Conversation
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 | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ignore for now
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(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
to change and verify
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; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
to change and verify
per #202
i stopped because it seemed slow/unusable. please pick this up again if it improves