Skip to content

fix(ios): read CapacitorCookies/CapacitorHttp isEnabled from injected global - #8689

Merged
OS-ruimoreiramendes merged 5 commits into
nextfrom
fix/RMET-5581/ios-prompt-hang-next
Nov 2, 2026
Merged

OS-ruimoreiramendes merged 5 commits into
nextfrom
fix/RMET-5581/ios-prompt-hang-next

Conversation

@OS-ruimoreiramendes

@OS-ruimoreiramendes OS-ruimoreiramendes commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Description

Replace the two sync window.prompt() calls in native-bridge.js at document-start with reads from a static global injected in the existing .atDocumentStart WKUserScript:

window.CapacitorNativeConfig = { cookiesEnabled, httpEnabled };

Both values come from static plugin config and are already known natively before the page loads.

Ref: https://outsystemsrd.atlassian.net/browse/RMET-5581

Change Type

  • Fix
  • Feature
  • Refactor
  • Breaking Change
  • Documentation
  • Other (CI, chores, etc.)

Rationale / Problems Fixed

Ref #8664

Tests or Reproductions

  • Breakpoint on runJavaScriptTextInputPanelWithPrompt does not fire during cold launch after the fix.
  • window.CapacitorNativeConfig reflects the plugin config correctly (verified with both enabled: true and false).
  • Dynamic document.cookie get/set still goes through the prompt delegate, unchanged.
  • 30 cold cycles on iPhone 17 + iOS 27.0 and 30 on iPhone Duo + iOS 27.1 with the fix: 0 hangs.

Platforms Affected

  • Android
  • iOS
  • Web

@ItsChaceD ItsChaceD left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as #8688 , can we remove the checks here:

} else if type == "CapacitorCookies.isEnabled" {
let pluginConfig = bridge!.config.getPluginConfig("CapacitorCookies")
completionHandler(String(pluginConfig.getBoolean("enabled", false)))
// Don't present prompt
return
} else if type == "CapacitorHttp" {
let pluginConfig = bridge!.config.getPluginConfig("CapacitorHttp")
completionHandler(String(pluginConfig.getBoolean("enabled", false)))
// Don't present prompt
return
}

@OS-ruimoreiramendes

Copy link
Copy Markdown
Contributor Author

Same as #8688 , can we remove the checks here:

} else if type == "CapacitorCookies.isEnabled" {
let pluginConfig = bridge!.config.getPluginConfig("CapacitorCookies")
completionHandler(String(pluginConfig.getBoolean("enabled", false)))
// Don't present prompt
return
} else if type == "CapacitorHttp" {
let pluginConfig = bridge!.config.getPluginConfig("CapacitorHttp")
completionHandler(String(pluginConfig.getBoolean("enabled", false)))
// Don't present prompt
return
}

Yeah makes sense, they are dead code now that the prompts are gone.

@OS-ruimoreiramendes
OS-ruimoreiramendes merged commit 1ae2b31 into next Nov 2, 2026
6 checks passed
@OS-ruimoreiramendes
OS-ruimoreiramendes deleted the fix/RMET-5581/ios-prompt-hang-next branch November 2, 2026 11:48
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.

8 participants