{"id":15357843,"url":"https://github.com/mefengl/bard-utils","last_synced_at":"2026-01-25T08:33:17.503Z","repository":{"id":235064019,"uuid":"619412196","full_name":"mefengl/bard-utils","owner":"mefengl","description":"getSubmitButton, getTextarea, getRegenerateButton, getNewChatButton...","archived":false,"fork":false,"pushed_at":"2023-04-06T16:37:33.000Z","size":5,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-04T01:20:07.343Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mefengl.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2023-03-27T04:58:53.000Z","updated_at":"2023-03-27T06:34:25.000Z","dependencies_parsed_at":"2024-04-22T05:20:26.432Z","dependency_job_id":null,"html_url":"https://github.com/mefengl/bard-utils","commit_stats":null,"previous_names":["mefengl/bard-utils"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mefengl/bard-utils","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mefengl%2Fbard-utils","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mefengl%2Fbard-utils/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mefengl%2Fbard-utils/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mefengl%2Fbard-utils/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mefengl","download_url":"https://codeload.github.com/mefengl/bard-utils/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mefengl%2Fbard-utils/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28749387,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-25T08:31:04.260Z","status":"ssl_error","status_checked_at":"2026-01-25T08:30:28.859Z","response_time":113,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-01T12:39:15.933Z","updated_at":"2026-01-25T08:33:17.489Z","avatar_url":"https://github.com/mefengl.png","language":null,"readme":"# Bard Utils\n\n[![AI Friendly](https://img.shields.io/badge/AI-Friendly-pink?style=for-the-badge)](https://github.com/mefengl/made-by-ai)\n[![AI Assisted Maybe](https://img.shields.io/badge/AI%20Assisted-Maybe-yellow?style=for-the-badge)](https://github.com/mefengl/made-by-ai)\n[![Commit Messages by AI](https://img.shields.io/badge/Commit%20Messages%20by-AI-green?style=for-the-badge)](https://github.com/mefengl/made-by-ai)\n\n## Notice\n\nthis repo has been put into `chatkit`, you can find more about it in [chat-play/packages/chatkit/bard](https://github.com/mefengl/chat-play).\n\n## Description\n\ngetSubmitButton, getTextarea, getRegenerateButton, getNewChatButton...\n\n## Usage\n\njust copy and paste the code below\n\n```js\nfunction getInputArea() {\n  return document.querySelector(\".input-area\");\n};\n```\n\n```js\nfunction getSubmitButton() {\n  return document.querySelector('button[aria-label=\"Send message\"]');\n};\n```\n\n```js\nfunction getTextarea() {\n  const inputArea = getInputArea();\n  return inputArea.querySelector('textarea');\n};\n```\n\n```js\nfunction getRegenerateButton() {\n  return document.querySelector('button[aria-label=\"Retry\"]');\n};\n```\n\n```js\nfunction getNewChatButton() {\n  const navButtons = document.querySelector('mat-nav-list').children;\n  return Array.from(navButtons).find(b =\u003e b.textContent.trim().toLowerCase().includes('reset chat'));\n};\n```\n\n```js\nfunction getLastResponse() {\n  const responseElements = document.querySelectorAll('.model-response-text');\n  const lastResponse = responseElements[responseElements.length - 1];\n  return lastResponse;\n};\n```\n\n```js\nfunction getLastResponseText() {\n  const lastPrompt = this.getLastPrompt();\n  if (!lastPrompt) return \"\";\n  const lastPromptText = lastPrompt.textContent;\n  return lastPromptText;\n};\n```\n\n```js\nfunction getLastPrompt() {\n  const promptElements = document.querySelectorAll('.query-text');\n  const lastPrompt = promptElements[promptElements.length - 1];\n  return lastPrompt;\n};\n```\n\n```js\nfunction getLastPromptText() {\n  const lastPrompt = getLastPrompt();\n  return lastPrompt.textContent;\n};\n```\n\n```js\nfunction send(text) {\n  const textarea = getTextarea();\n  textarea.value = text;\n  textarea.dispatchEvent(new Event('input'));\n  getSubmitButton().click();\n};\n```\n\n## Contributing\n\nContributions, issues and feature requests are welcome!\n\n## License\n\nThis project is licensed under the terms of the [MIT license](/LICENSE).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmefengl%2Fbard-utils","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmefengl%2Fbard-utils","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmefengl%2Fbard-utils/lists"}