Skip to content
This repository has been archived by the owner on May 10, 2024. It is now read-only.

Qwant, Startpage links and popups do not work in private mode #456

Closed
danishjafri88 opened this issue Nov 27, 2018 · 3 comments
Closed

Qwant, Startpage links and popups do not work in private mode #456

danishjafri88 opened this issue Nov 27, 2018 · 3 comments

Comments

@danishjafri88
Copy link
Contributor

danishjafri88 commented Nov 27, 2018

We should handle window.open when in private mode

Enhancement for #446 & #455:

What
In private mode the WKProcessPool of the WKWebViewConfiguration is overridden to avoid passing of cookies and other data between WKWebViews. This behaviour when combined with a popup ie window.open results in a crash

Why
When a window.open is called the parent WKWebView calls the delegate method:

optional public func webView(_ webView: WKWebView, createWebViewWith configuration: WKWebViewConfiguration, for navigationAction: WKNavigationAction, windowFeatures: WKWindowFeatures) -> WKWebView?

in WKUIDelegate. It provides a configuration for the new window. When in private mode, this configuration is altered resulting in corruption of configuration and subsequent crash.

Current-Fix
For now all popups are blocked when in private mode. (BrowserViewController.swift)
See: #456 (comment)

Enhancement
Two possible solutions:

  1. Keep blocking popups and instead show an alert telling the user of the reason.
  2. Intercept popup call in private mode, create a new tab (not a popup) with the same request and return nil. (What other info needs to be used from the callback can be discussed later.)

Description:

Steps to Reproduce

Actual result:

Expected result:

Reproduces how often: [Easily reproduced, Intermittent Issue]

Brave Version:

Device details:

Website problems only:

  • did you check with Brave Shields down?
  • did you check in Safari/Firefox (WkWebView-based browsers)?

Additional Information

@kylehickinson
Copy link
Collaborator

This affects one of the search engines we support, Startpage.com, which by default opens search results in a new window.

@kylehickinson kylehickinson added priority/P1 A very extremely bad problem. We might push a hotfix for it. release/blocking QA/Yes and removed priority/P4 Planned work. We expect to get to it "soon". enhancement labels Mar 18, 2019
@kylehickinson kylehickinson changed the title Handle window.open when in private mode Qwant, Startpage links and popups do not work in private mode Mar 18, 2019
@jhreis
Copy link
Contributor

jhreis commented Mar 18, 2019

Please see: #446 (comment) for rationale.

@srirambv
Copy link
Contributor

srirambv commented Mar 27, 2019

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

8 participants