How to backup and restore Whitelisted domains ?

Everything about using Adblock Plus on Google Chrome

How to backup and restore Whitelisted domains ?

Postby akkha » Tue Jan 05, 2016 5:24 pm

Thank You
akkha
 
Posts: 2
Joined: Tue Jan 05, 2016 5:20 pm

Re: How to backup and restore Whitelisted domains ?

Postby rach » Tue Jan 05, 2016 6:26 pm

Hey akkha,

Thanks for your message.
It should work when run in the context of the options page: location.href = "data:text/plain," + encodeURIComponent(backgroundPage.getUserFilters().exceptions.join("\n"))
All the best,
rach
ABP Community Manager
 
Posts: 310
Joined: Tue Nov 17, 2015 11:05 am

Re: How to backup and restore Whitelisted domains ?

Postby mapx » Tue Jan 05, 2016 7:08 pm

some details:
click ABP icon, options
press ctrl-shift-i (go into console)
paste this code there:
Code: Select all
location.href = "data:text/plain," + encodeURIComponent(backgroundPage.getUserFilters().exceptions.join("\n"))

press enter
a new tab opens with the list of whitelisted domains
User avatar
mapx
 
Posts: 21947
Joined: Thu Jan 06, 2011 3:01 pm

Re: How to backup and restore Whitelisted domains ?

Postby akkha » Wed Jan 06, 2016 5:12 am

Thank You all especially mapx for the detail.

Also how to restore whitelisted domains?

I have to add one by one in: Options -> Whitelisted domains -> + Add domain

Are there anyway to add them all at once ?

Thank You
akkha
 
Posts: 2
Joined: Tue Jan 05, 2016 5:20 pm

Re: How to backup and restore Whitelisted domains ?

Postby rach » Wed Jan 06, 2016 11:18 am

Hey akkha!

You are welcome.
Just copy and paste the domains: .split("\n").forEach(function(domain){FilterStorage.addFilter(Filter.fromText(`@@||${domain}^$document`));}) into the spot that says "insert-domains-here"

Let us know in case you have any other question. :)
rach
ABP Community Manager
 
Posts: 310
Joined: Tue Nov 17, 2015 11:05 am

Re: How to backup and restore Whitelisted domains ?

Postby mapx » Wed Jan 06, 2016 2:42 pm

again in the console (where the first part consists of the list of whitelisted domains previously saved):

example

Code: Select all
`abc.com
def.com
ghi.com`
.split("\n").forEach(function(domain){FilterStorage.addFilter(Filter.fromText(`@@||${domain}^$document`));})


(Courtesy of rach + thomas greiner)
User avatar
mapx
 
Posts: 21947
Joined: Thu Jan 06, 2011 3:01 pm

Re: How to backup and restore Whitelisted domains ?

Postby mapx » Thu May 19, 2016 10:52 am

The new valid way for save / restore:

save:
Code: Select all
getSubscriptions(false, true, function(subscriptions)
{
  var exceptions = [];
  var count = subscriptions.length;

  subscriptions.forEach(function(subscription)
  {
    getFilters(subscription.url, function(filters)
    {
      filters.forEach(function(filter)
      {
        if (/^@@\|\|([^\/:]+)\^\$document$/.test(filter.text))
          exceptions.push(filter.text);
      });

      if (--count == 0)
        location.href = "data:text/plain," + encodeURIComponent(exceptions.join("\n"))
    });
  });
});


restore:
Code: Select all
importRawFilters(
`abc.com
def.com
ghi.com`.replace(/^.*$/gm, function(domain) { return `@@||${domain}^$document`; }), false);
User avatar
mapx
 
Posts: 21947
Joined: Thu Jan 06, 2011 3:01 pm

Re: How to backup and restore Whitelisted domains ?

Postby JoVadar » Wed Aug 17, 2016 6:16 pm

Ah ha! This is the function i've been looking for, for a long while! I have a huge list of whitelisted domains (some of which need the extra add revenue to operate) so good to know when I upgrade next month I can have it all backed up without hassle of going through and whitelisting a bunch all over again.
JoVadar
 
Posts: 6
Joined: Wed Aug 17, 2016 6:09 pm
Location: LA

Re: How to backup and restore Whitelisted domains ?

Postby Sverigen » Thu Oct 13, 2016 10:55 am

mapx thanks! Your version worked fine for me. Successefully saved my own "white list" ;)
User avatar
Sverigen
 
Posts: 2
Joined: Thu Oct 13, 2016 10:14 am
Location: Sweden

Re: How to backup and restore Whitelisted domains ?

Postby Bulldog » Fri Dec 23, 2016 6:29 pm

Doesn't work:

Uncaught ReferenceError: backgroundPage is not defined
Bulldog
 
Posts: 14
Joined: Sun Apr 10, 2011 4:47 am

Re: How to backup and restore Whitelisted domains ?

Postby lailatao » Tue Sep 04, 2018 10:06 am

I pasted these above code but it doesnt work :roll:
lailatao
 
Posts: 1
Joined: Tue Sep 04, 2018 10:02 am
Location: ha noi

Re: How to backup and restore Whitelisted domains ?

Postby sacrabro » Tue Dec 03, 2019 10:39 pm

Open Google Chrome and press Settings and go to the menu in Google Chrome > Bookmarks. Chose Bookmark Manager and press CTRL + Shift + O on the keyboard. Choose the directory for saving the file and press Save. You’re done!
sacrabro
 
Posts: 2
Joined: Wed Nov 20, 2019 9:58 pm


Return to Adblock Plus for Chrome support

Who is online

Users browsing this forum: No registered users and 10 guests