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

Fixed #1102 by changing the WKWebview privacy protection using tab's isPrivate value. #1103

Merged
merged 2 commits into from Jul 10, 2019
Merged
Changes from 1 commit
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

Next

Added logic to utilise tab's `isPrivate` state to appropriately initi…

…alise the WKWebview.
  • Loading branch information
danishjafri88 committed May 21, 2019
commit 2635cd6fd1ae2e886e2de32fc6ae0d73aaf8768d
@@ -8,8 +8,6 @@ import UIKit
final class PrivacyProtection: PrivacyProtectionProtocol {

var nonPersistent: Bool {
let isPrivateBrowsing = PrivateBrowsingManager.shared.isPrivateBrowsing
return isPrivateBrowsing
return true

This comment has been minimized.

Copy link
@iccub

iccub May 22, 2019

Contributor

Can simplify this to let nonPersistent = true if we are never changing it

This comment has been minimized.

Copy link
@jhreis

jhreis Jun 21, 2019

Contributor

Can we actually just completely remove PrivacyProtectionProtocol? The only difference between the two is a true/false boolean. Can't we just put a flag nonPersistent directly onto the webview rather than using a protocol and two custom classes?

}

}
@@ -191,7 +191,8 @@ class Tab: NSObject {
configuration!.allowsInlineMediaPlayback = true
// Enables Zoom in website by ignoring their javascript based viewport Scale limits.
configuration!.ignoresViewportScaleLimits = true
let webView = TabWebView(frame: .zero, configuration: configuration!)
let protectionLevel: PrivacyProtectionProtocol = isPrivate ? PrivacyProtection() : NoPrivacyProtection()
let webView = TabWebView(frame: .zero, configuration: configuration!, privacyProtection: protectionLevel)
webView.delegate = self
configuration = nil

ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.