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

GH-1975 Theme Framework & GH-1972 Palm Theme #517

Closed
wants to merge 22 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
File filter
Filter file types
Jump to
Jump to file
Failed to load files.

Always

Just for now

Add configuration that points to local account server
  • Loading branch information
benstrumeyer committed Mar 18, 2020
commit fc614945debbaa743cdbc57201a90d346b5cf17e
@@ -114,7 +114,7 @@ class Account {
logout = () => (
new RSVP.Promise((resolve, reject) => {
chrome.cookies.get({
url: `https://${GHOSTERY_DOMAIN}.com`,
url: 'http://ghostery.test',
name: 'csrf_token',
}, (cookie) => {
if (cookie === null) { return reject(); }
@@ -204,10 +204,12 @@ class Account {
})
.then((shouldGet) => {
if (!shouldGet) {
console.log('conf.account.themeData ', conf.account.themeData);
return conf.account.themeData[name].css;
}
return api.get('themes', `${name}.css`)
.then((res) => {
console.log('res: ', res);
const { css } = build(normalize(res), 'themes', res.data.id);
this._setThemeData({ name, css });
return css;
@@ -312,7 +314,7 @@ class Account {
return;
}
chrome.cookies.get({
url: `https://${GHOSTERY_DOMAIN}.com`,
url: 'http://ghostery.test',
name: 'user_id',
}, (cookie) => {
if (cookie !== null) {
@@ -402,8 +404,8 @@ class Account {
chrome.cookies.set({
name,
value,
url: `https://${GHOSTERY_DOMAIN}.com`,
domain: `.${GHOSTERY_DOMAIN}.com`,
url: 'http://ghostery.test',
domain: '.ghostery.test',
expirationDate,
secure: true,
httpOnly,
@@ -502,7 +504,7 @@ class Account {
_getUserIDFromCookie = () => (
new Promise((resolve, reject) => {
chrome.cookies.get({
url: `https://${GHOSTERY_DOMAIN}.com`,
url: 'http://ghostery.test',
name: 'user_id',
}, (cookie) => {
if (cookie) {
@@ -541,7 +543,7 @@ class Account {
const cookies = ['user_id', 'access_token', 'refresh_token', 'csrf_token', 'AUTH'];
cookies.forEach((name) => {
chrome.cookies.remove({
url: `https://${GHOSTERY_DOMAIN}.com`,
url: 'http://ghostery.test',
name,
}, () => {
log(`Removed cookie with name: ${name}`);
@@ -56,8 +56,8 @@ class Globals {
this.CDN_SUB_DOMAIN = this.DEBUG ? 'staging-cdn' : 'cdn';
this.APPS_SUB_DOMAIN = this.DEBUG ? 'staging-apps' : 'apps';
this.GCACHE_SUB_DOMAIN = this.DEBUG ? 'staging-gcache' : 'gcache';
this.AUTH_SERVER = `https://consumerapi.${this.GHOSTERY_DOMAIN}.com`;
this.ACCOUNT_SERVER = `https://accountapi.${this.GHOSTERY_DOMAIN}.com`;
this.AUTH_SERVER = 'http://consumerapi.ghostery.test';
this.ACCOUNT_SERVER = 'http://accountapi.ghostery.test';

// extension IDs
this.GHOSTERY_TAB_CHROME_PRODUCTION_ID = 'plmapebanmikcofllaaddgeocahboejc';
@@ -142,7 +142,7 @@ class Api {
_getCsrfCookie = (csrfDomain = this.config.CSRF_DOMAIN) => (
new Promise((resolve) => {
chrome.cookies.get({
url: `https://${csrfDomain}.com`,
url: 'http://ghostery.test',
name: 'csrf_token',
}, cookie => resolve((cookie !== null) ? cookie.value : ''));
})
ProTip! Use n and p to navigate between commits in a pull request.