Comments (4)
I have to add now, that without the Timeout function, after start of ferdium, the Update message keeps displaying. So I added again the timeout. All code now in user.js for WhatsApp service:
module.exports = (config, Ferdium) => {
[data-testid="chat-butterbar"]:has([data-icon="alert-update"]) {
display: none !important;
}
// 2023-05-26: von: https://github.com/TheGoddessInari/hamsket/issues/75#issuecomment-1555946206
const interval = setInterval(hideUpdateMessage, 1000);
function hideUpdateMessage() {
const updateMessage = document.querySelector('span[data-testid="chat-butterbar"]');
if (updateMessage !== undefined) {
updateMessage.style.display = "none";
clearInterval(interval);
};
};
};
I changed my code to the one from @jschiefner because it is much better 👍 thanks, Jonas ❤️
Read it there: Whatsapp update available #75
from dark-whatsapp.
Now I noticed, that I can indeedly look into the real code of WhatsApp Web in Ferdium, with:
View > Toggle Service Developer Tools (ALT+CTRL+SHIFT+I) and indeed I found the Update message in the chat-butterbar!
But my code didnt help, so I changed it in the service's user.js to:
module.exports = (config, Ferdium) => {
// Write your scripts here
// 2023-03-25: warten bis Seite fertig geladen ist...
window.addEventListener("load", (event) => {
document.querySelectorAll('[data-testid="chat-butterbar"]')[0].style.display = "none";
});
// zur Sicherheit noch mal mit Timeout (delay in ms)
let timeout;
let delay = 15000;
function waTimeout() {
timeout = setTimeout(hideUpdateMessage, 15000);
}
function hideUpdateMessage() {
document.querySelectorAll('[data-testid="chat-butterbar"]')[0].style.display = "none";
}
};
So first the display none should wait till the site is fully loaded and then (to be sure) again the same display none after 15 sec. with setTimeout function.
I cannot say if it works yet, because always when reload the service the Update nagscreen is gone (not for good), so I have to wait.
Will tell if it works here and at other spots, where I asked in vain for hints about that 😄
Strange that never anybody told me about the Service Dev Tools, I was sure I could not see inside the html of the webview element!
See ferdium issue #572 for the working code (with setInterval).
from dark-whatsapp.
It's probably not ideal to hide all alerts. In that case, I suggest injecting a simple style
element which contains the following CSS code:
[data-testid="chat-butterbar"]:has([data-icon="alert-update"]) {
display: none !important;
}
That makes this workaround pretty trivial. I tested it from my browser and everything worked pretty well.
from dark-whatsapp.
It's probably not ideal to hide all alerts. In that case, I suggest injecting a simple
style
element which contains the following CSS code:[data-testid="chat-butterbar"]:has([data-icon="alert-update"]) { display: none !important; }That makes this workaround pretty trivial. I tested it from my browser and everything worked pretty well.
Is it possible to add this into the official releases? I'm not sure how to do add it to the CSS myself.
from dark-whatsapp.
Related Issues (20)
- Blog link broken HOT 2
- Please add an option to change the read check colour HOT 1
- Broken things in November's update HOT 1
- Option to hide avatars HOT 2
- How to customise the day tags in chat? HOT 10
- starting message is unselectable HOT 3
- notification number in profile pic? HOT 4
- Nord Theme HOT 3
- Incorrect text colour for attachment tooltips HOT 6
- Blurried profile pic in audio messages (Whatsapp Web Beta) HOT 11
- There isn't any option to change the color of this bubble. HOT 3
- Scrolling is laggy on Firefox HOT 3
- Add option to remove 'Update Available' popup? HOT 5
- dark-messenger HOT 3
- hide avatar feature HOT 2
- Compact mode broken HOT 1
- Compact mode is broken HOT 5
- Unable to apply background image HOT 1
- [BUG] Search input container is partially unstyled HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dark-whatsapp.