How to change total counter

Everything about using Adblock Plus on Google Chrome

How to change total counter

Postby Merano » Thu Oct 09, 2014 8:51 pm

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?
Merano
 
Posts: 5
Joined: Thu Oct 09, 2014 8:38 pm

Re: How to change total counter

Postby greiner » Fri Oct 10, 2014 11:11 am

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
User avatar
greiner
ABP Developer
 
Posts: 636
Joined: Mon Sep 03, 2012 5:29 pm
Location: Cologne, Germany

Re: How to change total counter

Postby mapx » Fri Oct 10, 2014 11:26 am

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/
User avatar
mapx
 
Posts: 20934
Joined: Thu Jan 06, 2011 3:01 pm

Re: How to change total counter

Postby greiner » Fri Oct 10, 2014 11:49 am

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.
User avatar
greiner
ABP Developer
 
Posts: 636
Joined: Mon Sep 03, 2012 5:29 pm
Location: Cologne, Germany

Re: How to change total counter

Postby Merano » Fri Oct 10, 2014 3:25 pm

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.
Merano
 
Posts: 5
Joined: Thu Oct 09, 2014 8:38 pm

Re: How to change total counter

Postby greiner » Fri Oct 10, 2014 6:54 pm

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.
User avatar
greiner
ABP Developer
 
Posts: 636
Joined: Mon Sep 03, 2012 5:29 pm
Location: Cologne, Germany

Re: How to change total counter

Postby Merano » Fri Oct 10, 2014 9:45 pm

OK, I understand now. Thank You for explanation.
Merano
 
Posts: 5
Joined: Thu Oct 09, 2014 8:38 pm

Re: How to change total counter

Postby Merano » Tue Aug 25, 2015 10:59 am

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 :(
Merano
 
Posts: 5
Joined: Thu Oct 09, 2014 8:38 pm

Re: How to change total counter

Postby greiner » Tue Aug 25, 2015 12:42 pm

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
.
User avatar
greiner
ABP Developer
 
Posts: 636
Joined: Mon Sep 03, 2012 5:29 pm
Location: Cologne, Germany

Re: How to change total counter

Postby Merano » Tue Aug 25, 2015 2:25 pm

Yes, now it works fine. Thanks!
Merano
 
Posts: 5
Joined: Thu Oct 09, 2014 8:38 pm

Re: How to change total counter

Postby AdblockPlusUser » Thu Jun 02, 2016 12:05 am

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.
AdblockPlusUser
 
Posts: 5
Joined: Thu Feb 04, 2016 2:17 am

Re: How to change total counter

Postby mapx » Thu Jun 02, 2016 12:40 am

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
User avatar
mapx
 
Posts: 20934
Joined: Thu Jan 06, 2011 3:01 pm

Re: How to change total counter

Postby AdblockPlusUser » Thu Jun 02, 2016 12:52 am

Thanks! Keep up the good work.
AdblockPlusUser
 
Posts: 5
Joined: Thu Feb 04, 2016 2:17 am

Re: How to change total counter

Postby AdblockPlusUser » Fri Dec 02, 2016 9:26 am

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?
AdblockPlusUser
 
Posts: 5
Joined: Thu Feb 04, 2016 2:17 am

Re: How to change total counter

Postby mapx » Fri Dec 02, 2016 9:47 am

still working well.
open the inspect window right-clicking on the ABP icon.
User avatar
mapx
 
Posts: 20934
Joined: Thu Jan 06, 2011 3:01 pm

Next

Return to Adblock Plus for Chrome support

Who is online

Users browsing this forum: No registered users and 18 guests