This repository has been archived by the owner on Sep 10, 2023. It is now read-only.
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
10 changed files
with
18 additions
and
17 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
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,9 +1,9 @@ | ||
import { IProvider } from "../provider"; | ||
import { matchLinkFromUrl, antiRedirect } from "../utils"; | ||
import { antiRedirect } from "../utils"; | ||
|
||
export class GoogleDocsProvider implements IProvider { | ||
public test = /www\.google\.com\/url\?q=(.*)/; | ||
public resolve(aElement: HTMLAnchorElement) { | ||
antiRedirect(aElement, matchLinkFromUrl(aElement, this.test)); | ||
antiRedirect(aElement, new URL(aElement.href).searchParams.get("q")); | ||
} | ||
} |
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
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,9 +1,9 @@ | ||
import { IProvider } from "../provider"; | ||
import { matchLinkFromUrl, antiRedirect } from "../utils"; | ||
import { antiRedirect } from "../utils"; | ||
|
||
export class JianShuProvider implements IProvider { | ||
public test = /link\.jianshu\.com\/\?t=(.*)/; | ||
public resolve(aElement: HTMLAnchorElement) { | ||
antiRedirect(aElement, matchLinkFromUrl(aElement, this.test)); | ||
antiRedirect(aElement, new URL(aElement.href).searchParams.get("t")); | ||
} | ||
} |
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,9 +1,9 @@ | ||
import { IProvider } from "../provider"; | ||
import { matchLinkFromUrl, antiRedirect } from "../utils"; | ||
import { antiRedirect } from "../utils"; | ||
|
||
export class JuejinProvider implements IProvider { | ||
public test = /link\.juejin\.im\/\?target=(.*)/; | ||
public resolve(aElement: HTMLAnchorElement) { | ||
antiRedirect(aElement, matchLinkFromUrl(aElement, this.test)); | ||
antiRedirect(aElement, new URL(aElement.href).searchParams.get("target")); | ||
} | ||
} |
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,9 +1,9 @@ | ||
import { IProvider } from "../provider"; | ||
import { matchLinkFromUrl, antiRedirect } from "../utils"; | ||
import { antiRedirect } from "../utils"; | ||
|
||
export class PocketProvider implements IProvider { | ||
public test = /getpocket\.com\/redirect\?url=(.*)/; | ||
public resolve(aElement: HTMLAnchorElement) { | ||
antiRedirect(aElement, matchLinkFromUrl(aElement, this.test)); | ||
antiRedirect(aElement, new URL(aElement.href).searchParams.get("url")); | ||
} | ||
} |
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
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,9 +1,9 @@ | ||
import { IProvider } from "../provider"; | ||
import { matchLinkFromUrl, antiRedirect } from "../utils"; | ||
import { antiRedirect } from "../utils"; | ||
|
||
export class ZhihuDailyProvider implements IProvider { | ||
public test = /zhihu\.com\/\?target=(.*)/; | ||
public resolve(aElement: HTMLAnchorElement) { | ||
antiRedirect(aElement, matchLinkFromUrl(aElement, this.test)); | ||
antiRedirect(aElement, new URL(aElement.href).searchParams.get("target")); | ||
} | ||
} |
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,9 +1,9 @@ | ||
import { IProvider } from "../provider"; | ||
import { matchLinkFromUrl, antiRedirect } from "../utils"; | ||
import { antiRedirect } from "../utils"; | ||
|
||
export class ZhihuProvider implements IProvider { | ||
public test = /zhihu\.com\/\?target=(.*)/; | ||
public resolve(aElement: HTMLAnchorElement) { | ||
antiRedirect(aElement, matchLinkFromUrl(aElement, this.test)); | ||
antiRedirect(aElement, new URL(aElement.href).searchParams.get("target")); | ||
} | ||
} |
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,9 +1,9 @@ | ||
import { IProvider } from "../provider"; | ||
import { matchLinkFromUrl, antiRedirect } from "../utils"; | ||
import { antiRedirect } from "../utils"; | ||
|
||
export class ZhihuZhuanlanProvider implements IProvider { | ||
public test = /link\.zhihu\.com\/\?target=(.*)/; | ||
public resolve(aElement: HTMLAnchorElement) { | ||
antiRedirect(aElement, matchLinkFromUrl(aElement, this.test)); | ||
antiRedirect(aElement, new URL(aElement.href).searchParams.get("target")); | ||
} | ||
} |