Skip to content
This repository has been archived by the owner on Sep 10, 2023. It is now read-only.

Commit

Permalink
feat: 支持 steam. close #48
Browse files Browse the repository at this point in the history
  • Loading branch information
axetroy committed Mar 23, 2020
1 parent 3d8c78b commit 0256a46
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Expand Up @@ -43,6 +43,7 @@
- [x] Google Play
- [x] Google Gmail
- [x] Google Youtube
- [x] Steam
- [x] 360 搜索
- [x] 新浪微博
- [x] Twitter
Expand Down
7 changes: 7 additions & 0 deletions index.ts
Expand Up @@ -26,6 +26,7 @@ import { DouBanProvider } from "./src/sites/douban";
import { PocketProvider } from "./src/sites/pocket";
import { DogeDogeProvider } from "./src/sites/dogedoge";
import { RuyoProvider } from "./src/sites/ruyo";
import { SteamProvider } from "./src/sites/steam";

const app = new App();
const isDebug: boolean = process.env.NODE_ENV !== "production";
Expand Down Expand Up @@ -176,6 +177,12 @@ app
name: "Ruyo",
test: /51\.ruyo\.net/,
provider: RuyoProvider
},
{
// 测试地址: https://steamcommunity.com/sharedfiles/filedetails/?id=1311535531
name: "Steam",
test: /steamcommunity\.com/,
provider: SteamProvider
}
])
.bootstrap();
9 changes: 9 additions & 0 deletions src/sites/steam.ts
@@ -0,0 +1,9 @@
import { IProvider } from '../provider'
import { antiRedirect } from '../utils'

export class SteamProvider implements IProvider {
public test = /steamcommunity\.com\/linkfilter\/\?url=(.*)/
public resolve(aElement: HTMLAnchorElement) {
antiRedirect(aElement, new URL(aElement.href).searchParams.get('url'))
}
}
1 change: 1 addition & 0 deletions webpack.config.ts
Expand Up @@ -74,6 +74,7 @@ const webpackConfig: webpack.Configuration = {
// @include *getpocket.com*
// @include *www.dogedoge.com*
// @include *51.ruyo.net*
// @include *steamcommunity.com*
// @connect *
// @compatible chrome 完美运行
// @compatible firefox 完美运行
Expand Down

0 comments on commit 0256a46

Please sign in to comment.