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

Switch to last used tab #404

Conversation

pikou1995
Copy link
Contributor

#320 😁

@@ -74,7 +74,8 @@
"49-showlatestdownload": {"description": "DOWNLOADS: Show latest download"},
"50-capturescreenshot": {"description": "UTILITY: Capture current viewport screenshot"},
"51-capturefullsizescreenshot": {"description": "UTILITY: Capture full size screenshot (max height is 16,348px due to browser limitation)"},
"52-forcecapturefullsizescreenshot": {"description": "UTILITY: Force capture full size screenshot (when window is not scrollable)"}
"52-forcecapturefullsizescreenshot": {"description": "UTILITY: Force capture full size screenshot (when window is not scrollable)"},
"53-lastusedtab": {"description": "TABS: Switch to last used tab"}
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's been a while, but IIRC these are sorted alphabetically in the settings screen, meaning if you change this to 05-lastusedtab then it'll show up right after the ones for next and previous tab which is closer to where users would expect to find it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will it make a user's config loss if I sort command list? in chrome://extensions/shortcuts.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've inserted this command after 14-lasttab

* Manage usedTabInfoQueue.
*/
browser.tabs.onActivated.addListener(function (currentTab) {
usedTabInfoQueue = [usedTabInfoQueue[1], currentTab]
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! Very tricky.

Copy link
Contributor Author

@pikou1995 pikou1995 Mar 5, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Commit 4592eed28eef5efb981d22bd8c49e542ba5913d6 takes switch window into consideration.

@@ -1,6 +1,7 @@
'use strict'

import captureScreenshot from './actions/captureScreenshot'
import lastUsedTab from './actions/lastUsedTab'
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great refactor, having these separate files for actions.

Copy link
Contributor Author

@pikou1995 pikou1995 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wait a moment, it miss one situation. done.

/**
* Convert base64 data to a blob and download
*/
browser.tabs.executeScript({
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I made a refactor. Since I didn't know window is accessible in background.js😅

@crittermike crittermike merged commit 4dae7e6 into crittermike:master Mar 5, 2021
@crittermike
Copy link
Owner

I love it! Thank you so much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants