Skip to content
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

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft

[WIP] adding scite assistant #213

wants to merge 2 commits into from

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.

1 participant