How to backup and restore Whitelisted domains ?

Everything about using Adblock Plus on Google Chrome
akkha
Posts: 2
Joined: Tue Jan 05, 2016 4:20 pm

How to backup and restore Whitelisted domains ?

Post by akkha »

Thank You
rach
Posts: 310
Joined: Tue Nov 17, 2015 10:05 am

Re: How to backup and restore Whitelisted domains ?

Post by rach »

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

Re: How to backup and restore Whitelisted domains ?

Post by mapx »

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
akkha
Posts: 2
Joined: Tue Jan 05, 2016 4:20 pm

Re: How to backup and restore Whitelisted domains ?

Post by akkha »

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
rach
Posts: 310
Joined: Tue Nov 17, 2015 10:05 am

Re: How to backup and restore Whitelisted domains ?

Post by rach »

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. :)
User avatar
mapx
Posts: 21940
Joined: Thu Jan 06, 2011 2:01 pm

Re: How to backup and restore Whitelisted domains ?

Post by mapx »

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: 21940
Joined: Thu Jan 06, 2011 2:01 pm

Re: How to backup and restore Whitelisted domains ?

Post by mapx »

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);
JoVadar
Posts: 6
Joined: Wed Aug 17, 2016 6:09 pm
Location: LA
Contact:

Re: How to backup and restore Whitelisted domains ?

Post by JoVadar »

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.
User avatar
Sverigen
Posts: 2
Joined: Thu Oct 13, 2016 10:14 am
Location: Sweden
Contact:

Re: How to backup and restore Whitelisted domains ?

Post by Sverigen »

mapx thanks! Your version worked fine for me. Successefully saved my own "white list" ;)
Bulldog
Posts: 14
Joined: Sun Apr 10, 2011 4:47 am

Re: How to backup and restore Whitelisted domains ?

Post by Bulldog »

Doesn't work:

Uncaught ReferenceError: backgroundPage is not defined
lailatao
Posts: 1
Joined: Tue Sep 04, 2018 10:02 am
Location: ha noi
Contact:

Re: How to backup and restore Whitelisted domains ?

Post by lailatao »

I pasted these above code but it doesnt work :roll:
sacrabro
Posts: 2
Joined: Wed Nov 20, 2019 8:58 pm

Re: How to backup and restore Whitelisted domains ?

Post by sacrabro »

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!
roketslk
Posts: 1
Joined: Mon Feb 17, 2020 3:49 am
Contact:

Re: How to backup and restore Whitelisted domains ?

Post by roketslk »

Just what I was needing!

thanks
spdload
Posts: 1
Joined: Mon Mar 23, 2020 3:47 pm
Contact:

Re: How to backup and restore Whitelisted domains ?

Post by spdload »

Thanks so much!

I had the same question and find it just easily in the first post. Exactly, what I was looked for.

Cheers!
nasar
Posts: 8
Joined: Mon Mar 30, 2020 11:47 am

Re: How to backup and restore Whitelisted domains ?

Post by nasar »

A very simple way would be to save all the links in a notepad then restore them after installing the adp again.
Post Reply