1 Star 3 Fork 3

LuckyBlank / chat-helper-script

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

chat-helper-script

引言:

一款油猴JS脚本:基于openai相关的接口,实现任意网页上直接和ai对话,无需输入key。

功能展示:

start-statuschatting-status

运行须知:

1、项目依赖安装

npm install

2、项目运行

npm run dev

3、项目编译

npm run build

开发须知:

项目基于脚手架(create-tampermonkey)开发:https://github.com/curly210102/create-tampermonkey

请先全局安装:

npm i create-tampermonkey -g

创建油猴脚本项目

npm init tampermonkey my-userscript

前端技术:

  • jquery-3.6.0.min.js
  • sweetalert.min.js
  • layer.js
  • vue.min.js
  • element-ui/lib/index.js
  • typeit.min.js
  • crypto-js.min.js
  • axios.min.js
  • marked.min.js
  • markdown-it.min.js
  • showdown.min.js
  • highlight.min.js

具体各个脚本的功能请自行百度。整体的js引入在src/meta.json文件@require节点数组有申明。

注意事项:

1、运行项目:

npm run dev

2、先在src/meta.json中定义相关的网址匹配规则以及js脚本依赖,修改后会直接显示在dist/main.dev.user.js文件中

3、在src/main.js中开发,相关的修改也会对应修改到dist/main.dev.user.js文件中,可以参考该文件中样式引入的方式。也可以自行采用以下几种方式:

  • 在src/main.js中加入

    $("head").append($('<link rel="stylesheet" href="https://www.luckyblank.cn/outer/layer-v3.5.1/layer/theme/default/layer.css">'));
  • meta.json中增加(样式名+空格+样式地址)

     "@resource":[
        "laycss https://www.luckyblank.cn/outer/layer-v3.5.1/layer/theme/default/layer.css"
      ]

​ 然后通过GM_getResourceText函数引入样式(需要在src/meta.json中@grant节点下增加GM_getResourceText)

    // 导入样式
    GM_addStyle(GM_getResourceText("layxcss"));
  • 少量的样式/用户自定义样式可以直接用GM_addStyle
GM_addStyle(`
    .ti-cursor:after {
      display: none;
      content: '|';
      bottom: .05em;
      right: -.25em;
      position: absolute;
      line-height: normal;
      font-size: inherit;
      -webkit-animation: blink 1s infinite;
      animation: blink 1s infinite
    }
`);

温馨提示:

建议使用vscode开发,安装tampermonkey-snippets插件。

image-20230325195921513

具体API可参考文档(油猴知识语法.md)

BUG反馈:

邮箱地址:1724451509@qq.com

MIT License Copyright (c) 2023 LuckyBlank Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

tampermonkey插件的js脚本之ChatGPT助手 展开 收起
JavaScript 等 2 种语言
MIT
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
JavaScript
1
https://gitee.com/luckyblank/chat-helper-script.git
git@gitee.com:luckyblank/chat-helper-script.git
luckyblank
chat-helper-script
chat-helper-script
master

搜索帮助

53164aa7 5694891 3bd8fe86 5694891