-
Notifications
You must be signed in to change notification settings - Fork 76
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
[popup] Add option to open extension pages in new tab using keyboard shortcuts #158
[popup] Add option to open extension pages in new tab using keyboard shortcuts #158
Conversation
Hi @toly11 , At first I was thinking that is functionality il already covered by this one. This being said, it means that the shortcuts did not use the parameter I added in v1.17 to open all links into a new tab. Could you update your PR to:
getLinkTarget(e) {
if (localStorage.getItem("openLinksInNewTab") == "true" || (e.ctrlKey || e.metaKey)){
return "_blank";
} else {
return "_top";
}
} This new functionality will be hidden and can be missed if someone does not read the release note or checks the PR. If you're interested, you can update the file in this PR. |
Respect user preference for link targets
Hey @tprouvot, I have update the CHANGES.md file and moved the logic to a separate function. I chose to write it as a separate function instead of as a class method since I can see this code being used by other components too in the future. I think it could be great if there will be a general documentation area for all the extension's features which can include a "how to" section, If that makes sense |
addon/popup.js
Outdated
@@ -79,29 +79,32 @@ class App extends React.PureComponent { | |||
} | |||
if (e.key == "e") { | |||
e.preventDefault(); | |||
this.refs.dataExportBtn.target = (e.ctrlKey || e.metaKey) ? "_blank" : "_top"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use the created function to get the target
this.refs.dataExportBtn.target = (e.ctrlKey || e.metaKey) ? "_blank" : "_top"; | |
this.refs.dataExportBtn.target = this.getLinkTarget(e); | |
Remove extra breakline
Description
In the current implementation, navigating to the Export and Import pages through keyboard shortcuts (
Ctrl+Option+I
on Mac orCtrl+Alt+I
on Windows, followed byE
orI
) only allows users to open these pages in the current tab.Opening these pages in the current tab disrupts the user flow
In order to open the page in a new tab, users have to resort to using a combination of keyboard commands and mouse clicks which is not ideal. (control or command + mouse click).
Enhancement
This pull request introduces an enhancement to the existing keyboard shortcut functionalities, allowing users to open the extension pages in a new tab seamlessly. By holding the Command key (on Mac) or Control key (on Windows) in conjunction with the existing shortcut keys, users can now open the extension pages in a new tab, thereby preserving their position on the current page and facilitating a smoother navigation experience.
Testing
This feature has been tested across different environments to ensure compatibility and smooth integration with existing functionalities. I encourage further testing to validate its efficiency and usability enhancements.
Request for Review
I kindly request a review of this pull request and am open to making any necessary adjustments based on your feedback. Thank you for considering this valuable enhancement to the user experience.