Shortcuts Guard

The shortcuts of IDEs developed based on OpenSumi conflict with those of Chrome, which makes the corresponding actions of IDEs unable to take effect. For example, the Ctrl/Cmd + W shortcut will close the current browser tab, making IDEs unable to handle this shortcut event. Shortcuts Guard solve the most common used shortcuts conflict.

popup page

Usage

  • Go to the release page of the extension repository or the Chrome Web Store to get the extension.
  • Click the Chrome Extension icon, and then there is a popup page.
  • Add a URL which can be a match pattern on the popup page where the extension will guard the IDE shortcuts.
  • Click the keyboard icon on the upper right corner of the popup page to go to the shortcut settings page, and then input the conflicting shortcuts.

Match patterns

Support clicking the pencil button in the new URL input box on the popup page to automatically obtain the match pattern of the current browser page URL into the input box.

Basic Syntax

<url-pattern> := <scheme>://<host><path>
<scheme> := '*' | 'http' | 'https'
<host> := '*' | '*.' <any char except '/' and '*'>+
<path> := '/' <any chars>

Examples

PatternWhat it doesExamples of matching URLs
https://*/*Matches any URL that uses the https schemehttps://www.google.com/
https://example.org/foo/bar.html
https://*/foo*Matches any URL that uses the https scheme, on any host, as long as the path starts with /foohttps://example.com/foo/bar.html
https://www.google.com/foo
https://*.google.com/foo*barMatches any URL that uses the https scheme, is on a google.com host (such as www.google.com, docs.google.com, or google.com), as long as the path starts with /foo and ends with barhttps://www.google.com/foo/baz/bar
https://docs.google.com/foobar
https://example.org/foo/bar.htmlMatches the specified URLhttps://example.org/foo/bar.html
http://127.0.0.1/*Matches any URL that uses the http scheme and is on the host 127.0.0.1http://127.0.0.1/
http://127.0.0.1/foo/bar.html
*://mail.google.com/*Matches any URL that starts with http://mail.google.com or https://mail.google.comhttp://mail.google.com/foo/baz/bar
https://mail.google.com/foobar

Reference Match patterns - Chrome Developers

Guarded shortcuts

Windows ShortcutMac ShortcutIDE ActionChrome Action
Ctrl + n⌘ + nNew fileOpen a new window
Ctrl + w⌘ + wClose editorClose the current tab
Ctrl + t⌘ + tShow all SymbolsOpen a new tab, and jump to it
Ctrl + Shift + t⌘ + Shift + tReopen closed editorReopen previously closed tabs in the order they were closed
Ctrl + Shift + w⌘ + Shift + wClose the current tabClose the current window

Reference Chrome keyboard shortcuts and VS Code keyboard shortcuts