-
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
23 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,16 @@ | ||
# Nonstop | ||
Nonstop 是一个 chrome 扩展,用于无感跳转到知乎,微博,简书等无法直接跳转的外链,免去手动跳转的烦恼。 | ||
Nonstop 是一个 chrome 扩展,用于无感跳转到知乎,微博,简书等无法直接跳转的外链,免去手动跳转的烦恼;同时支持拦截知乎登录弹窗。 | ||
|
||
## 使用方法 | ||
1. 通过 Edge 扩展应用商店[安装](https://microsoftedge.microsoft.com/addons/detail/nonstop/ncjhljkmeagghpgekhdkaedcbippeaog?hl=zh-CN) | ||
2. 手动安装,[下载](https://github.com/Yuxiaoy1/nonstop/releases/tag/0.1.0) crx 扩展文件,在chrome内核的浏览器扩展页面手动添加。 | ||
2. 手动安装,[下载](https://github.com/Yuxiaoy1/nonstop/releases/tag/0.2.0) crx 扩展文件,在chrome内核的浏览器扩展页面手动添加。 | ||
|
||
## 测试 | ||
安装扩展后,点击下方三个链接,均可自动跳转: | ||
* 知乎外链:[https://link.zhihu.com/?target=https%3A//yuxiaoy.com/](https://link.zhihu.com/?target=https%3A//yuxiaoy.com/) | ||
* 简书外链:[https://www.jianshu.com/go-wild?ac=2&url=https%3A%2F%2Fyuxiaoy.com%2F](https://www.jianshu.com/go-wild?ac=2&url=https%3A%2F%2Fyuxiaoy.com%2F) | ||
* 微博外链:[http://t.cn/A6b1HjVM?u=1802713725&m=4563585797724502&cu=1802713725](http://t.cn/A6b1HjVM?u=1802713725&m=4563585797724502&cu=1802713725) | ||
* 微博外链:[http://t.cn/A6Gsm8pD](http://t.cn/A6Gsm8pD) | ||
|
||
## 免责声明 | ||
本扩展开发仅用于学习,严禁任何商业用途。 | ||
使用本扩展即代表同意承担由于跳转带来的任意后果,若造成损失与本扩展无关。 | ||
安装本扩展即代表同意承担使用带来的任意后果,若造成损失与本扩展无关。 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,31 @@ | ||
(function() { | ||
'use strict' | ||
let href = window.location.href | ||
if (href.indexOf('www.zhihu.com/question/') != -1) { | ||
// close zhihu login page when not logged | ||
window.onload = () => { | ||
let btn = document.querySelector('.Button.Modal-closeButton.Button--plain') | ||
if (btn) { | ||
btn.click() | ||
} | ||
return | ||
} | ||
} | ||
// redirect for zhihu, weibo sites | ||
let link = document.querySelector('.link') | ||
let url = link ? link.textContent : '' | ||
if (url) { | ||
window.location.href = url | ||
return | ||
} | ||
|
||
// redirect for jianshu site | ||
function getParams(field) { | ||
let href = window.location.href | ||
let getParams = field => { | ||
let urlObject = new URL(href) | ||
let res = urlObject.searchParams.get(field) | ||
return res | ||
} | ||
url = getParams('url') | ||
if (url) { | ||
window.location.href = url | ||
return | ||
} | ||
|
||
// show alert message if there is not valid url | ||
alert('Nonstop提醒:没有合法的外链,请重试或手动跳转') | ||
|
||
// let body = document.body | ||
// let ele = document.createElement('div') | ||
// ele.innerHTML = `<p style="text-align:center;color:red;"> | ||
// 没有合法的外链,请重试或手动跳转</p>` | ||
// body.insertBefore(ele, body.firstChild) | ||
})(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters