Incorrect hashtag appended when sharing number of blocked ads to Facebook
Environment
- OS version: Ubuntu 18.04
- Browser version: I don't think this is browser specific, but reproduced in Firefox 73, Chrome 80 and Opera 66
-
Extension version:
UI release 2019-3
- Last working version: n/a
Description
In #485 (closed) we've added an ability for the user to share the number of blocked ads to Facebook & Twitter. For Facebook, we've decided to add a hashtag to the shared message, depending on how many ads the user has blocked.
The hashtags should be:
if blocked number is < 1000 show hashtag: `#AdblockPlus100`
if blocked number is < 10000 show hashtag: `#AdblockPlus1000`
if blocked number is < 100000 show hashtag: `#AdblockPlus10K`
if blocked number is < 1000000 show hashtag: `#AdblockPlus100K`
if blocked number is >= 10000000 show hashtag: `#AdblockPlus1M`
Steps to reproduce
- using the latest
2019-3
build, block between 0 and 1000 ads - share the number to Facebook, observe that the correct hashtag,
#AdblockPlus100
, is appended - block between 1000 and 1 000 000 ads (
😄 ), you can easily do that by pastingsetInterval(() => fetch("ad.js"), 1);
in the devtools console to quickly ramp up the number of blocked ads - share the number to Facebook, observe that the wrong hashtag,
#AdblockPlus1M
, is appended
Observed behavior
- If the number of blocked ads is between 0 and 1000, the correct hashtag,
#AdblockPlus100
is used - if the number of blocked ads is >1000, hashtag
#AdblockPlus1M
is used - other hashtags-
#AdblockPlus1000
,#AdblockPlus10K
,#AdblockPlus100K
are never used
Expected behavior
Hashtags should be appended correctly, depending on the number of blocked ads (see hashtags above, under Description).
Further information
See implementation here: https://gitlab.com/eyeo/adblockplus/abpui/adblockplusui/-/merge_requests/409/diffs#ca53570a3c0a44c9387dc06775beb9236d939a6d_0_41 .
Edited by Ursa Kacar