Skip to content

Commit

Permalink
v4.3.0 - 2020-03-03
Browse files Browse the repository at this point in the history
  • Loading branch information
bjornstar committed Mar 3, 2020
1 parent 03ab491 commit 162b9e7
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 7 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Intercept Redirect

## v4.3.0 - 2020-03-03
- Add `www.javlibrary.com`
- Use arrow functions in `index.js`
- Ensure `README` lists all sites

## v4.2.3 - 2020-03-02
- Update `mocha` from `v7.0.1` to `v7.1.0`
- Add `eslint`
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ Skip tracking redirects that serve no purpose other than to waste your valuable
- plus.url.google.com
- www.google.com
- l.instagram.com
- www.javlibrary.com
- l.messenger.com
- slack-redir.net
- steamcommunity.com
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@bjornstar/intercept-redirect",
"version": "4.2.3",
"version": "4.3.0",
"description": "Skip tracking redirects that serve no purpose other than to waste your valuable time.",
"main": "webextension/index.js",
"dependencies": {},
Expand Down
17 changes: 16 additions & 1 deletion test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ const urls = [
'https://www.google.com/url?q=https%3A%2F%2Fbjornstar.com%2Fintercept-redirect',
'https://www.google.com/url?url=https%3A%2F%2Fbjornstar.com%2Fintercept-redirect',
'https://l.instagram.com/?u=https%3A%2F%2Fbjornstar.com%2Fintercept-redirect',
'https://www.javlibrary.com/en/redirect.php?url=https%3A%2F%2Fbjornstar.com%2Fintercept-redirect',
'https://l.messenger.com/l.php?u=https%3A%2F%2Fbjornstar.com%2Fintercept-redirect',
'https://slack-redir.net/link?url=https%3A%2F%2Fbjornstar.com%2Fintercept-redirect',
'https://steamcommunity.com/linkfilter/?url=https%3A%2F%2Fbjornstar.com%2Fintercept-redirect',
Expand Down Expand Up @@ -100,7 +101,7 @@ describe('Packaging', () => {
describe('Every site implemented in the webExtension has a test', () => {
manifestSites.forEach(site => {
it(`site: ${site}`, () => {
assert.ok(testSites.indexOf(site) !== -1, `Missing tests: ${site}`);
assert.ok(testSites.includes(site), `Missing tests: ${site}`);
});
});
});
Expand Down Expand Up @@ -130,6 +131,20 @@ describe('Packaging', () => {
});
});

it('The README has an entry for every supported domain', done => {
fs.readFile(path.resolve('./README.md'), 'utf8', (error, readme) => {
if (error) return done(error);

const lines = readme.split('\n');

manifestSites.forEach(site => {
assert.ok(lines.includes(`- ${site}`), `Missing site: ${site}`);
});

done();
});
});

it('The manifest does not use tabs', done => {
fs.readFile(path.resolve('./webextension/manifest.json'), 'utf8', (error, manifest) => {
if (error) return done(error);
Expand Down
15 changes: 11 additions & 4 deletions webextension/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const sites = {
pathnames: {
'/linkout': ['remoteUrl']
},
extra: function (s = '') {
extra: (s = '') => {
return decodeURIComponent(s);
}
},
Expand All @@ -25,7 +25,7 @@ const sites = {
pathnames: {
'/url': ['url']
},
extra: function (s = '') {
extra: (s = '') => {
return s.substring(0, s.lastIndexOf(':'));
}
},
Expand All @@ -47,7 +47,9 @@ const sites = {
},
// 2019-08-06 - https://gate.sc/?url=http%3A%2F%2Ffanlink.to%2FPartial7&token=10fd54-1-1565068249069
'gate.sc': {
pathnames: { '/': ['url'] }
pathnames: {
'/': ['url']
}
},
'www.google.co.jp': {
pathnames: googlePathnames
Expand All @@ -70,6 +72,11 @@ const sites = {
'/': ['u']
}
},
'www.javlibrary.com': {
pathnames: {
'/en/redirect.php': ['url']
}
},
'l.messenger.com': {
pathnames: {
'/l.php': ['u']
Expand Down Expand Up @@ -168,7 +175,7 @@ function analyzeURL(request) {
}

function reduceSites(urls, host) {
return urls.concat(Object.keys(sites[host].pathnames).map(function (pathname) {
return urls.concat(Object.keys(sites[host].pathnames).map(pathname => {
return `*://${host}${pathname}*`;
}));
}
Expand Down
3 changes: 2 additions & 1 deletion webextension/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
"*://plus.url.google.com/",
"*://www.google.com/",
"*://l.instagram.com/",
"*://www.javlibrary.com/",
"*://l.messenger.com/",
"*://slack-redir.net/",
"*://steamcommunity.com/",
Expand All @@ -35,5 +36,5 @@
"*://workable.com/",
"*://www.youtube.com/"
],
"version": "4.2.3"
"version": "4.3.0"
}

0 comments on commit 162b9e7

Please sign in to comment.