Page 1 of 3

How to change total counter

PostPosted: Thu Oct 09, 2014 8:51 pm
by Merano
Hello everyone, I am new here.
Due to the problems that appear on my MS Vista, I must reinstall Google Chrome from time to time. I don't want to have my AdblockPlus total counter reseted to zero after each reinstalling, so I'd like to manually enter previous number of blocaded ads. Where can I find a file that stores such information?

Re: How to change total counter

PostPosted: Fri Oct 10, 2014 11:11 am
by greiner
That data is not stored within a file but you can still store it using this method:

1. Go to the Adblock Plus options page
2. Press CTRL+SHIFT+J to open the JavaScript console
3. Enter
Code: Select all
copy(localStorage.stats_total)
and press "Enter"
4. Paste the copied data into a text file and save it

To restore it follow these steps:

1. Copy the data from the text file where you saved it previously
2. Go to the Adblock Plus options page
3. Press CTRL+SHIFT+J to open the JavaScript console
4. Enter
Code: Select all
localStorage.stats_total = JSON.stringify(###)
(replace "###" with the data from the text file) and press "Enter"
5. Restart Chrome

Re: How to change total counter

PostPosted: Fri Oct 10, 2014 11:26 am
by mapx
Can you achieve the same result saving and restoring the file(s)
chrome-extension_cfhdojbkjhnklbpkdaibdccddilifddb_0.localstorage

?

or simply modifying the value in that file using something like:
http://sourceforge.net/projects/sqlitebrowser/

Re: How to change total counter

PostPosted: Fri Oct 10, 2014 11:49 am
by greiner
Yes, those are also valid options. Copying the whole file is probably the simplest solution, indeed. Thanks for mentioning them.

My intention here was to outline an approach that will work independently of any browser internals which tend to change every now and then.

Re: How to change total counter

PostPosted: Fri Oct 10, 2014 3:25 pm
by Merano
Many thanks for both of You. The value of counter is really hidden deeply, so indeed I had no possibility to find it without Your help. The way of saving the file of course works fine. After reinstalling Adblock with old file, the previous counter's value is preserved. But when I tried to use version given by greiner, the error occured. No data is returned after ctrl-shift-j, etc.:
got unexpected message: clickhide-deactivate options.js:94
got unexpected message: get-selectors options.js:94
copy(localStorage.stats_total)
undefined
got unexpected message: should-collapse

and pasting remembered value (using second part of hint) doesn't work either, because counter is still reseted to zero.

Re: How to change total counter

PostPosted: Fri Oct 10, 2014 6:54 pm
by greiner
Great to hear that mapx' solution worked for you.

Merano wrote:But when I tried to use version given by greiner, the error occured. No data is returned after ctrl-shift-j, etc.:
Code: Select all
got unexpected message: clickhide-deactivate options.js:94
got unexpected message: get-selectors options.js:94
copy(localStorage.stats_total)
undefined
got unexpected message: should-collapse


The "copy(…)" command already puts the data into your clipboard so you don't need to copy the data manually. Pasting the data into a text file is enough.

Re: How to change total counter

PostPosted: Fri Oct 10, 2014 9:45 pm
by Merano
OK, I understand now. Thank You for explanation.

Re: How to change total counter

PostPosted: Tue Aug 25, 2015 10:59 am
by Merano
Has something been changed in AdblockPlus? Yesterday after reinstaling I found that chrome-extension_cfhdojbkjhnklbpkdaibdccddilifddb_0.localstorage does not exist on my disk, neither works
Code: Select all
copy(localStorage.stats_total)
giving only undefined reply :(

Re: How to change total counter

PostPosted: Tue Aug 25, 2015 12:42 pm
by greiner
Merano wrote:Has something been changed in AdblockPlus? Yesterday after reinstaling I found that chrome-extension_cfhdojbkjhnklbpkdaibdccddilifddb_0.localstorage does not exist on my disk, neither works
Code: Select all
copy(localStorage.stats_total)
giving only undefined reply :(


We've switched from "localStorage" to "chrome.storage" and renamed it to "blocked_total". Therefore the best way to retrieve it is using
Code: Select all
Prefs.blocked_total
.

Re: How to change total counter

PostPosted: Tue Aug 25, 2015 2:25 pm
by Merano
Yes, now it works fine. Thanks!

Re: How to change total counter

PostPosted: Thu Jun 02, 2016 12:05 am
by AdblockPlusUser
Hello,

I like being able to reset the stats counter from time to time for a variety of reasons, but after the latest update, none of the methods described in this thread work anymore. Is there any way to do so with this latest version?

Also, is there a way to toggle the stats counter on and off?

Thanks. I hope to hear a response soon.

Re: How to change total counter

PostPosted: Thu Jun 02, 2016 12:40 am
by mapx
click ABP icon
right click that panel
inspect
console
to see the total of ads type in + enter:
Code: Select all
Prefs.blocked_total


to change the total to 123 type + enter
Code: Select all
Prefs.blocked_total=123

Re: How to change total counter

PostPosted: Thu Jun 02, 2016 12:52 am
by AdblockPlusUser
Thanks! Keep up the good work.

Re: How to change total counter

PostPosted: Fri Dec 02, 2016 9:26 am
by AdblockPlusUser
Hello,

After the latest Chrome update, none of the methods described in this thread work anymore. Is there another way to reset the total counter?

Re: How to change total counter

PostPosted: Fri Dec 02, 2016 9:47 am
by mapx
still working well.
open the inspect window right-clicking on the ABP icon.