dhowe / AdNauseam

AdNauseam: Fight back against advertising surveillance
GNU General Public License v3.0
4.45k stars 187 forks source link

AdVault export problem #2503

Open TirOFlanc opened 5 months ago

TirOFlanc commented 5 months ago

I tried to reproduce the issue when...

Description

When I click on the "Export" button in the "AdVault" window, nothing happens.

I would like to know if there is a way to export the AdVault manually?

URL(s) where the issue occurs.

No response

Screenshot(s)

No response

Steps to Reproduce

No response

Configuration

I'm running AdNauseam version 3.18.0, Brave 1.47.186, Windows 7 x64.

dhowe commented 5 months ago

There is no dialog/confirm after the ads are exported -- my guess (pls confirm) is that you have many json files in your downloads folder now...

mneunomne commented 5 months ago

I tested it using Brave and Adnauseam v3.18.0 as you mentioned. Could not reproduce the issue. Some possible issues might be occuring:

TirOFlanc commented 5 months ago

There is no dialog/confirm after the ads are exported -- my guess (pls confirm) is that you have many json files in your downloads folder now...

I really liked this explanation. I was already imagining the mind-boggling number of json files as I desperately clicked on "Export", but unfortunately there were no files anywhere.


I tested it using Brave and Adnauseam v3.18.0 as you mentioned. Could not reproduce the issue. Some possible issues might be occuring:

  • too many ads are being selected? (need to test)
  • Windows OS specific problem

I do have a lot of ads, but I've tested the export by setting the selection to an empty ad period and it doesn't work any more.

image


Thank you for taking the time to think about this. If you ever know of another way to retrieve this json, I plan to abandon Windows 7 very soon to go to Windows 11, but I'd like not to leave empty-handed.

image

mneunomne commented 5 months ago

@TirOFlanc is there any errors in the console?

All the ads will be exported regardless of the selected area actually, so maybe thats indeed the problem. 33k ads its indeed a lot.

TirOFlanc commented 5 months ago

Nothing at all in the console when I click on "Export".

When I click on "Delete dead ads" I get this: image

TirOFlanc commented 5 months ago

This is when I click on "Export" (I don't know if there's an answer there).

image

mneunomne commented 5 months ago

Can you try the following:

Paste this on the console of the vault, see what happens:

vAPI.messaging.send('dashboard', {
  what: 'backupUserData',
}).then((data) => {
  console.log("done", data)  
}).catch((err) => {
  console.error("error", err)  
});
TirOFlanc commented 5 months ago

I'm not sure I know how to read and understand what that means, but I have a feeling it's reaching the timeout?

image

I'll try your code and report back to you, thanks.

TirOFlanc commented 5 months ago

Here's the result (right-click "Save As")

dkoaabhijcomjinndlgbmfnmnjnmdeeb-1705329448117.log

mneunomne commented 5 months ago

Then try this, see if you can download the file, it seems that the data was indeed being shown there in the console:

vAPI.messaging.send('dashboard', {
        what: 'backupUserData',
    }).then((data) => {
    console.log("done", data)

    var jsonData = JSON.stringify(data.userData, null, '  ')
    let filename = "adnauseam-download-test";
    const url = URL.createObjectURL(new Blob([jsonData], { type: "text/plain" }));

    vAPI.download({
      'url': url,
      'filename': filename
    });
}).catch((err) => {
  console.error("error", err)  
});
TirOFlanc commented 5 months ago

Yes, this time I get the registration window.

image

Does this file correspond to my ad collection that I'll be able to import into my new installation? (Or is it just an intermediate result for the moment?).

mneunomne commented 5 months ago

Ah good! yes. But I just named it wrongly. change it to:

AdNauseam_AdsNauseam_15.10.202416.16.16.json

Check if the file contains a json file with the list of ads. Maybe you can try to test it in another browser profile, or different browser, to see if the import will work or not.

TirOFlanc commented 5 months ago

Ok well, I'll test the import before overwriting everything just to be sure.

If there's a problem, I'll get back to you. Otherwise, consider the problem solved.

Were you able to figure out what was blocking the export?

mneunomne commented 5 months ago

No, but need to check what is happening. If you don't mind sharing your exported ads file so I could potentially reproduce this, but I understand if you don't want to for privacy reasons. Send me to alberto.harres at gmail.com if you have no problem with that.

TirOFlanc commented 5 months ago

I haven't tested the import yet, but if you compare it with an old backup, you'll see that it also exports the extension settings.

image

TirOFlanc commented 5 months ago

What should I change in the code above to export only the ads?

TirOFlanc commented 4 months ago

Hi, there,

It's me again. I wanted to redo a backup today as previously stated but I couldn't.

Other problems occurred. Here are some screenshots showing them:

advault1 advault2 advault3

The ads no longer display at all and the code you gave me no longer gives any results. I'll email you the file I created last time. Thank you.

TirOFlanc commented 4 months ago

Hi there,

Yesterday I imported my Brave profile (%AppData%\local\BraveSoftware...) into a freshly downloaded Brave portable (v1.47.186) (latest version supporting Windows 7), on a Windows 7 laptop too, with AdNauseam v3.18 then v3.20.

I encountered the same problem, namely that the ads don't display in the Vault as seen in the message just above.

I tried again, this time importing the file you'd managed to get me to generate via your JS code (which I emailed you), same problem.

I tried with an old backup of my AdVault that I had saved from October 10, 2023 and the export works without a hitch.

image

Thank you.

mneunomne commented 4 months ago

hello @TirOFlanc, I'm trying to fix the data that you have sent me by email, I'll ket you know when I manage to fix it. It seems that there was some issue with the control characters that is not making possible to re-import. I'm trying to clean the file so you can re-import once again.

mneunomne commented 4 months ago

@TirOFlanc I managed to fix the exported JSON file. I will send you back the corrected file by email right away.

TirOFlanc commented 4 months ago

Hi there,

Thanks for the reply.

I tried importing into a new brave installation but it didn't work.

Capture1 Capture2

Would it be possible to ensure that, when the AdVault is exported, unauthorized characters (those not in a predefined list, for example) are simply deleted to avoid any problems of this kind?

Thank you for your help.