From 1d2ddd57013d4e5aab752e3d11a1e285e83ac663 Mon Sep 17 00:00:00 2001 From: lencx Date: Tue, 3 Dec 2024 00:48:33 +0800 Subject: [PATCH] extensions: add notebooklm, jimeng (noi-ask) --- README.md | 2 +- configs/noi.mode.cn.json | 12 ++++++++++ configs/noi.mode.json | 6 +++++ extensions/README.md | 2 +- extensions/noi-ask/main.js | 41 ++++++++++++++++++++++++++++++++ extensions/noi-ask/manifest.json | 6 +++-- extensions/noi.extensions.json | 2 +- 7 files changed, 66 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 91c49f5..c09c835 100644 --- a/README.md +++ b/README.md @@ -108,7 +108,7 @@ Learn more: [electronjs/doc](https://www.electronjs.org/docs/latest/api/extensio | Name | Version | Description | | --- | --- | --- | -| [@noi/ask](https://github.com/lencx/Noi/tree/main/extensions/noi-ask) | 0.1.12 | The best assistant for batch asking and quick typing of prompts. | +| [@noi/ask](https://github.com/lencx/Noi/tree/main/extensions/noi-ask) | 0.1.13 | The best assistant for batch asking and quick typing of prompts. | | [@noi/ask-custom](https://github.com/lencx/Noi/tree/main/extensions/noi-ask-custom) | 0.1.0 | The best assistant for batch asking and quick typing of prompts. | | [@noi/export-chatgpt](https://github.com/lencx/Noi/tree/main/extensions/noi-export-chatgpt) | 0.1.1 | ChatGPT chat history export, supports PDF, Image, and Markdown formats. | | [@noi/reset](https://github.com/lencx/Noi/tree/main/extensions/noi-reset) | 0.1.3 | Reset certain website styles to enhance compatibility with Noi. | diff --git a/configs/noi.mode.cn.json b/configs/noi.mode.cn.json index fe0d211..555b62b 100644 --- a/configs/noi.mode.cn.json +++ b/configs/noi.mode.cn.json @@ -93,6 +93,12 @@ "text": "Pi", "url": "https://pi.ai/talk" }, + { + "id": "noi:notebooklm", + "parent": "noi@ai", + "text": "NotebookLM", + "url": "https://notebooklm.google.com" + }, { "id": "noi:coze", "parent": "noi@ai", @@ -129,6 +135,12 @@ "text": "豆包", "url": "https://www.doubao.com" }, + { + "id": "noi:jimeng", + "parent": "noi@aiCN", + "text": "即梦 AI", + "url": "https://jimeng.jianying.com" + }, { "id": "noi:chatglm", "parent": "noi@aiCN", diff --git a/configs/noi.mode.json b/configs/noi.mode.json index ece2dc6..28874a3 100644 --- a/configs/noi.mode.json +++ b/configs/noi.mode.json @@ -99,6 +99,12 @@ "text": "Pi", "url": "https://pi.ai/talk" }, + { + "id": "noi:notebooklm", + "parent": "noi@ai", + "text": "NotebookLM", + "url": "https://notebooklm.google.com" + }, { "id": "noi:coze", "parent": "noi@ai", diff --git a/extensions/README.md b/extensions/README.md index bacef2b..a2c8054 100644 --- a/extensions/README.md +++ b/extensions/README.md @@ -9,7 +9,7 @@ Learn more: [electronjs/doc](https://www.electronjs.org/docs/latest/api/extensio | Name | Version | Description | | --- | --- | --- | -| [@noi/ask](https://github.com/lencx/Noi/tree/main/extensions/noi-ask) | 0.1.12 | The best assistant for batch asking and quick typing of prompts. | +| [@noi/ask](https://github.com/lencx/Noi/tree/main/extensions/noi-ask) | 0.1.13 | The best assistant for batch asking and quick typing of prompts. | | [@noi/ask-custom](https://github.com/lencx/Noi/tree/main/extensions/noi-ask-custom) | 0.1.0 | The best assistant for batch asking and quick typing of prompts. | | [@noi/export-chatgpt](https://github.com/lencx/Noi/tree/main/extensions/noi-export-chatgpt) | 0.1.1 | ChatGPT chat history export, supports PDF, Image, and Markdown formats. | | [@noi/reset](https://github.com/lencx/Noi/tree/main/extensions/noi-reset) | 0.1.3 | Reset certain website styles to enhance compatibility with Noi. | diff --git a/extensions/noi-ask/main.js b/extensions/noi-ask/main.js index aaebb2c..f079c2c 100644 --- a/extensions/noi-ask/main.js +++ b/extensions/noi-ask/main.js @@ -341,6 +341,45 @@ class SunoAsk extends NoiAsk { } } +class NotebooklmAsk extends NoiAsk { + static name = 'NotebookLM'; + static url = 'https://notebooklm.google.com'; + + static submit() { + const btn = document.querySelector('form button[type="submit"]'); + if (btn) btn.click(); + } +} + +class JimengAsk extends NoiAsk { + static name = 'Jimeng'; + static url = 'https://jimeng.jianying.com'; + + static sync(message) { + // image generation + const inputElement = document.querySelector('#prompt-text-editor'); + if (inputElement) { + inputElement.focus(); + inputElement.innerHTML = ''; + + const span = document.createElement('span'); + span.textContent = message; + inputElement.appendChild(span); + + const inputEvent = new InputEvent('input', { + bubbles: true, + cancelable: true, + }); + inputElement.dispatchEvent(inputEvent); + } + } + + static submit() { + const btn = document.querySelector('[class*="generateButton"]'); + if (btn) this.autoClick(btn); + } +} + window.NoiAsk = { OpenAIAsk, PoeAsk, @@ -358,4 +397,6 @@ window.NoiAsk = { TongyiAsk, GroqAsk, SunoAsk, + NotebooklmAsk, + JimengAsk, }; diff --git a/extensions/noi-ask/manifest.json b/extensions/noi-ask/manifest.json index 1d1aff2..ddb1a29 100644 --- a/extensions/noi-ask/manifest.json +++ b/extensions/noi-ask/manifest.json @@ -1,7 +1,7 @@ { "manifest_version": 3, "name": "@noi/ask", - "version": "0.1.12", + "version": "0.1.13", "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": [ @@ -22,7 +22,9 @@ "https://chatglm.cn/*", "https://www.doubao.com/*", "https://tongyi.aliyun.com/qianwen/*", - "https://suno.com/*" + "https://suno.com/*", + "https://notebooklm.google.com/*", + "https://jimeng.jianying.com/*" ], "js": ["main.js"], "run_at": "document_end", diff --git a/extensions/noi.extensions.json b/extensions/noi.extensions.json index 16032c1..c1931c1 100644 --- a/extensions/noi.extensions.json +++ b/extensions/noi.extensions.json @@ -5,7 +5,7 @@ { "name": "@noi/ask", "description": "The best assistant for batch asking and quick typing of prompts.", - "version": "0.1.12", + "version": "0.1.13", "url": "https://github.com/lencx/Noi/tree/main/extensions/noi-ask", "dirname": "noi-ask", "disabled": false