diff --git a/src/ZenWorkspaces.mjs b/src/ZenWorkspaces.mjs index 58fe842..3989481 100644 --- a/src/ZenWorkspaces.mjs +++ b/src/ZenWorkspaces.mjs @@ -874,10 +874,19 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature { }); } - getContextIdIfNeeded(userContextId) { + getContextIdIfNeeded(userContextId, fromExternal, allowInheritPrincipal) { + if(!this.workspaceEnabled) { + return [userContextId, false]; + } + const activeWorkspace = this.getActiveWorkspaceFromCache(); const activeWorkspaceUserContextId = activeWorkspace?.containerTabId; - if ((typeof userContextId !== 'undefined' && userContextId !== activeWorkspaceUserContextId) || !this.workspaceEnabled) { + + if((fromExternal || allowInheritPrincipal === false) && !!activeWorkspaceUserContextId) { + return [activeWorkspaceUserContextId, true]; + } + + if (typeof userContextId !== 'undefined' && userContextId !== activeWorkspaceUserContextId) { return [userContextId, false]; } return [activeWorkspaceUserContextId, true];