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

detach/attach tabs #47

Closed
wmertens opened this issue Oct 22, 2018 · 2 comments

Comments

@wmertens
Copy link

commented Oct 22, 2018

I don't have time right now to make a PR for the tabs plugin, but I wrote a quick extension to detach a tab and also to attach all tabs from a window.

The attaching doesn't always work but the detach seems ok.

This is the relevant code:

detach:

     chrome.tabs.getSelected(null, t => {
        if (t.id >= 0)
	        chrome.windows.create({tabId: t.id, focused: true})
      })}

attach, not so great code, with deprecated calls:

		chrome.windows.getLastFocused(null, ({id}) =>
          chrome.tabs.getAllInWindow(id, newTabs =>
			chrome.windows.getCurrent(({id:windowId}) =>
	          chrome.tabs.getAllInWindow(windowId, currentTabs => {
	            let i = currentTabs.length
    	        newTabs.forEach(({id: tabId}) =>
					chrome.tabs.move(tabId, {windowId, index: i++}, console.log)
				)
			  })
            )
          )
        )
@solobat

This comment has been minimized.

Copy link
Owner

commented Oct 23, 2018

Steward has now opened the api, and most of the plugins will be aggregated into this repo. The feature you need, I will add it into the steward-plugins repo. By then, you can install it using spm install.

@solobat

This comment has been minimized.

Copy link
Owner

commented Oct 23, 2018

The plugin has been developed and uploaded to the repository. You can install it using spm install windowtabs. The det / att commands correspond to detach and attach respectively.

@solobat solobat closed this Oct 23, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.