krysl / WebSwitcher: 在百度、谷歌之间切换搜索结果

Published:

Version: 0.5.1+c5f0d35 updated

Summary: 为百度、谷歌添加按钮, 点击跳转到对方页面搜索同样内容

Homepage: https://github.com/Krysl/WebSwitcher

Support: https://github.com/Krysl/WebSwitcher

License: MIT

WebSwitcher: 在百度、谷歌之间切换搜索结果

⭐功能:

  1. 在百度、谷歌搜索时,可点击搜索栏边上的相应按钮切换到对应网站搜索同一结果;
  2. 可使用快捷键 Alt + SCtrl + Shift + Enter 触发切换搜索;

WebSwitcher v0.3.0

⚡更新:

2021.08.28

  1. 修复百度的阴间操作导致插件失效的问题。
  2. 修复百度/谷歌网页更新导致无法跳转的问题。

2021.02.26

  1. 添加配置界面;

WebSwitcher.v0.5.0

2021.02.09

  1. 优化启动速度;

2021.02.08

  1. 上一版本Google页面的百度图标太小不易点击,所以扩大大小;
  2. 修复Google页面滚动后百度图标错位;

2021.02.07

  1. 快捷键 Alt + S / Ctrl + Shift + Enter 触发切换搜索

🐛问题反馈 及 ✨功能请求

欢迎到GithubOpenUserJSGreasy Fork上提出反馈意见。


本脚本使用Vue v3TypeScript、TSX编写,使用Webpack v5来打包.

编译开发可参考以下文档:
(基于Trim21
webpack-userscript-template
工程模版开发
)


This is a project help you build userscript with webpack

Just use this git repo as a template.

中文说明

dev

  1. Allow Tampermonkey's access to local file URIs tampermonkey/faq
  2. install deps with npm i or npm ci.
  3. npm run dev to start your development.
  4. open webpack-userscript-template/dist/index.dev.user.js in your Chrome and install it with your userscript manager.

this userscript's meta contains // @require file://path/to/dist/index.prod.user.js,
it will run the code in index.prod.user.js,
which take src/js/index.js as entry point.

every times you edit your metadata, you'll have to install it again,
because Tampermonkey don't read it from dist every times.

  1. edit src/js/index.js with es6, you can even import css or less files. You can use scss if you like.
  2. go wo https://www.example.com/ and open console, you'll see it's working.

livereload is default enabled, use this chrome extension

TypeScript

use typescript as normal, see example

dependencies

There are two ways to using a package on npm.

UserScript way

like original UserScript way, you will need to add them to your user script metadata's require section , and exclude them in config/webpack.config.base.js

Webpack way

just install a package and import it in your js file. webpack will pack them with in your final production js file.

build

npm run build

dist/index.prod.user.js is the finally script. you can manually copy it to greaskfork for deploy.

auto deploy

github actions will deploy production userscript to gh-pages branch.

example

deployed

You can auto use greskfork's auto update function.

Rating: 0