Skip to content

RMET-5110 ::: added fix do allow open url InAppBrowser and download a file#46

Open
OS-ruimoreiramendes wants to merge 1 commit intomainfrom
fix/RMET-5110/open-url-download
Open

RMET-5110 ::: added fix do allow open url InAppBrowser and download a file#46
OS-ruimoreiramendes wants to merge 1 commit intomainfrom
fix/RMET-5110/open-url-download

Conversation

@OS-ruimoreiramendes
Copy link
Copy Markdown
Contributor

Description

Handle window.open() and file downloads in WKWebView on iOS
On iOS, WKWebView silently ignores window.open() calls and cannot handle file download responses by default. This fix addresses both issues:

  • Injects a WKUserScript at document start that overrides window.open() to navigate within the same WebView, preserving the custom User Agent
  • Implements decidePolicyFor navigationResponse to detect non-displayable MIME types and trigger WKDownload (iOS 14.5+), with a UIActivityViewController to allow the user to save or share the downloaded file

Context

Addresses: https://outsystemsrd.atlassian.net/browse/RMET-5110

Type of changes

  • Fix (non-breaking change which fixes an issue)
  • Feature (non-breaking change which adds functionality)
  • Refactor (cosmetic changes)
  • Breaking change (change that would cause existing functionality not to work as expected)

Tests

Screenshots (if appropriate)

Checklist

  • Pull request title follows the format RNMT-XXXX <title>
  • Code follows the code style of this project
  • Changes require an update to the documentation
    • Documentation has been updated accordingly

@OS-ruimoreiramendes OS-ruimoreiramendes requested a review from a team as a code owner April 7, 2026 12:22
@alexgerardojacinto
Copy link
Copy Markdown
Contributor

Injects a WKUserScript at document start that overrides window.open() to navigate within the same WebView, preserving the custom User Agent

@OS-ruimoreiramendes Before it was already possible to navigate within the same web view right?

@alexgerardojacinto
Copy link
Copy Markdown
Contributor

Implements decidePolicyFor navigationResponse to detect non-displayable MIME types and trigger WKDownload (iOS 14.5+), with a UIActivityViewController to allow the user to save or share the downloaded file

@OS-ruimoreiramendes how does the same use case work in Android? Did the downloads already work?

@alexgerardojacinto
Copy link
Copy Markdown
Contributor

@OS-ruimoreiramendes if we're adding any new functionality, which I believe we might be, then we need to consider adding it on Android as well (if it doesn't already exist)

@OS-ruimoreiramendes
Copy link
Copy Markdown
Contributor Author

@alexgerardojacinto as discussed on the call, since this PR introduces download functionality which was not previously supported (and would need to be considered for Android as well), I'll keep this PR open for future reference in case we decide to introduce this feature.
In the meantime, I've created a new PR that addresses the actual issue reported in the support ticket and tracked under https://outsystemsrd.atlassian.net/browse/RPM-6714.

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.

2 participants