Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions src/containers.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,19 @@ async function handle(url, tabId) {
delete creatingTabs[tabId];
}
let preferences = await PreferenceStorage.getAll(true);
let OPEN_IN_CURRENT_CONTAINER_RAW = preferences.openInCurrentContainer;
//console.debug('Raw configuration variable --> ', OPEN_IN_CURRENT_CONTAINER_RAW);
if (typeof OPEN_IN_CURRENT_CONTAINER_RAW !== 'undefined') {
const OPEN_IN_CURRENT_CONTAINER = '(' + preferences.openInCurrentContainer.replace(/ /g, '') + ')/';
//console.debug('Formatted configuration variable --> ', OPEN_IN_CURRENT_CONTAINER);
if (OPEN_IN_CURRENT_CONTAINER !== '') {
let OPEN_IN_CURRENT_CONTAINER_REGEX = new RegExp(OPEN_IN_CURRENT_CONTAINER);
if (OPEN_IN_CURRENT_CONTAINER_REGEX.test(url)) {
//console.debug('URL was left in current container due to Regex--> ', url);
return;
}
}
}
let [hostMap, identities, currentTab] = await Promise.all([
Storage.get(url, preferences.matchDomainOnly),
ContextualIdentity.getAll(),
Expand Down
7 changes: 7 additions & 0 deletions src/ui-preferences/preferences.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,13 @@
"label": "Keep old tabs",
"description": "After a contained tab has been created, the old won't be closed"
},
{
"type": "string",
"name": "openInCurrentContainer",
"label": "Open in current container",
"description": "A list of domains separated by a pipe (|) which will *always* open in the current container that opened them",
"defaultValue": ""
},
{
"type": "group",
"name": "defaultContainer",
Expand Down