Repository navigation
Conversation
… the screen The sign under the address bar kept saying the page was hidden from screenshots and recordings from the moment the page left the screen until the next try after it came back. The host now tells when it puts the layer back, and the state holder clears the sign without raising the line that a screenshot cannot be blocked, because nothing failed. A test now covers what SwiftUI does when it takes the host away, which puts the layer back while the host can still be on its window. The build number is 261126.3 because the app changed. Signed-off-by: Yehor Komarov <10210242+geoolekom@users.noreply.github.com>
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #202, from its review: the sign under the address bar keeps saying the page is hidden from screenshots after the page has left the screen, and the code that puts the layer back when SwiftUI takes the host away has no test.
What changed
GlasshouseWebHosttellsscreenshotProtectionEndedeach time it puts the layer back: the host left its window, or restricted mode ended.GlasshouseRestriction.screenshotProtectionEnded()clearsscreenshotProtected. It raises no "a screenshot cannot be blocked" line, because nothing failed, and a line the person has not read yet stays. Before this, the sign kept saying "Restricted mode: hidden from screenshots and recordings" from the moment the page left until the next try after it came back; now it says plain "Restricted mode" in between.What each new test shows
GlasshouseWebHostTests(unit):GlasshouseWebContainer.dismantleUIViewputs the layer back while the host is still on its window, which is what the linehost.restricted = falsethere is for;GlasshouseRestrictionTests(unit, two new): the end of the protection clears the sign and raises no line; it changes nothing before any try, and after a failed try the unread line stays.What ran
scripts/test-glasshouse-ios.py, about 11 minutes).iosApp/check.sh(structure check andswiftlint lint --strict): clean, 0 violations.pre-commit run --all-files: passed.The Simulator does not apply the screenshot protection to what it draws, so what a screenshot or a recording shows is still for a real iPhone to say, as in #202.