Skip to content

Commit

Permalink
Prepare fix for debug value defaults for Firefox and Safari, update v…
Browse files Browse the repository at this point in the history
…ersion to 1.0.8
  • Loading branch information
svnhub committed Jun 28, 2022
1 parent c007f24 commit c49990e
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 25 deletions.
4 changes: 2 additions & 2 deletions Extension/Action.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class Action {
if (this.config.timeout != null) {
return this.config.timeout;
} else {
let pipEnabled = ConsentEngine.debugValues.skipHideMethod === false && ConsentEngine.debugValues.hideInsteadOfPIP === false;
let pipEnabled = !(ConsentEngine.debugValues.skipHideMethod || ConsentEngine.debugValues.hideInsteadOfPIP);

if (ConsentEngine.debugValues.clickDelay) {
return 125;
Expand Down Expand Up @@ -437,7 +437,7 @@ class HideAction extends Action {
}

async execute(param) {
if(ConsentEngine.debugValues.skipHideMethod === true) {
if(ConsentEngine.debugValues.skipHideMethod) {
return;
}

Expand Down
4 changes: 2 additions & 2 deletions Extension/ConsentEngine.js
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ class ConsentEngine {
console.groupEnd();
}
if (!ConsentEngine.debugValues.skipHideMethod) {
if(ConsentEngine.debugValues.dontHideProgressDialog === false) {
if(!ConsentEngine.debugValues.dontHideProgressDialog) {
cmp.stopObservers();
}
}
Expand Down Expand Up @@ -234,7 +234,7 @@ class ConsentEngine {
console.log("Error during consent handling:", e);
}
if (!ConsentEngine.debugValues.skipHideMethod) {
if(ConsentEngine.debugValues.dontHideProgressDialog === false) {
if(!ConsentEngine.debugValues.dontHideProgressDialog) {
self.currentCMP = null;
cmp.stopObservers();
cmp.unHideAll();
Expand Down
19 changes: 1 addition & 18 deletions Extension/GDPRConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class GDPRConfig {
static getDebugValues() {
return new Promise((resolve, reject) => {
chrome.storage.sync.get({
debugFlags: GDPRConfig.defaultDebugFlags
debugFlags: {}
}, (result) => {
resolve(result.debugFlags);
});
Expand Down Expand Up @@ -254,8 +254,6 @@ class GDPRConfig {

static setDebugFlags(newDebugFlags) {
return new Promise((resolve, reject)=>{
newDebugFlags = Object.assign({}, GDPRConfig.defaultDebugFlags, newDebugFlags);

chrome.storage.sync.set({
debugFlags: newDebugFlags
}, () => {
Expand Down Expand Up @@ -287,18 +285,3 @@ GDPRConfig.defaultValues = {
GDPRConfig.defaultRuleLists = [
"https://raw.githubusercontent.com/cavi-au/Consent-O-Matic/master/rules-list.json",
];


GDPRConfig.defaultDebugFlags = {
"clickDelay": false,
"skipSubmit": false,
"paintMatchers": false,
"debugClicks": false,
"alwaysForceRulesUpdate": false,
"skipHideMethod": false,
"debugLog": false,
"debugTranslations": false,
"skipSubmitConfirmation": false,
"hideInsteadOfPIP": false,
"dontHideProgressDialog": false
}
2 changes: 1 addition & 1 deletion Extension/language.js
Original file line number Diff line number Diff line change
Expand Up @@ -1162,7 +1162,7 @@ class Language {
} else {
console.warn("Missing translation ["+lang+"] for key: ", key, translation);

if(Language.debugTranslations !== true) {
if(!Language.debugTranslations) {
if(translation["en"] != null) {
result = translation["en"];
}
Expand Down
2 changes: 1 addition & 1 deletion Extension/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"description": "Automatic handling of GDPR consent forms",
"author": "CAVI - Aarhus University",
"homepage_url": "https://github.com/cavi-au/Consent-O-Matic",
"version": "1.0.5",
"version": "1.0.8",
"manifest_version": 2,
"permissions": [
"activeTab",
Expand Down
2 changes: 1 addition & 1 deletion Extension/options.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ GDPRConfig.getDebugFlags().then((debugFlags) => {
console.log("Nuking values");
chrome.storage.sync.remove("debugFlags", ()=>{
chrome.storage.sync.set({
debugFlags: {ost:true}
debugFlags: {}
});
setTimeout(async ()=>{
let values = await GDPRConfig.getDebugValues();
Expand Down

0 comments on commit c49990e

Please sign in to comment.