commit 125599d330f69f145d47e054e5e25b372c144104
parent e4764c9c99d85c49b64766ef8f353131bb518da2
Author: hackademix <giorgio@maone.net>
Date: Tue, 26 Aug 2025 10:47:10 +0200
BB 44125: Do not offer to save signatures by default in Private Browsing Mode
Diffstat:
2 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/toolkit/components/pdfjs/content/PdfjsParent.sys.mjs b/toolkit/components/pdfjs/content/PdfjsParent.sys.mjs
@@ -175,6 +175,8 @@ export class PdfjsParent extends JSWindowActorParent {
return this.#getSignatures(data);
case "delete":
return this.#deleteSignature(data);
+ case "isVolatile":
+ return lazy.PrivateBrowsingUtils.isBrowserPrivate(this.browser);
default:
return null;
}
diff --git a/toolkit/components/pdfjs/content/web/viewer.mjs b/toolkit/components/pdfjs/content/web/viewer.mjs
@@ -2087,6 +2087,9 @@ class SignatureStorage {
async size() {
return (await this.getAll()).size;
}
+ async isVolatile() {
+ return await this.#handleSignature({action: "isVolatile"});
+ }
async create(data) {
if (await this.isFull()) {
return null;
@@ -13970,7 +13973,8 @@ class SignatureManager {
this.#uiManager.removeEditListeners();
const isStorageFull = this.#isStorageFull = await this.#signatureStorage.isFull();
this.#saveContainer.classList.toggle("fullStorage", isStorageFull);
- this.#saveCheckbox.checked = !isStorageFull;
+ const isVolatile = await this.#signatureStorage.isVolatile();
+ this.#saveCheckbox.checked = !(isStorageFull || isVolatile);
await this.#overlayManager.open(this.#dialog);
const tabType = this.#tabButtons.get("type");
tabType.focus();