Skip to content

Fixes #154: Enable zoom in Nightscout view #439

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

Merged
merged 1 commit into from
Jul 21, 2025
Merged

Conversation

bjorkert
Copy link
Contributor

Closes #154.

Description

This PR introduces two improvements to the NightscoutViewController:

  • Enables Pinch-to-Zoom: The Nightscout page disables user scaling via its viewport <meta> tag. This change injects a small JavaScript snippet after the page loads to override this setting (user-scalable=0), allowing users to pinch-to-zoom on the graph as requested in the issue.

  • Fixes Deprecation Warning: Updates the code to resolve a warning for javaScriptEnabled, which was deprecated in iOS 14. It now uses the modern WKWebpagePreferences API to enable JavaScript, improving code health and future compatibility.

How to Test

  1. Navigate to the Nightscout view in the app.
  2. Verify that you can now pinch-to-zoom on the web content.
  3. Confirm the project builds without warnings related to javaScriptEnabled.

@bjorkert bjorkert requested a review from marionbarker July 19, 2025 12:05
@bjorkert bjorkert linked an issue Jul 19, 2025 that may be closed by this pull request
@marionbarker
Copy link
Collaborator

Test

Success

Details

I confirmed the warning present when building dev was no longer seen with this branch.
I confirmed pinch to zoom work.

Copy link
Collaborator

@marionbarker marionbarker left a comment

Choose a reason for hiding this comment

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

Approve from review and test.

@marionbarker marionbarker merged commit eed8852 into dev Jul 21, 2025
@marionbarker marionbarker deleted the enable-nightscout-zoom branch July 21, 2025 14:52
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.

Feature request: Enable zoom of Nightscout web view
2 participants