├── fast_github
├── src
│ ├── vite-env.d.ts
│ ├── assets
│ │ └── icons
│ │ │ ├── icon-34.png
│ │ │ └── icon-128.png
│ ├── content
│ │ ├── style.css
│ │ └── index.ts
│ ├── popup
│ │ ├── Popup.css
│ │ ├── Popup.tsx
│ │ ├── index.tsx
│ │ └── index.html
│ ├── options
│ │ ├── style.css
│ │ ├── index.tsx
│ │ ├── index.html
│ │ └── Options.tsx
│ ├── test
│ │ ├── download.svg
│ │ └── test.ts
│ ├── manifest.json
│ ├── background
│ │ └── index.ts
│ ├── types
│ │ └── index.ts
│ └── tools
│ │ └── index.ts
├── postcss.config.cjs
├── tailwind.config.cjs
├── .gitignore
├── index.html
├── tsconfig.json
├── vite.config.ts
└── package.json
├── zip
├── v1.5.10.zip
├── v1.5.2.zip
├── v1.5.3.zip
├── v1.5.4.zip
├── v1.5.5.zip
├── v1.5.6.zip
├── v1.5.7.zip
├── v1.5.8.zip
└── v1.5.9.zip
├── README.md
├── README_EN.md
├── .gitignore
└── LICENSE
/fast_github/src/vite-env.d.ts:
--------------------------------------------------------------------------------
1 | ///
43 |
44 |
45 |
46 | |
47 |
54 |
55 |
--------------------------------------------------------------------------------
/fast_github/src/background/index.ts:
--------------------------------------------------------------------------------
1 | import { getLocalItem, translateByTencent } from "../tools";
2 | import { ResponseData, ResponseError, RuntimeSendMessageType } from "../types";
3 |
4 | chrome.runtime.onInstalled.addListener((details) => {
5 | const { reason } = details;
6 |
7 | if (reason === "install") {
8 | chrome.runtime.openOptionsPage();
9 | return;
10 | }
11 |
12 | getLocalItem().then((configs) => {
13 | if (!configs.importOldList) {
14 | if (reason === "update") {
15 | chrome.runtime.openOptionsPage();
16 | }
17 | }
18 | });
19 | });
20 |
21 | type SendResponseMessageType = [ResponseData, ResponseError];
22 |
23 | chrome.runtime.onMessage.addListener((message, _, sendResponse) => {
24 | const data = message as RuntimeSendMessageType;
25 | const content = data.content;
26 |
27 | const sendResponseMessage = (dataObject: SendResponseMessageType) => {
28 | console.log("content: ", content);
29 | const [data, error] = dataObject;
30 | let sendMessageObject: RuntimeSendMessageType = { content: "" };
31 |
32 | if (data) {
33 | sendMessageObject.content = data;
34 | }
35 |
36 | if (error) {
37 | sendMessageObject.content = error;
38 | }
39 |
40 | sendResponse(sendMessageObject);
41 | };
42 |
43 | translateByTencent(content).then((responseData) => {
44 | sendResponseMessage(responseData);
45 | });
46 | return true;
47 | });
48 |
49 | // (async () => {
50 | // translateByTencent("hello").then((responseData) => {
51 | // console.log("data: ", responseData);
52 | // });
53 | // })();
54 |
55 | // chrome.webNavigation.onHistoryStateUpdated.addListener(
56 | // (details) => {
57 | // console.log(`onHistoryStateUpdated: ${details.url}`);
58 |
59 | // if (details.url.includes("github.com")) {
60 | // const message: MessageType = {
61 | // status: "complete",
62 | // url: details.url,
63 | // };
64 |
65 | // chrome.tabs.sendMessage(details.tabId, message);
66 | // }
67 |
68 | // console.log(`Transition type: ${details.transitionType}`);
69 | // console.log(`Transition qualifiers: ${details.transitionQualifiers}`);
70 | // },
71 | // {
72 | // url: [{ hostContains: "github.com" }],
73 | // }
74 | // );
75 |
76 | // chrome.tabs.onUpdated.addListener(function (tabId, changeInfo, tab) {
77 | // if (tab.status === "complete" && tab.url && tab.url.includes("github.com")) {
78 | // const message: MessageType = {
79 | // status: "complete",
80 | // url: tab.url,
81 | // };
82 | // chrome.tabs.sendMessage(tabId, message);
83 | // }
84 | // });
85 |
--------------------------------------------------------------------------------
/README_EN.md:
--------------------------------------------------------------------------------
1 | # Fast-GitHub
2 |
3 | 
4 | 
5 |
6 |
7 |
8 | # INTRODUCTION
9 |
10 | Github download speeds are generally slow in Asia, and with this plugin the download speeds will be insane!
11 |
12 | [](https://badges.toozhao.com/badges/01EH1R0YMQANV1ACQXTEBK7JCN/green.svg "Get your own page views count badge on badges.toozhao.com")
13 |
14 | # Support
15 | Power By Cloudflare
16 |
17 | # Download
18 |
19 |
23 |
24 |
25 |
26 | |
27 |
28 |
29 | |
30 |
31 |
32 |
33 |
34 | |
35 |
36 |
37 | |
38 |
221 | ${urlInfo.host}通道 222 |
223 |