Skip to content

Commit

Permalink
上传主要文件
Browse files Browse the repository at this point in the history
  • Loading branch information
qwertycxz authored Dec 25, 2021
1 parent 02d2c6e commit fa64237
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 0 deletions.
14 changes: 14 additions & 0 deletions bg.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
chrome.browserAction.onClicked.addListener(function (tab) {
let url = tab.url.split("/");
let hexCharCode = [];
for (let i = 0; i < url[2].length; i++) {
hexCharCode.push((url[2].charCodeAt(i)).toString(16));
}
console.log(url.slice(3));
if (url[0] == "https:") {
chrome.tabs.create({ url: "https://client.vpn.nuist.edu.cn/https/webvpn" + hexCharCode.join("") + "/" + url.slice(3).join("/") });
}
else{
chrome.tabs.create({ url: "https://client.vpn.nuist.edu.cn/http/webvpn" + hexCharCode.join("") + "/" + url.slice(3).join("/") });
}
});
Binary file added icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
24 changes: 24 additions & 0 deletions manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"manifest_version": 2,
"name": "NUIST VPN",
"version": "0.1.0",
"description": "一键通过校园VPN访问网页",
"icons": {
"16": "icon.png",
"48": "icon.png",
"128": "icon.png"
},
"browser_action": {
"default_icon": "icon.png"
},
"background": {
"scripts": [
"bg.js"
]
},
"homepage_url": "https://qwertycxz.top",
"incognito": "split",
"permissions": [
"tabs"
]
}

0 comments on commit fa64237

Please sign in to comment.