Open contribucious opened 1 year ago
@contribucious Great idea, will consider implementing it.
We can't style the badge as you proposed in the second comment.
@maximtop
You're right. Badge is very limited in fact — unlike Icon — regarding animation.
Badge (chrome.browserAction.setBadgeText
) seems OK for a countdown (30s … 29s … 28s …), but it's the Icon (chrome.browserAction.setIcon
) that should be updated for a possible animation.
But unfortunately, if I understand correctly, during the 30 seconds, the gray shield will have to be replaced by this animation (which uses canvas). We cannot have both at the same time, except … to create a very complex canvas.
to create a very complex canvas.
I prefer it to be an easy solution
Of course. I just mentioned this as a bonus, as the only possibility AFAIK to do this (i.e. to have both animation + keeping the gray shield icon), but not as a real de facto solution. :wink:
Keep in mind that there are plans to add blocked element statistics to the icon.
@maximtop
I think the simplest and most adequate solution here will be just to update the badge itself (30s … 29s … 28s …) using chrome.browserAction.setBadgeText
.
And possibly to use chrome.browserAction.setBadgeBackgroundColor
with a more pronounced color during these 30 seconds to differentiate*
from a future probable blocking counter to come (as already said in my issue, @zubrRB :wink:).
*
In addition to the "s" character (i.e. 30s
vs 30
) + the decreasing each second clearly recognizable + the "gray shield only" situation + the fact that this follows an immediate user action (i.e. clicking on Do not filter for 30 seconds
). All already described in Versus blocking counter visually?
and Future-proof
parts of my issue.
@Birbber @maximtop I edited the badge little. This contour will start at 12 o'clock and decrease clockwise. I think it could be better this way.
@gork7777 Very nice one! :thumbsup: Although the icon should be gray during these 30 seconds (as it is now), since the protection is switched off during this time (action is Do not filter for 30 seconds
). :wink:
@maximtop To avoid having to use canvas, especially because not required here (i.e. no "perpetual loading" icon with complex animation), could we imagine having simply 30x the static image of @gork7777 for each second of the countdown (i.e. icon-30s.png
, icon-29s.png
, …) and just updating this static image every second using chrome.browserAction.setIcon
in an appropriate setInterval
? — Ideally, without unpleasant flickering?
(And possibly, as a bonus to this already explicit visual, displaying the number of seconds like 29s
using chrome.browserAction.setBadgeText
and chrome.browserAction.setBadgeBackgroundColor
?)
If this feature sees the light of day, it is better to go for its light version.
Because unfortunately, here is what the Manifest V3 documentation says:
The
action.setIcon()
API is intended to set a static image. It should not be used to simulate animation.
The chrome.action API replaced the browserAction and pageAction APIs in Manifest V3.
Hi, :wave:
It might be a good idea IMHO to display the 30 second countdown on the extension icon, when using the
Don't filter for 30 seconds
option.Useful, as we don't know where we are in time when we close the Browser Assistant popup and use the website. :relaxed:
:small_blue_diamond: Possible subtlety: trigger its display only when the popup is closed. This, in order to prevent a double display of the countdown while the popup is still open — i.e. on the extension icon + in the popup. And … leave it or not on the extension icon if/when the popup is reopened (up to you).
Visual rendering
:arrow_right_hook: _Like this but with a gray shield and displaying
19s
instead — if there are19s
left in the countdown for example. :hourglass_flowingsand::information_source: Versus blocking counter visually? In addition to the presence of the character "s", and the decrease every second clearly recognizable, all this in addition on a gray shield in this situation and as a result of the user's immediate own action, to be possibly even more visually distinct from a possible/probable future blocking counter — already present in
AdGuard Browser extension
—, just change the background color + text color + possibly round the corners or display it within a circle or an oval instead. And/Or … either display at his side an animated-or-not hourglass (:hourglass_flowing_sand:) or a vertical bar (such as a capital i) that decreases from top to bottom, or instead, if displayed within a circle, simply animate the "unfilling" of the border of the circle itself to show that a countdown is in progress.:bulb: Future-proof: Once the
30s
delay is over, the shield will turn green again (once this issue is fixed though) and … a potential future blocking counter will take over instead. To count the new blocked XHR & co requests for example. Not incompatible with the future, therefore. :heavy_check_mark:Thank you in advance. :thumbsup:
Environment Browser Assistant 1.3.13 on Firefox 103.0.2 AdGuard 7.10.2 on Windows 10 Pro 21H2 (OS Build 19044.1865)