mirror of
https://github.com/zen-browser/desktop.git
synced 2026-06-13 15:03:41 +00:00
gh-13982: fix boosts size override not resetting zoom to default after disabling it (gh-14091)
This commit is contained in:
@@ -638,7 +638,7 @@ ${cssSelector} {
|
||||
/**
|
||||
* Handles the size toggle button press, cycling through size override options
|
||||
*/
|
||||
onBoostSizePressed() {
|
||||
async onBoostSizePressed() {
|
||||
if (this.currentBoostData.sizeOverride == 1) {
|
||||
this.currentBoostData.sizeOverride = 1.1;
|
||||
} else if (this.currentBoostData.sizeOverride == 1.1) {
|
||||
@@ -649,6 +649,12 @@ ${cssSelector} {
|
||||
this.currentBoostData.sizeOverride = 0.9;
|
||||
} else if (this.currentBoostData.sizeOverride == 0.9) {
|
||||
this.currentBoostData.sizeOverride = 1;
|
||||
|
||||
const linkedBrowser =
|
||||
this.openerWindow.gBrowser.selectedTab.linkedBrowser;
|
||||
const actor =
|
||||
linkedBrowser.browsingContext.currentWindowGlobal.getActor("ZenBoosts");
|
||||
await actor.sendQuery("ZenBoost:DisableSizeOverride");
|
||||
}
|
||||
|
||||
this.updateSizeButtonVisuals();
|
||||
|
||||
@@ -280,6 +280,9 @@ export class ZenBoostsChild extends JSWindowActorChild {
|
||||
case "ZenBoost:OpenInspector":
|
||||
this.sendAsyncMessage("ZenBoost:OpenInspector");
|
||||
break;
|
||||
case "ZenBoost:DisableSizeOverride":
|
||||
this.disableSizeOverride();
|
||||
break;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
@@ -549,6 +552,14 @@ export class ZenBoostsChild extends JSWindowActorChild {
|
||||
this.sendNotify("selector-picker-state-update", "ondisable");
|
||||
}
|
||||
|
||||
disableSizeOverride() {
|
||||
const browsingContext = this.browsingContext;
|
||||
if (!browsingContext || browsingContext.parent !== null) {
|
||||
return;
|
||||
}
|
||||
browsingContext.fullZoom = 1;
|
||||
}
|
||||
|
||||
sendNotify(topic, msg = null) {
|
||||
this.sendAsyncMessage("ZenBoost:Notify", { topic, msg });
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user