Page 1 of 2

How to backup and restore Whitelisted domains ?

Posted: Tue Jan 05, 2016 4:24 pm
by akkha
Thank You

Re: How to backup and restore Whitelisted domains ?

Posted: Tue Jan 05, 2016 5:26 pm
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,

Re: How to backup and restore Whitelisted domains ?

Posted: Tue Jan 05, 2016 6:08 pm
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

Re: How to backup and restore Whitelisted domains ?

Posted: Wed Jan 06, 2016 4:12 am
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

Re: How to backup and restore Whitelisted domains ?

Posted: Wed Jan 06, 2016 10:18 am
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. :)

Re: How to backup and restore Whitelisted domains ?

Posted: Wed Jan 06, 2016 1:42 pm
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)

Re: How to backup and restore Whitelisted domains ?

Posted: Thu May 19, 2016 10:52 am
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);

Re: How to backup and restore Whitelisted domains ?

Posted: Wed Aug 17, 2016 6:16 pm
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.

Re: How to backup and restore Whitelisted domains ?

Posted: Thu Oct 13, 2016 10:55 am
by Sverigen
mapx thanks! Your version worked fine for me. Successefully saved my own "white list" ;)

Re: How to backup and restore Whitelisted domains ?

Posted: Fri Dec 23, 2016 5:29 pm
by Bulldog
Doesn't work:

Uncaught ReferenceError: backgroundPage is not defined

Re: How to backup and restore Whitelisted domains ?

Posted: Tue Sep 04, 2018 10:06 am
by lailatao
I pasted these above code but it doesnt work :roll:

Re: How to backup and restore Whitelisted domains ?

Posted: Tue Dec 03, 2019 9:39 pm
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!

Re: How to backup and restore Whitelisted domains ?

Posted: Mon Feb 17, 2020 4:02 am
by roketslk
Just what I was needing!

thanks

Re: How to backup and restore Whitelisted domains ?

Posted: Mon Mar 23, 2020 3:49 pm
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!

Re: How to backup and restore Whitelisted domains ?

Posted: Thu Apr 02, 2020 3:06 pm
by nasar
A very simple way would be to save all the links in a notepad then restore them after installing the adp again.