Skip to content

Commit

Permalink
clean up some legacy files
Browse files Browse the repository at this point in the history
  • Loading branch information
zhuzhuor committed Jun 29, 2022
1 parent f80c839 commit 8a1bfda
Show file tree
Hide file tree
Showing 17 changed files with 28 additions and 471 deletions.
16 changes: 16 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"env": {
"browser": true,
"webextensions": true,
"node": true,
"es2021": true
},
"extends": [
"eslint:recommended"
],
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "module"
},
"rules": {}
}
7 changes: 0 additions & 7 deletions .travis.yml

This file was deleted.

51 changes: 0 additions & 51 deletions CONTRIBUTING.md

This file was deleted.

8 changes: 2 additions & 6 deletions chrome/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

/*jslint browser: true */
/*global chrome: false, get_storage: false, set_storage: false, new_random_ip: false */
/*global setup_redirect: false, setup_header: false, setup_proxy: false, setup_timezone: false, setup_extra_header: false */
/*global clear_redirect: false, clear_header: false, clear_proxy: false, clear_timezone: false */
/*global setup_redirect: false, setup_header: false, setup_proxy: false */
/*global clear_redirect: false, clear_header: false, clear_proxy: false */
/*global ga_report_event: false, ga_report_ratio: false, ga_report_error: false */
"use strict";

Expand Down Expand Up @@ -276,6 +274,4 @@ document.addEventListener("DOMContentLoaded", function() {
ga_report_ratio('Init Mode', current_mode_name);
ga_report_ratio('Version', unblock_youku.version);
});

// setup_extra_redirector();
});
9 changes: 4 additions & 5 deletions chrome/donation.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,18 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

/*global chrome: false, localStorage: false */
"use strict";
'use strict';


function create_donation_tab() {
var donation_url = chrome.i18n.getMessage('donation_url');
const donation_url = chrome.i18n.getMessage('donation_url');
chrome.tabs.create({
url: donation_url
url: donation_url,
});
}

chrome.runtime.onInstalled.addListener(function(details) {
if (details.reason === 'install') {
create_donation_tab();
}
});
});
2 changes: 1 addition & 1 deletion chrome/header.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

/*global chrome: false, unblock_youku: false */
/*global unblock_youku: false */
/*global ga_report_error: false */
"use strict";

Expand Down
38 changes: 0 additions & 38 deletions chrome/redirect.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,23 +36,13 @@ function http_redirector(details) {
return {redirectUrl: redirect_url};
}

// if (details.url.slice(0, 18) === 'http://v.youku.com') {
// // remove random number to improve cache hitrate
// details.url = details.url.replace(/&ran=[0-9]*|ran=[0-9]*&/gi, '');
// } else if (details.url.slice(0, 23) === 'http://hot.vrs.sohu.com') {
// details.url = details.url.replace(/&t=0\.[0-9]*|t=0\.[0-9]*&/gi, '');
// } else if (details.url.slice(0, 23) === 'http://hot.vrs.letv.com') {
// details.url = details.url.replace(/&tn=0\.[0-9]*|tn=0\.[0-9]*&/gi, '');
// }

var backend_server;
if (typeof localStorage.custom_redirect_server === 'undefined') {
backend_server = unblock_youku.actual_redirect_server;
} else {
backend_server = localStorage.custom_redirect_server;
}

//var redirect_url = 'http://127.0.0.1.xip.io:8080/?url=' + urlsafe_b64encode(details.url);
if (string_starts_with(details.url, 'http://')) {
redirect_url = 'http://' + backend_server + '/http/' + details.url.substring('http://'.length);
} else if (string_starts_with(details.url, 'https://')) {
Expand Down Expand Up @@ -138,31 +128,3 @@ function clear_redirect() {
ga_report_error('Unexpected Error', err_msg);
}
}


// extra sites to redirect
/*
function extra_http_redirector(details) {
var redirect_url = 'http://117.27.241.117/' + details.url.replace(/^.*\/\/[^\/]+/, '');
console.log('redirect url: ' + redirect_url);
return {redirectUrl: redirect_url};
}
function setup_extra_redirector() {
if (!chrome.webRequest.onBeforeRequest.hasListener(extra_http_redirector)) {
chrome.webRequest.onBeforeRequest.addListener(
extra_http_redirector,
{
urls: ['http://*.music.126.net/*']
},
["blocking"]
);
console.log('extra_http_redirector is set');
} else {
var err_msg = 'extra_http_redirector is already there!';
console.error(err_msg);
ga_report_error('Unexpected Error', err_msg);
}
}
*/

19 changes: 5 additions & 14 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,15 @@
{
"name": "ub.uku.js",
"version": "2.0.0",
"version": "0.0.1",
"dependencies": {
"colors": "*",
"nomnom": "1.8.x",
"request": "2.83.x",
"validator": "9.1.x",
"uglify-js": "2.7.x"
"uglify-js": "2.7.x",
"validator": "9.1.x"
},
"scripts": {
"start": "node server/server.js",
"test": "python test/run-all-tests.py",
"test:unit": "_mocha unit_test/**/*-tests.js -r babel-core/register",
"test:unit:watch": "npm run test:unit -- --watch"
"start": "node server/server.js"
},
"engines": {
"node": "8.9.x",
Expand All @@ -24,12 +21,6 @@
},
"license": "AGPL-3.0",
"devDependencies": {
"babel-core": "^6.26.0",
"babel-preset-es2015": "^6.3.13",
"chai": "^3.5.0",
"eslint": "^2.4.0",
"eslint-config-airbnb": "^6.2.0",
"eslint-plugin-react": "^4.2.3",
"mocha": "^2.4.5"
"eslint": "^8.18.0"
}
}
165 changes: 0 additions & 165 deletions test/run-all-tests.py

This file was deleted.

Loading

0 comments on commit 8a1bfda

Please sign in to comment.