Skip to content

Commit

Permalink
Merge pull request #2583 from dhowe/vault-refactor
Browse files Browse the repository at this point in the history
Vault capture button in debug mode
mneunomne authored Dec 21, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
2 parents d94747a + c2d898d commit 15f755b
Showing 30 changed files with 595 additions and 629 deletions.
2 changes: 1 addition & 1 deletion platform/common/vapi-common.js
Original file line number Diff line number Diff line change
@@ -166,7 +166,7 @@ vAPI.webextFlavor = {
soup.add('ipaddress');

// Whether this is a dev build.
if ( /^\d+\.\d+\.\d+\D/.test(browser.runtime.getManifest().version) ) {
if (browser.runtime.getManifest()?.version_name?.endsWith('dev')) {
soup.add('devbuild');
}

2 changes: 1 addition & 1 deletion src/_locales/ar/adnauseam.json
Original file line number Diff line number Diff line change
@@ -492,7 +492,7 @@
"description": "appears as tab name in dashboard"
},
"eventLoggingPrompt": {
"message": "Activate debugging mode",
"message": "Debug mode",
"description": "prompt for toggle"
},
"disableWarnings": {
2 changes: 1 addition & 1 deletion src/_locales/cv/adnauseam.json
Original file line number Diff line number Diff line change
@@ -492,7 +492,7 @@
"description": "appears as tab name in dashboard"
},
"eventLoggingPrompt": {
"message": "Activate debugging mode",
"message": "Debug mode",
"description": "prompt for toggle"
},
"disableWarnings": {
24 changes: 14 additions & 10 deletions src/_locales/en/adnauseam.json
Original file line number Diff line number Diff line change
@@ -31,7 +31,7 @@
"message": "Block Malware",
"description": "English: Firstrun.html -> Block Malware"
},
"adnAboutResetDataConfirm" : {
"adnAboutResetDataConfirm": {
"message": "All your settings will be removed, ads in your vault will be deleted, and AdNauseam will restart.\n\nReset AdNauseam to factory settings?",
"description": "Message asking user to confirm reset"
},
@@ -71,7 +71,7 @@
"message": "Activate the EasyList filter",
"description": "English: Notifications -> Activate the EasyList filter"
},
"adnNotificationActivateAdNauseamList": {
"adnNotificationActivateAdNauseamList": {
"message": "Activate the AdNauseam filter",
"description": "English: Notifications -> Activate the AdNauseam filter"
},
@@ -91,7 +91,7 @@
"message": "The 'Content Blocking' settings in your browser may interfere with AdNauseam!",
"description": "English: Notifications -> The 'Content Blocking' settings in your browser may interfere with AdNauseam!"
},
"adnNotificationPrivacyMode":{
"adnNotificationPrivacyMode": {
"message": "You have allowed adnauseam to have access to your online activities while private browsing.",
"description": "English: Notifications -> You have allowed adnauseam to have access to your online activities while private browsing."
},
@@ -113,7 +113,7 @@
},
"adnNotificationShowAdsDebug": {
"message": "The Advanced Setting \"Show Ads Debug\" is turned on",
"description": "English: Notifications -> The Advanced Setting \"Show Ads Debug\" is turned on"
"description": "English: Notifications -> The Advanced Setting \"Show Ads Debug\" is turned on"
},
"adnNewerVersionAvailableNotification": {
"message": "A newer version of AdNauseam is available",
@@ -220,7 +220,7 @@
"description": "appears in ADN settings"
},
"adnPurgeConfirm": {
"message": "This action will permanently remove all ads with load image error. Make sure your internet is connected, otherwise all your ads will be deleted.",
"message": "This action will permanently remove all ads for which the image cannot be loaded. It is a good idea to backup your vault before purging, and also to make sure you have an active internet connection.",
"description": "appears in ADN settings"
},
"adnAdClickingStatusPending": {
@@ -363,6 +363,10 @@
"message": "Purge Dead Ads",
"description": "appears on vault page"
},
"adnCaptureVault": {
"message": "Capture",
"description": "appears on vault page in dev mode"
},
"adnVaultFound": {
"message": "{{total}} ads collected",
"description": "appears on vault page"
@@ -475,9 +479,9 @@
"message": "Languages",
"description": "English: Languages"
},
"3pPageUpdate":{
"message":"Update",
"description":"English: update"
"3pPageUpdate": {
"message": "Update",
"description": "English: update"
},
"adnUpdateButton": {
"message": "Update",
@@ -492,7 +496,7 @@
"description": "appears as tab name in dashboard"
},
"eventLoggingPrompt": {
"message": "Activate debugging mode",
"message": "Debug mode",
"description": "prompt for toggle"
},
"disableWarnings": {
@@ -535,4 +539,4 @@
"message": "Ads not collected",
"description": "Ads are present on page but none are collected"
}
}
}
2 changes: 1 addition & 1 deletion src/_locales/eu/adnauseam.json
Original file line number Diff line number Diff line change
@@ -492,7 +492,7 @@
"description": "appears as tab name in dashboard"
},
"eventLoggingPrompt": {
"message": "Activate debugging mode",
"message": "Debug mode",
"description": "prompt for toggle"
},
"disableWarnings": {
2 changes: 1 addition & 1 deletion src/_locales/fa/adnauseam.json
Original file line number Diff line number Diff line change
@@ -492,7 +492,7 @@
"description": "appears as tab name in dashboard"
},
"eventLoggingPrompt": {
"message": "Activate debugging mode",
"message": "Debug mode",
"description": "prompt for toggle"
},
"disableWarnings": {
2 changes: 1 addition & 1 deletion src/_locales/fil/adnauseam.json
Original file line number Diff line number Diff line change
@@ -492,7 +492,7 @@
"description": "appears as tab name in dashboard"
},
"eventLoggingPrompt": {
"message": "Activate debugging mode",
"message": "Debug mode",
"description": "prompt for toggle"
},
"disableWarnings": {
2 changes: 1 addition & 1 deletion src/_locales/fy/adnauseam.json
Original file line number Diff line number Diff line change
@@ -492,7 +492,7 @@
"description": "appears as tab name in dashboard"
},
"eventLoggingPrompt": {
"message": "Activate debugging mode",
"message": "Debug mode",
"description": "prompt for toggle"
},
"disableWarnings": {
2 changes: 1 addition & 1 deletion src/_locales/gl/adnauseam.json
Original file line number Diff line number Diff line change
@@ -492,7 +492,7 @@
"description": "appears as tab name in dashboard"
},
"eventLoggingPrompt": {
"message": "Activate debugging mode",
"message": "Debug mode",
"description": "prompt for toggle"
},
"disableWarnings": {
2 changes: 1 addition & 1 deletion src/_locales/mr/adnauseam.json
Original file line number Diff line number Diff line change
@@ -492,7 +492,7 @@
"description": "appears as tab name in dashboard"
},
"eventLoggingPrompt": {
"message": "Activate debugging mode",
"message": "Debug mode",
"description": "prompt for toggle"
},
"disableWarnings": {
2 changes: 1 addition & 1 deletion src/_locales/ro/adnauseam.json
Original file line number Diff line number Diff line change
@@ -492,7 +492,7 @@
"description": "appears as tab name in dashboard"
},
"eventLoggingPrompt": {
"message": "Activate debugging mode",
"message": "Debug mode",
"description": "prompt for toggle"
},
"disableWarnings": {
2 changes: 1 addition & 1 deletion src/_locales/sq/adnauseam.json
Original file line number Diff line number Diff line change
@@ -492,7 +492,7 @@
"description": "appears as tab name in dashboard"
},
"eventLoggingPrompt": {
"message": "Activate debugging mode",
"message": "Debug mode",
"description": "prompt for toggle"
},
"disableWarnings": {
2 changes: 1 addition & 1 deletion src/_locales/ta/adnauseam.json
Original file line number Diff line number Diff line change
@@ -492,7 +492,7 @@
"description": "appears as tab name in dashboard"
},
"eventLoggingPrompt": {
"message": "Activate debugging mode",
"message": "Debug mode",
"description": "prompt for toggle"
},
"disableWarnings": {
2 changes: 1 addition & 1 deletion src/_locales/te/adnauseam.json
Original file line number Diff line number Diff line change
@@ -492,7 +492,7 @@
"description": "appears as tab name in dashboard"
},
"eventLoggingPrompt": {
"message": "Activate debugging mode",
"message": "Debug mode",
"description": "prompt for toggle"
},
"disableWarnings": {
2 changes: 1 addition & 1 deletion src/css/vault.css
Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@ html {

body {
height: 100%;
background: #000 url(../img/gray_grid.png);

color: #4C4D4C;
font-family: "Helvetica Neue",Helvetica,Arial,sans-serif;
margin: 0;
8 changes: 4 additions & 4 deletions src/js/adn/adn-utils.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*******************************************************************************
AdNauseam - Fight back against advertising surveillance.
Copyright (C) 2014-2021 Daniel C. Howe
Copyright (C) 2014-2024 Daniel C. Howe
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -109,14 +109,14 @@ export const rand = function (min, max) {
};

export const setCost = function (numVisited) {
var constPerClick = 0
var costPerClick = 0
vAPI.messaging.send('dashboard', {what:'getCostPerClick'}).then(response => {
constPerClick = response
costPerClick = response
const $west = uDom('#worth-estimate'), $cost = uDom('.cost');

if (numVisited > 0) {
$cost.removeClass('hidden');
$west.text('= $' + (numVisited * constPerClick).toFixed(2));
$west.text('= $' + (numVisited * costPerClick).toFixed(2));
} else {
$cost.addClass('hidden');
}
17 changes: 6 additions & 11 deletions src/js/adn/core.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*******************************************************************************
AdNauseam - Fight back against advertising surveillance.
Copyright (C) 2014-2021 Daniel C. Howe
Copyright (C) 2014-2024 Daniel C. Howe
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -1574,7 +1574,8 @@ const adnauseam = (function () {
hidingDisabled: !us.hidingAds || showDnt,
clickingDisabled: !us.clickingAds,
textAdsDisabled: !us.parseTextAds,
logEvents: us.eventLogging
logEvents: us.eventLogging,
devMode: us.devMode,
};
};

@@ -1939,17 +1940,11 @@ const adnauseam = (function () {

const verifyVersion = exports.verifyVersion = async function () {
const version = vAPI.app.version;
console.log("current version: " + version);
//if (version.includes('b')) {
//console.log("beta version, don't check for updates");
//return;
//}
// run get request on /repos/dhowe/AdNauseam/releases
const response = await fetch("https://api.github.com/repos/dhowe/AdNauseam/releases/latest");
// validate
if (!response.ok) {
//throw new Error(`HTTP error! status: ${response.status}`);
}
// if (!response.ok) { // validate
// //throw new Error(`HTTP error! status: ${response.status}`);
// }
// parse response
const latestRelease = await response.json();
const latestVersion = latestRelease.tag_name.replace('v', '');
2 changes: 1 addition & 1 deletion src/js/adn/firstrun.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*******************************************************************************
AdNauseam - Fight back against advertising surveillance.
Copyright (C) 2014-2021 Daniel C. Howe
Copyright (C) 2014-2024 Daniel C. Howe
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
2 changes: 1 addition & 1 deletion src/js/adn/log.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*******************************************************************************
AdNauseam - Fight back against advertising surveillance.
Copyright (C) 2014-2021 Daniel C. Howe
Copyright (C) 2014-2024 Daniel C. Howe
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
2 changes: 1 addition & 1 deletion src/js/adn/menu.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*******************************************************************************
AdNauseam - Fight back against advertising surveillance.
Copyright (C) 2014-2021 Daniel C. Howe
Copyright (C) 2014-2024 Daniel C. Howe
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
2 changes: 1 addition & 1 deletion src/js/adn/notifications.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*******************************************************************************
AdNauseam - Fight back against advertising surveillance.
Copyright (C) 2014-2021 Daniel C. Howe
Copyright (C) 2014-2024 Daniel C. Howe
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
21 changes: 10 additions & 11 deletions src/js/adn/options.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*******************************************************************************
AdNauseam - Fight back against advertising surveillance.
Copyright (C) 2014-2021 Daniel C. Howe
Copyright (C) 2014-2024 Daniel C. Howe
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -138,12 +138,11 @@ const changeUserSettings = function (name, value) {
updateGroupState();
});
// reflect some changes immediately
switch ( name ) {
switch (name) {
case 'colorBlindFriendly':
console.log("colorBlindFriendly", value)
setTheme(value ? 'colorBlind' : 'dark', true);
break;
}
setTheme(value ? 'colorBlind' : 'dark', true);
break;
}
};

/******************************************************************************/
@@ -185,10 +184,10 @@ const onDisableWarningChanged = function (ev) {
// send to messaging so that the change is broadcasted to all tabs
vAPI.messaging.send(
'adnauseam', {
what: 'setWarningDisabled',
value, value
}
)
what: 'setWarningDisabled',
value, value
}
)
}

// Workaround for:
@@ -208,7 +207,7 @@ const updateGroupState = function () {

uDom('.clickingAds-child').prop('disabled', !uDom('#clickingAds').prop('checked'));
uDom('.clickingAds-child').parent().parent().parent().toggleClass('disabled', !uDom('#clickingAds').prop('checked'));

/*
blocking malware doesnt have any subgroup
uDom('.blockingMalware-child').prop('disabled', !uDom('#blockingMalware').prop('checked'));
2 changes: 1 addition & 1 deletion src/js/adn/parser.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*******************************************************************************
AdNauseam - Fight back against advertising surveillance.
Copyright (C) 2014-2021 Daniel C. Howe
Copyright (C) 2014-2024 Daniel C. Howe
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
2 changes: 1 addition & 1 deletion src/js/adn/tests.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*******************************************************************************
AdNauseam - Fight back against advertising surveillance.
Copyright (C) 2014-2021 Daniel C. Howe
Copyright (C) 2014-2024 Daniel C. Howe
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
2 changes: 1 addition & 1 deletion src/js/adn/textads.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*******************************************************************************
AdNauseam - Fight back against advertising surveillance.
Copyright (C) 2014-2021 Daniel C. Howe
Copyright (C) 2014-2024 Daniel C. Howe
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Loading

0 comments on commit 15f755b

Please sign in to comment.