chore: extensions

This commit is contained in:
lencx 2024-01-31 17:36:52 +08:00
parent 22a87c0b3d
commit a0cd0b4de4
13 changed files with 117 additions and 25 deletions

View File

@ -1,5 +1,5 @@
<h2 align="center">
<img width="160" src="./assets/noi-logo.png" />
<img width="160" src="./website/static/readme/noi.png" />
<p>AI + Tools + Plugins + Community</p>
</h2>
@ -29,12 +29,8 @@
|Preview|Preview|
|---|---|
|![theme-dark](./assets/noi-theme-dark.png)|![theme-light](./assets/noi-theme-light.png)|
|![batch-ask](./assets/noi-batch-ask.png)|![settings-prompts](./assets/noi-settings-prompts.png)|
---
[![Star History Chart](https://api.star-history.com/svg?repos=lencx/Noi&type=Timeline)](https://star-history.com/#lencx/Noi&Timeline)
|![theme-dark](./website/static/readme/noi-theme-dark.png)|![theme-light](./website/static/readme/noi-theme-light.png)|
|![batch-ask](./website/static/readme/noi-batch-ask.png)|![settings-prompts](./website/static/readme/noi-settings-prompts.png)|
## FAQ
@ -46,7 +42,7 @@ If you encounter the error message "Noi" is damaged and can't be opened. You sho
xattr -cr /Applications/Noi.app
```
![mac-install-error](assets/mac-install-error.png)
![mac-install-error](./website/static/readme/mac-install-error.png)
## TODO
@ -58,4 +54,4 @@ xattr -cr /Applications/Noi.app
国内用户如果遇到使用问题或者想交流 Noi可以关注公众号「**浮之静**」,发送 “**noi**” 进群参与讨论。如果 Noi 应用对你有帮助可以分享给更多人,或者微信扫码打赏。
<img height="200" src="https://user-images.githubusercontent.com/16164244/207228025-117b5f77-c5d2-48c2-a070-774b7a1596f2.png"> <img height="200" src="https://user-images.githubusercontent.com/16164244/207228300-ea5c4688-c916-4c55-a8c3-7f862888f351.png">
<img height="240" src="https://user-images.githubusercontent.com/16164244/207228025-117b5f77-c5d2-48c2-a070-774b7a1596f2.png"> <img height="240" src="https://user-images.githubusercontent.com/16164244/207228300-ea5c4688-c916-4c55-a8c3-7f862888f351.png">

Binary file not shown.

Before

Width:  |  Height:  |  Size: 168 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 59 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 960 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 908 KiB

View File

@ -1,6 +1,6 @@
{
"name": "Noi Mode",
"version": "0.1.3",
"version": "0.1.4",
"sync": "https://github.com/lencx/noi/blob/main/configs/noi.mode.json",
"modes": [
{
@ -21,6 +21,12 @@
"dir": true,
"text": "Community"
},
{
"id": "noi@design",
"parent": 0,
"dir": true,
"text": "Design"
},
{
"id": "noi:chatgpt",
"parent": "noi@ai",
@ -69,6 +75,18 @@
"text": "Pi",
"url": "https://pi.ai/talk"
},
{
"id": "noi:coze",
"parent": "noi@ai",
"text": "Coze",
"url": "https://www.coze.com/home"
},
{
"id": "noi:you",
"parent": "noi@ai",
"text": "YOU",
"url": "https://you.com"
},
{
"id": "noi:github",
"parent": "noi@dev",
@ -104,6 +122,24 @@
"parent": "noi@community",
"text": "Discord",
"url": "https://discord.com"
},
{
"id": "noi:hackernews",
"parent": "noi@community",
"text": "Hacker News",
"url": "https://news.ycombinator.com"
},
{
"id": "noi:figma",
"parent": "noi@design",
"text": "Figma",
"url": "https://www.figma.com"
},
{
"id": "noi:dribbble",
"parent": "noi@design",
"text": "Dribbble",
"url": "https://dribbble.com"
}
]
}
}

View File

@ -7,7 +7,7 @@
class NoiAsk {
static sync(message) {
const inputElement = document.querySelector(`textarea`);
const inputElement = document.querySelector('textarea');
if (inputElement) {
const nativeTextareaSetter = Object.getOwnPropertyDescriptor(window.HTMLTextAreaElement.prototype, 'value').set;
nativeTextareaSetter.call(inputElement, message);
@ -41,7 +41,7 @@ class OpenAIAsk extends NoiAsk {
static url = 'https://chat.openai.com';
static submit() {
const btn = document.querySelector(`button[data-testid="send-button"]`);
const btn = document.querySelector('button[data-testid="send-button"]');
if (btn) this.autoClick(btn);
}
}
@ -51,7 +51,7 @@ class PoeAsk extends NoiAsk {
static url = 'https://poe.com';
static submit() {
const btn = document.querySelectorAll(`button[class*="ChatMessageSendButton_sendButton"]`)[0];
const btn = document.querySelectorAll('button[class*="ChatMessageSendButton_sendButton"]')[0];
if (btn) this.autoClick(btn);
}
}
@ -61,7 +61,7 @@ class ClaudeAsk extends NoiAsk {
static url = 'https://claude.ai';
static sync(message) {
const inputElement = document.querySelector(`div.ProseMirror`);
const inputElement = document.querySelector('div.ProseMirror');
if (inputElement) {
inputElement.focus();
inputElement.innerHTML = '';
@ -71,12 +71,12 @@ class ClaudeAsk extends NoiAsk {
static submit() {
// subsequent screens use this
let btn = document.querySelector(`button[aria-label*="Send Message"]`);
let btn = document.querySelector('button[aria-label*="Send Message"]');
if (!btn) { // new chats use this
btn = document.querySelector(`button:has(div svg)`);
btn = document.querySelector('button:has(div svg)');
}
if (!btn) { // last ditch attempt
btn = document.querySelector(`button:has(svg)`);
btn = document.querySelector('button:has(svg)');
}
if (btn) this.autoClick(btn);
}
@ -87,7 +87,7 @@ class BardAsk extends NoiAsk {
static url = 'https://bard.google.com';
static sync(message) {
const inputElement = document.querySelector(`.ql-editor.textarea`);
const inputElement = document.querySelector('.ql-editor.textarea');
if (inputElement) {
const inputEvent = new Event('input', { bubbles: true });
inputElement.value = message;
@ -98,7 +98,7 @@ class BardAsk extends NoiAsk {
}
static submit() {
const btn = document.querySelector(`button[aria-label*="Send message"]`);
const btn = document.querySelector('button[aria-label*="Send message"]');
if (btn) {
btn.setAttribute('aria-disabled', 'false'); // doesn't work alone
btn.focus();
@ -112,7 +112,7 @@ class HuggingChatAsk extends NoiAsk {
static url = 'https://huggingface.co/chat';
static sync(message) {
var inputElement = document.querySelector(`textarea[placeholder*="Ask anything"]`);
var inputElement = document.querySelector('textarea[placeholder*="Ask anything"]');
if (inputElement) {
const inputEvent = new Event('input', { bubbles: true });
inputElement.value = message;
@ -121,7 +121,7 @@ class HuggingChatAsk extends NoiAsk {
}
static submit() {
var btn = document.querySelector(`form.relative > div > button[type="submit"]`);
var btn = document.querySelector('form.relative > div > button[type="submit"]');
if (btn) this.autoClick(btn);
}
}
@ -131,7 +131,7 @@ class PerplexityAsk extends NoiAsk {
static url = 'https://www.perplexity.ai';
static submit() {
const btns = Array.from(document.querySelectorAll(`button.bg-super`));
const btns = Array.from(document.querySelectorAll('button.bg-super'));
if (btns[0]) {
const btnsWithSvgPath = btns.filter(button => button.querySelector('svg path'));
const btn = btnsWithSvgPath[btnsWithSvgPath.length - 1];
@ -197,6 +197,32 @@ class PiAsk extends NoiAsk {
}
}
class CozeAsk extends NoiAsk {
static name = 'Coze';
static url = 'https://www.coze.com/home';
static submit() {
const inputElement = document.querySelector('textarea');
if (inputElement) {
const nextElement = inputElement.nextElementSibling;
if (nextElement) {
const btn = nextElement.querySelector('button');
if (btn) btn.click();
}
}
}
}
class YouAsk extends NoiAsk {
static name = 'YouAsk';
static url = 'https://you.com';
static submit() {
const btn = document.querySelector('button[data-eventactionname="click_send"]');
if (btn) btn.click();
}
}
window.NoiAsk = {
OpenAIAsk,
PoeAsk,
@ -206,4 +232,6 @@ window.NoiAsk = {
PerplexityAsk,
CopilotAsk,
PiAsk,
CozeAsk,
YouAsk,
};

View File

@ -1,8 +1,9 @@
{
"manifest_version": 3,
"name": "@noi/ask",
"version": "0.1.0",
"version": "0.1.1",
"homepage": "https://github.com/lencx/Noi/tree/main/extensions/noi-ask",
"description": "The best assistant for batch asking and quick typing of prompts.",
"content_scripts": [
{
"matches": [
@ -13,7 +14,9 @@
"https://huggingface.co/chat/*",
"https://www.perplexity.ai/*",
"https://copilot.microsoft.com/*",
"https://pi.ai/talk/*"
"https://pi.ai/talk/*",
"https://www.coze.com/home/*",
"https://you.com/*"
],
"js": ["main.js"],
"run_at": "document_end",

View File

@ -3,6 +3,7 @@
"name": "@noi/export-chatgpt",
"version": "0.1.0",
"homepage": "https://github.com/lencx/Noi/tree/main/extensions/noi-export-chatgpt",
"description": "ChatGPT chat history export, supports PDF, Image, and Markdown formats.",
"content_scripts": [
{
"matches": ["https://*.openai.com/*"],

View File

@ -3,6 +3,7 @@
"name": "@noi/reset",
"version": "0.1.0",
"homepage": "https://github.com/lencx/Noi/tree/main/extensions/noi-reset",
"description": "Reset certain website styles to enhance compatibility with Noi.",
"content_scripts": [
{
"matches": [

View File

@ -0,0 +1,27 @@
{
"name": "Noi Extensions",
"homepage": "https://github.com/lencx/Noi/blob/main/extensions/noi.extensions.json",
"extensions": [
{
"name": "@noi/ask",
"description": "The best assistant for batch asking and quick typing of prompts.",
"version": "0.1.1",
"url": "https://github.com/lencx/Noi/tree/main/extensions/noi-ask",
"disabled": false
},
{
"name": "@noi/export-chatgpt",
"description": "ChatGPT chat history export, supports PDF, Image, and Markdown formats.",
"version": "0.1.0",
"url": "https://github.com/lencx/Noi/tree/main/extensions/noi-export-chatgpt",
"disabled": false
},
{
"name": "@noi/reset",
"description": "Reset certain website styles to enhance compatibility with Noi.",
"version": "0.1.0",
"url": "https://github.com/lencx/Noi/tree/main/extensions/noi-reset",
"disabled": false
}
]
}