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

Fix FontMeasurementsImpl to work in a web environment #2260

Merged
merged 9 commits into from
Mar 11, 2024

Conversation

bjaspan
Copy link
Contributor

@bjaspan bjaspan commented Mar 6, 2024

FontMeasurementsImpl currently uses an inline script to compute font size ratios which is not compatible with a web environment due to Content Security Policy (CSP) rules. This PR switches to a separate script file and adds a CSP rule for it according to the instructions in https://code.visualstudio.com/api/extension-guides/webview#content-security-policy.

To test, change the Editor: Font Family setting (you can just append , x to the end or make any other change). Success is seeing a tab flash and disappear; failure is the tab showing "Loading Cursorless..." remaining open.

@bjaspan
Copy link
Contributor Author

bjaspan commented Mar 6, 2024

/cc @wolfmanstout

Copy link
Member

@pokey pokey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

works fine on desktop; I'll take your word it works on web

@pokey pokey added this pull request to the merge queue Mar 11, 2024
Merged via the queue into cursorless-dev:main with commit 9e9d874 Mar 11, 2024
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants