Download spam prevention should not affect browser extensions
It was fine, until now. In the latest Tor version my extension that takes screenshot no more works. Tor can save only one file until the browser restarts.
For example, here a simple extension: https://uploadir.com/89475/e2vUI6Gfhv Install it, open its popup and click on the "Save Screenshot" button multiple times. It will save one one screenshot.
The problem it that Tor blocks the downloading for the extension after one file is downloaded. Also, my extension downloads files in the background script, so, in the Tor's download popup there is no warning about blocking, and I can't unblock downloading.
You can reproduce this bug with the other extensions too. For example, "inspect" uBlock Origin. Run in its background script's console the follow code two times:
function downloadBlob(blob, name,) {
const anchor = document.createElement("a");
anchor.setAttribute("download", name || "");
const blobUrl = URL.createObjectURL(blob);
anchor.href = blobUrl;
anchor.click();
setTimeout(() => URL.revokeObjectURL(blobUrl), 3000);
}
downloadBlob(new Blob(["xxx"]), "xx.txt");
It will save only one file. The second one will be silently blocked.
Then open uBlock Origin's options page ("dashboard.html"). And run the code snippet there.
In this case the warning will appear. So, I can unblock downloading. But it allows to download only the follow images, and this option is not persist.
I sure, it's a bug, the downloading from extensions should not be blocked.