mirror of
https://github.com/vale981/tridactyl
synced 2025-03-06 01:51:40 -05:00
Add container support for winopen
This commit is contained in:
parent
b1cc20cc4a
commit
d9ac0cf2c5
2 changed files with 13 additions and 3 deletions
|
@ -2291,6 +2291,7 @@ export async function tabopen(...addressarr: string[]): Promise<browser.tabs.Tab
|
|||
args.shift()
|
||||
argParse(args)
|
||||
} else if (args[0] === "-c") {
|
||||
if (args.length < 2) throw new Error(`You must provide a container name!`)
|
||||
// Ignore the -c flag if incognito as containers are disabled.
|
||||
if (!win.incognito) {
|
||||
if (args[1] === "firefox-default" || args[1].toLowerCase() === "none") {
|
||||
|
@ -2729,6 +2730,8 @@ export async function mute(...muteArgs: string[]): Promise<void> {
|
|||
*
|
||||
* `winopen -popup [...]` will open it in a popup window. You can combine the two for a private popup.
|
||||
*
|
||||
* `winopen -c containername [...]` will open the result in a container while ignoring other options given. See [[tabopen]] for more details on containers.
|
||||
*
|
||||
* Example: `winopen -popup -private ddg.gg`
|
||||
*/
|
||||
//#background
|
||||
|
@ -2740,15 +2743,20 @@ export async function winopen(...args: string[]) {
|
|||
switch (args[0]) {
|
||||
case "-private":
|
||||
createData.incognito = true
|
||||
args = args.slice(1, args.length)
|
||||
args.shift()
|
||||
firefoxArgs = "--private-window"
|
||||
break
|
||||
|
||||
case "-popup":
|
||||
createData.type = "popup"
|
||||
args = args.slice(1, args.length)
|
||||
args.shift()
|
||||
break
|
||||
|
||||
case "-c":
|
||||
if (args.length < 2) throw new Error(`You must provide a container name!`)
|
||||
args.shift()
|
||||
return composite(`tabopen -c ${args.join(" ")} | sleep 100 | tabdetach`)
|
||||
|
||||
default:
|
||||
done = true
|
||||
break
|
||||
|
|
|
@ -12,5 +12,7 @@ The perceived benefits of this feature are as described by the Firefox Test Pilo
|
|||
* `containerupdate name newname color icon` Updates the container.
|
||||
* `containerclose name` Closes all tabs in a specified container.
|
||||
* `containerdelete name` Deletes a container, calls `containerclose` before deletion
|
||||
* `tabopen -c name [url]` Opens a new tab in the container called `name`
|
||||
* `winopen -c name [url]` Opens a new window in the container called `name`
|
||||
|
||||
The <a href='./7-native_messenger.html' rel='next'>next page</a> is about the native messenger. <a href='./5-settings.html' rel="prev"></a>
|
||||
|
|
Loading…
Add table
Reference in a new issue