Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Specify opener tab information to new temporary container tabs opened from links #471

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 7 additions & 1 deletion src/background/container.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ export class Container {
dontPin = true,
deletesHistory = false,
macConfirmPage = false,
openerTab,
}: TmpTabOptions): Promise<Tab | undefined> {
if (request && request.requestId) {
// we saw that request already
Expand Down Expand Up @@ -98,6 +99,7 @@ export class Container {
dontPin,
macConfirmPage,
contextualIdentity,
openerTab,
});
}

Expand Down Expand Up @@ -165,13 +167,15 @@ export class Container {
dontPin,
macConfirmPage,
contextualIdentity,
openerTab,
}: {
url?: string;
tab?: Tab;
active?: boolean;
dontPin?: boolean;
macConfirmPage?: boolean;
contextualIdentity: browser.contextualIdentities.ContextualIdentity;
openerTab?: Tab;
}): Promise<Tab> {
try {
const newTabOptions: CreateTabOptions = {
Expand Down Expand Up @@ -212,7 +216,9 @@ export class Container {
if (tab.pinned && !dontPin) {
newTabOptions.pinned = true;
}
if (tab.openerTabId) {
if (openerTab) {
newTabOptions.openerTabId = openerTab.id;
} else if (tab.openerTabId) {
newTabOptions.openerTabId = tab.openerTabId;
}
if (tab.windowId) {
Expand Down
2 changes: 2 additions & 0 deletions src/background/contextmenu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ export class ContextMenu {
active: false,
deletesHistory:
this.pref.deletesHistory.automaticMode === 'automatic',
openerTab: tab,
});
break;

Expand All @@ -39,6 +40,7 @@ export class ContextMenu {
url: info.linkUrl,
active: false,
deletesHistory: true,
openerTab: tab,
});
break;

Expand Down
1 change: 1 addition & 0 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ export interface TmpTabOptions {
dontPin?: boolean;
deletesHistory?: boolean;
macConfirmPage?: boolean;
openerTab?: Tab;
}

export type IsolationAction =
Expand Down