Skip to content

Commit 0e244b0

Browse files
committed
Fix #12074: Preserve container when opening View Page Source
When 'View Page Source' is triggered from a container tab, the view-source tab now inherits the userContextId from the originating tab. This ensures that the source view maintains the same authentication/session context as the original page. The fix checks if a view-source URL is being opened without an explicit userContextId parameter and automatically inherits it from the currently selected tab before processing through Zen's workspace/container logic.
1 parent 1c23ad9 commit 0e244b0

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

src/browser/components/tabbrowser/content/tabbrowser-js.patch

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,17 @@ index 0eaca7a58e0026237b71b2ad515efe84d9e8c779..2ab8633d0378e5a25cf75c50b29d4689
266266
);
267267
}
268268

269+
+ if (
270+
+ userContextId === undefined &&
271+
+ aURI?.spec?.startsWith("view-source:") &&
272+
+ this.selectedTab
273+
+ ) {
274+
+ const selectedUserContextId = this.selectedTab.getAttribute("usercontextid");
275+
+ if (selectedUserContextId) {
276+
+ userContextId = parseInt(selectedUserContextId, 10);
277+
+ }
278+
+ }
279+
+
269280
+ let hasZenDefaultUserContextId = false;
270281
+ let zenForcedWorkspaceId = undefined;
271282
+ if (typeof gZenWorkspaces !== "undefined" && !_forZenEmptyTab) {

0 commit comments

Comments
 (0)