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

Commit

Permalink
fix: 适配 Google 的新追踪策略. close #176
Browse files Browse the repository at this point in the history
  • Loading branch information
axetroy committed Feb 26, 2020
1 parent 8e2beb5 commit 5cb1da0
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions src/sites/google.ts
@@ -1,15 +1,10 @@
import { IProvider } from "../provider";
import { antiRedirect } from "../utils";
export class GoogleProvider implements IProvider {
public test = true;
public resolve(aElement: HTMLAnchorElement) {
// 移除多余的事件
if (aElement.getAttribute("onmousedown")) {
aElement.removeAttribute("onmousedown");
}
if (aElement.getAttribute("data-href")) {
const realUrl: string = aElement.getAttribute("data-href");
antiRedirect(aElement, realUrl);
// 移除追踪
if (aElement.getAttribute("ping")) {
aElement.removeAttribute("ping");
}
}
}

0 comments on commit 5cb1da0

Please sign in to comment.