Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix 'trust site' on localhost #491

Merged
merged 5 commits into from Feb 3, 2020
Merged
Changes from all commits
Commits
File filter
Filter file types
Jump to
Jump to file
Failed to load files.

Always

Just for now

@@ -13,6 +13,7 @@

/* eslint no-use-before-define: 0 */

import { URL } from '@cliqz/url-parser';
import {
UPDATE_SUMMARY_DATA,
UPDATE_CLIQZ_MODULE_DATA,
@@ -111,9 +112,13 @@ const _updateSitePolicy = (state, action) => {
// Handles extension pages. Adds the extension ID to the white/black list
const pageUrlTokens = pageUrl.split('/');
host = pageUrlTokens.length > 2 ? pageUrlTokens[2] : pageHost.replace(/^www\./, '');
} else if (pageHost === 'localhost') {
const url = new URL(pageUrl);
host = url.host;
} else {
host = pageHost.replace(/^www\./, '');
}

let updated_site_policy;
let updated_blacklist = site_blacklist.slice(0);
let updated_whitelist = site_whitelist.slice(0);
ProTip! Use n and p to navigate between commits in a pull request.