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

Add a shortcut or other way to navigate directly to the caniuse.com feature page. #8

Open
nchutchind opened this issue Jul 7, 2016 · 2 comments

Comments

@nchutchind
Copy link

It would be nice to have an easy way to quickly open a browser window to caniuse.com/feature from VS Code. Maybe even one of the combo shortcuts that uses the CTRL+SHIFT+I as the first step, since you'll already have done it.

@nchutchind
Copy link
Author

I ended up modifying my local installation of the plugin to add the ability to open caniuse.com for the feature I'm selecting. I just added another activation method that does the same thing as the "disposable" method for "extension.canIUse", but instead of calling caniuse.retrieveInformation, I have the following:

var openCommand = '';
if (process.platform == 'darwin') {
    openCommand = 'open ';
} else if (process.platform == 'win32') {
    openCommand = 'start ';
} else {
    return;
}
exec(openCommand + "http://caniuse.com/" + word);

I activate the canIUse method on "CTRL+SHIFT+I I" and open the browser for caniuse.com/feature on "CTRL+SHIFT+I O". I don't think most people would really like having to do two keystrokes for the default functionality, though. This is easy enough to leave to configuration for the user, though, as I could have just as easily mapped the two commands to different shortcuts.

If I had more time, I'd do a pull request, but hopefully this is helpful for now.

@nchutchind
Copy link
Author

Made pull request #9 for this.

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

No branches or pull requests

2 participants