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

Release v3.3.2 #92

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<div class="content">
<h1>Privacy Extension For WhatsApp™ Web</h1>
<img src="https://github.com/LukasLen/Privacy-Extension-For-WhatsApp-Web/blob/master/src/images/logo.svg?raw=true" class="logo" alt="Logo">
<p class="download">900,000 Users. Available for <a href="https://chrome.google.com/webstore/detail/privacy-extension-for-wha/jbojhlhhggfmmkpefknmbdhlaghehini">Chrome</a> and <a href="https://addons.mozilla.org/de/firefox/addon/privacy-extension-for-whatsapp/">Firefox</a>.</p>
<p class="download">1,200,000 Users. Available for <a href="https://chrome.google.com/webstore/detail/privacy-extension-for-wha/jbojhlhhggfmmkpefknmbdhlaghehini">Chrome</a> and <a href="https://addons.mozilla.org/de/firefox/addon/privacy-extension-for-whatsapp/">Firefox</a>.</p>
<div class="screenshots">
<a href="https://github.com/LukasLen/Privacy-Extension-For-WhatsApp-Web/blob/master/screenshots/PFWA_Header.png?raw=true" target="_blank"><img src="https://github.com/LukasLen/Privacy-Extension-For-WhatsApp-Web/blob/master/screenshots/PFWA_Header_Thumb.png?raw=true" alt="Screenshot: Reveal messages on hover."></a>
<a href="https://github.com/LukasLen/Privacy-Extension-For-WhatsApp-Web/blob/master/screenshots/PFWA_Settings.png?raw=true" target="_blank"><img src="https://github.com/LukasLen/Privacy-Extension-For-WhatsApp-Web/blob/master/screenshots/PFWA_Settings_Thumb.png?raw=true" alt="Screenshot: Customize what you want to blur."></a>
Expand Down
12 changes: 9 additions & 3 deletions src/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ if (typeof browser == "undefined") {
globalThis.browser = chrome;
}

const styleIdentifier = "pfwa";
const settingsIdentifier = "settings";
const defaultSettings = {
settings: {
Expand Down Expand Up @@ -57,7 +56,11 @@ browser.runtime.onInstalled.addListener(() => {

// Set default settings upon install
browser.storage.sync.get([settingsIdentifier]).then((result) => {
if (result.hasOwnProperty(settingsIdentifier)) return;
if (result.hasOwnProperty(settingsIdentifier)) {
var defaultKeys = Object.keys(defaultSettings.settings).sort();
var currentKeys = Object.keys(result.settings).sort();
if(JSON.stringify(defaultKeys) === JSON.stringify(currentKeys)) return;
}
browser.storage.sync.set(defaultSettings);
});
});
Expand All @@ -67,7 +70,10 @@ browser.commands.onCommand.addListener((command) => {
if (command != "toggle") return;

browser.storage.sync.get([settingsIdentifier]).then((result) => {
if (!result.hasOwnProperty(settingsIdentifier)) return;
if (!result.hasOwnProperty(settingsIdentifier)) {
browser.runtime.reload();
return;
}

result.settings.on = !result.settings.on;
browser.storage.sync.set(result);
Expand Down
3 changes: 2 additions & 1 deletion src/css/noDelay.css
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,8 @@ div.overlay ._am0k:hover /* user/group profile pic overlay view */,
div.x1okw0bk.x1w0mnb:hover /* user profile pic in starred message list */,

/* textInput */
div._ak1l:hover /* message text input */
div._ak1l:hover /* message text input */,
div._ak1r:hover /* message text input */
{
transition-delay: 0.04s !important;
-webkit-transition-duration: 0s !important;
Expand Down
12 changes: 7 additions & 5 deletions src/css/textInput.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,22 @@
/* Released under the MIT license, see LICENSE file for details */

/* former wa version (v2.2412.xx) */
._3Uu1_ /*textarea*/,
._3Uu1_ /* textarea */,

/* updated wa version (v2.3000.xx) */
div._ak1l /* message text input */
div._ak1l /* message text input */,
div._ak1r /* message text input */
{
filter: grayscale(1) opacity(0.25);
}

/* former wa version (v2.2412.xx) */
._3Uu1_:hover /*textarea*/,
._3Uu1_:hover /* textarea */,

/* updated wa version (v2.3000.xx) */
div._ak1l:hover /* message text input */
div._ak1l:hover /* message text input */,
div._ak1r:hover /* message text input */
{
filter: grayscale(0) opacity(1);
transition-delay: 0.3s;
}
}
3 changes: 2 additions & 1 deletion src/css/unblurActive.css
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,8 @@ body:hover ._3Uu1_ /*textarea*/,

/* updated wa version (v2.3000.xx) */
/* textInput */
div._ak1l:hover /* message text input */
div._ak1l:hover /* message text input */,
div._ak1r:hover /* message text input */
{
filter: grayscale(0) opacity(1);
}
2 changes: 1 addition & 1 deletion src/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"default_locale": "en",
"name": "__MSG_extensionName__",
"description": "__MSG_extensionDescription__",
"version": "3.3.0",
"version": "3.3.2",
"action": {
"default_title": "__MSG_extensionName__",
"default_popup": "popup/popup.html",
Expand Down
2 changes: 1 addition & 1 deletion src/manifest_firefox.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"default_locale": "en",
"name": "__MSG_extensionName__",
"description": "__MSG_extensionDescription__",
"version": "3.3.0",
"version": "3.3.2",
"action": {
"default_title": "__MSG_extensionName__",
"default_popup": "popup/popup.html",
Expand Down
50 changes: 13 additions & 37 deletions src/popup/popup.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,10 @@ function saveSettings() {
let checked = this.checked;

browser.storage.sync.get([settingsIdentifier]).then((result) => {
if (!result.hasOwnProperty(settingsIdentifier)) return;
if (!result.hasOwnProperty(settingsIdentifier)) {
browser.runtime.reload();
return;
}
if (id == "on") {
result.settings.on = checked;
} else if (id === "blurOnIdle") {
Expand Down Expand Up @@ -65,7 +68,10 @@ function saveFormSettings(ev) {
const [key, val] = Object.entries(Object.fromEntries(new FormData(ev.target)))[0];

browser.storage.sync.get([settingsIdentifier]).then((result) => {
if (!result.hasOwnProperty(settingsIdentifier)) return;
if (!result.hasOwnProperty(settingsIdentifier)) {
browser.runtime.reload();
return;
}
if (key === "itBlur") {
result.settings.blurOnIdle.idleTimeout = val;
} else {
Expand All @@ -77,7 +83,10 @@ function saveFormSettings(ev) {

// Load settings and update switches
browser.storage.sync.get([settingsIdentifier]).then((result) => {
if (!result.hasOwnProperty(settingsIdentifier)) return;
if (!result.hasOwnProperty(settingsIdentifier)) {
browser.runtime.reload();
return;
}

switches.forEach((checkbox) => {
let id = checkbox.dataset.style;
Expand All @@ -101,37 +110,4 @@ browser.storage.sync.get([settingsIdentifier]).then((result) => {
}
})

});


/*
// legacy code, keeping it for future reference
// message loading not implemented currently

//load message
xmlhttp=new XMLHttpRequest();
xmlhttp.onreadystatechange=function(){
if (xmlhttp.readyState==4 && xmlhttp.status==200){
let response = JSON.parse(xmlhttp.responseText);
if(response["*"] && response["*"]["min"] <= version && response["*"]["max"] >= version)
response = response["*"]["msg"];
else
response = response[version] ? response[version] : '';

if(response != "" && data.currentPopupMessage != response){
mainContent.style.display = "none";
popupMessage.innerText = response;
popupMessage.innerHTML += "<br><a href=\"#\" id=\"popupMessageButton\">Close message</a>";

let popupMessageButton = document.getElementById('popupMessageButton');
popupMessageButton.addEventListener('click', function() {
chrome.storage.sync.set({currentPopupMessage: response});
popupMessage.innerHTML = "";
mainContent.style.display = "initial";
});
}
}
}
xmlhttp.open("GET", "https://lukaslen.com/message/pfwa.json", true);
xmlhttp.send();
*/
});