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

Configuration + UI to remember extensions allowed to handle URIs #70844

Merged
merged 11 commits into from Jul 26, 2019

Conversation

@dalongi
Copy link
Contributor

commented Mar 20, 2019

Addresses issue #69166.

What

Extensions that offer frequently-used URI handlers present a tedious UX: every time the URI handler is invoked, the user has to manually confirm that the extension is allowed to do it.

This change addresses the problem in two ways:

  • Add a configuration setting of extension ids to treat as confirmed.
  • Add a checkbox to the confirmation. When checked, the extension id is stored locally and the user is not prompted again for URIs handled by that extension.
    Screen Shot 2019-03-20 at 10 34 51 AM

Manual Testing

General setup for testing URI handlers

  • Launch VSCode pointing to the workspace for MyExtension (which has a URI Handler).
  • F5 to launch VSCode running MyExtension. All testing is done in this VSCode window.
  • URL to trigger MyExtension's URL handler: code-oss:///test/

Prompt behavior is not regressed

  • Verify settings.json has no config entry for MyExtension
  • Open MyExtension URL
  • Verify the prompt is shown. Click "Open"
  • Open MyExtension URL
  • Verify the prompt is shown.

Valid configuration settings

  • Open settings.json
  • Start adding key "extensions.confirmed"
  • Verify autocomplete suggests the key and has a description. Default value of [] is filled in.
    Screen Shot 2019-03-20 at 10 38 21 AM
  • Open MyExtension URL
  • Verify the prompt is shown.
  • Update "extensions.confirmedUriHandlerExtensionIds" config to include the ID for MyExtension
  • Verify no prompt is shown, URL is handled.
  • Update "extensions.confirmedUriHandlerExtensionIds" config to remove the ID for MyExtension
  • Verify prompt is shown.

Invalid configuration settings

  • Update settings.json "extensions.confirmedUriHandlerExtensionIds" to invalid values: {"hello": "world"}, "hello world", [{}]
  • Open MyExtension URL
  • Verify prompt shows, no errors in console.

Checkbox setting

  • Open MyExtension URL
  • Verify the prompt is shown.
  • Check the checkbox.
  • Click "Open".
  • Verify the URL is handled.
  • Open MyExtension URL
  • Verify NO prompt is shown.
  • Verify the URL is handled.
@msftclas

This comment has been minimized.

Copy link

commented Mar 20, 2019

CLA assistant check
All CLA requirements met.

@dalongi dalongi marked this pull request as ready for review Mar 20, 2019

@sandy081 sandy081 assigned joaomoreno and unassigned sandy081 and mjbvz Mar 22, 2019

@joaomoreno joaomoreno added this to the Backlog milestone Mar 25, 2019

@mostafaeweda

This comment has been minimized.

Copy link

commented Apr 5, 2019

@joaomoreno any updates on this?

dalongi added some commits Apr 16, 2019

@joaomoreno joaomoreno modified the milestones: Backlog, July 2019 Jul 15, 2019

@joaomoreno

This comment has been minimized.

Copy link
Member

commented Jul 26, 2019

Sorry for the delay... Thanks! 🍻

@joaomoreno joaomoreno merged commit e4bbbe2 into microsoft:master Jul 26, 2019

5 checks passed

VS Code Build #20190625.31 succeeded
Details
VS Code (Linux) Linux succeeded
Details
VS Code (Windows) Windows succeeded
Details
VS Code (macOS) macOS succeeded
Details
license/cla All CLA requirements met.
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
6 participants
You can’t perform that action at this time.