Merge pull request #131 from usk/duplicating-current-tab
add support for duplicating current tab
This commit is contained in:
		
						commit
						86b534b1e1
					
				
					 5 changed files with 10 additions and 1 deletions
				
			
		|  | @ -36,6 +36,7 @@ The default mappings are as follows: | ||||||
| - <kbd>r</kbd>: reload current tab | - <kbd>r</kbd>: reload current tab | ||||||
| - <kbd>R</kbd>: reload current tab without cache | - <kbd>R</kbd>: reload current tab without cache | ||||||
| - <kbd>zp</kbd>: toggle pin/unpin current tab | - <kbd>zp</kbd>: toggle pin/unpin current tab | ||||||
|  | - <kbd>zd</kbd>: duplicate current tab | ||||||
| 
 | 
 | ||||||
| ### Navigation | ### Navigation | ||||||
| - <kbd>f</kbd>: start following links in the page | - <kbd>f</kbd>: start following links in the page | ||||||
|  |  | ||||||
|  | @ -35,6 +35,8 @@ const exec = (operation, tab) => { | ||||||
|     return tabs.updateTabPinned(tab, false); |     return tabs.updateTabPinned(tab, false); | ||||||
|   case operations.TAB_TOGGLE_PINNED: |   case operations.TAB_TOGGLE_PINNED: | ||||||
|     return tabs.toggleTabPinned(tab); |     return tabs.toggleTabPinned(tab); | ||||||
|  |   case operations.TAB_DUPLICATE: | ||||||
|  |     return tabs.duplicate(tab.id); | ||||||
|   case operations.ZOOM_IN: |   case operations.ZOOM_IN: | ||||||
|     return zooms.zoomIn(); |     return zooms.zoomIn(); | ||||||
|   case operations.ZOOM_OUT: |   case operations.ZOOM_OUT: | ||||||
|  |  | ||||||
|  | @ -111,8 +111,12 @@ const toggleTabPinned = (current) => { | ||||||
|   updateTabPinned(current, !current.pinned); |   updateTabPinned(current, !current.pinned); | ||||||
| }; | }; | ||||||
| 
 | 
 | ||||||
|  | const duplicate = (id) => { | ||||||
|  |   return browser.tabs.duplicate(id); | ||||||
|  | }; | ||||||
|  | 
 | ||||||
| export { | export { | ||||||
|   closeTab, reopenTab, selectAt, selectByKeyword, getCompletions, |   closeTab, reopenTab, selectAt, selectByKeyword, getCompletions, | ||||||
|   selectPrevTab, selectNextTab, selectFirstTab, selectLastTab, reload, |   selectPrevTab, selectNextTab, selectFirstTab, selectLastTab, reload, | ||||||
|   updateTabPinned, toggleTabPinned |   updateTabPinned, toggleTabPinned, duplicate | ||||||
| }; | }; | ||||||
|  |  | ||||||
|  | @ -33,6 +33,7 @@ export default { | ||||||
|     "r": { "type": "tabs.reload", "cache": false }, |     "r": { "type": "tabs.reload", "cache": false }, | ||||||
|     "R": { "type": "tabs.reload", "cache": true }, |     "R": { "type": "tabs.reload", "cache": true }, | ||||||
|     "zp": { "type": "tabs.pin.toggle" }, |     "zp": { "type": "tabs.pin.toggle" }, | ||||||
|  |     "zd": { "type": "tabs.duplicate" }, | ||||||
|     "zi": { "type": "zoom.in" }, |     "zi": { "type": "zoom.in" }, | ||||||
|     "zo": { "type": "zoom.out" }, |     "zo": { "type": "zoom.out" }, | ||||||
|     "zz": { "type": "zoom.neutral" }, |     "zz": { "type": "zoom.neutral" }, | ||||||
|  |  | ||||||
|  | @ -42,6 +42,7 @@ export default { | ||||||
|   TAB_PIN: 'tabs.pin', |   TAB_PIN: 'tabs.pin', | ||||||
|   TAB_UNPIN: 'tabs.unpin', |   TAB_UNPIN: 'tabs.unpin', | ||||||
|   TAB_TOGGLE_PINNED: 'tabs.pin.toggle', |   TAB_TOGGLE_PINNED: 'tabs.pin.toggle', | ||||||
|  |   TAB_DUPLICATE: 'tabs.duplicate', | ||||||
| 
 | 
 | ||||||
|   // Zooms
 |   // Zooms
 | ||||||
|   ZOOM_IN: 'zoom.in', |   ZOOM_IN: 'zoom.in', | ||||||
|  |  | ||||||
		Reference in a new issue