Don't silently ignore creation of new windows #885
Merged
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.
Platforms affected
iOS
Motivation and Context
Currently, attempts to create new windows (via links with
target="_blank"
or JSwindow.open
) for pages within the application have no effect and are silently ignored. (Links to pages outside the application trigger the allow-intent functionality and open in Safari.)Description
With this PR, the default behaviour will be to open those links in the same Web View (without creating a new window).
This also introduces a preference (
AllowNewWindows
) that allows the creation of a new UIViewController to present the new page in a new Web View frame on top of the existing Web View.Note: This new window provides no controls, so it can only be closed with
window.close()
in JS.Testing
Manual testing in a new Cordova app.
Checklist