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

@dalongi dalongi 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
Copy link

msftclas commented Mar 20, 2019

CLA assistant check
All CLA requirements met.

@dalongi dalongi marked this pull request as ready for review March 20, 2019 18:26
@sandy081 sandy081 assigned joaomoreno and unassigned sandy081 and mjbvz Mar 22, 2019
@joaomoreno joaomoreno added this to the Backlog milestone Mar 25, 2019
@joaomoreno joaomoreno added extensions Issues concerning extensions workbench-os-integration Native OS integration issues labels Mar 25, 2019
@mostafaeweda
Copy link

@joaomoreno any updates on this?

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

Sorry for the delay... Thanks! 🍻

@joaomoreno joaomoreno merged commit e4bbbe2 into microsoft:master Jul 26, 2019
@github-actions github-actions bot locked and limited conversation to collaborators Mar 27, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
extensions Issues concerning extensions workbench-os-integration Native OS integration issues
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants