Skip to content

Commit

Permalink
Revert "Bugfix FXIOS-10214 Fix Javascript alert callback" (backport #…
Browse files Browse the repository at this point in the history
…22640) (#22645)

Revert "Bugfix FXIOS-10214 Fix Javascript alert callback" (#22640)

Revert "Bugfix FXIOS-10214 Fix Javascript alert callback (#22392)"

This reverts commit 88a299d.

Co-authored-by: OrlaM <[email protected]>
  • Loading branch information
mergify[bot] and OrlaM authored Oct 18, 2024
1 parent 0d7db5f commit 5419c30
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 10 deletions.
5 changes: 1 addition & 4 deletions firefox-ios/Client/Frontend/Browser/BrowserPrompts.swift
Original file line number Diff line number Diff line change
Expand Up @@ -40,16 +40,13 @@ protocol JSAlertInfo {
struct MessageAlert: JSAlertInfo {
let message: String
let frame: WKFrameInfo
let completionHandler: (() -> Void)?

func alertController() -> JSPromptAlertController {
let alertController = JSPromptAlertController(
title: titleForJavaScriptPanelInitiatedByFrame(frame),
message: message,
preferredStyle: .alert)
alertController.addAction(UIAlertAction(title: .OKString, style: .default) { _ in
completionHandler?()
})
alertController.addAction(UIAlertAction(title: .OKString, style: .default))
alertController.alertInfo = self
return alertController
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,14 @@ extension BrowserViewController: WKUIDelegate {
initiatedByFrame frame: WKFrameInfo,
completionHandler: @escaping () -> Void
) {
let messageAlert = MessageAlert(message: message, frame: frame, completionHandler: {
completionHandler()
self.logger.log("Javascript message alert was completed.", level: .info, category: .webview)
})
let messageAlert = MessageAlert(message: message, frame: frame)
if shouldDisplayJSAlertForWebView(webView) {
logger.log("Javascript message alert will be presented.", level: .info, category: .webview)

present(messageAlert.alertController(), animated: true)
present(messageAlert.alertController(), animated: true) {
completionHandler()
self.logger.log("Javascript message alert was completed.", level: .info, category: .webview)
}
} else if let promptingTab = tabManager[webView] {
logger.log("Javascript message alert is queued.", level: .info, category: .webview)

Expand Down Expand Up @@ -949,7 +949,7 @@ private extension BrowserViewController {

func shouldDisplayJSAlertForWebView(_ webView: WKWebView) -> Bool {
// Only display a JS Alert if we are selected and there isn't anything being shown
return (tabManager.selectedTab == nil ? false : tabManager.selectedTab!.webView == webView)
return ((tabManager.selectedTab == nil ? false : tabManager.selectedTab!.webView == webView))
&& (self.presentedViewController == nil)
}

Expand Down

1 comment on commit 5419c30

@firefoxci-taskcluster
Copy link

Choose a reason for hiding this comment

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

Uh oh! Looks like an error!

InterpreterError at template.tasks[0].extra[0].treeherder[1].symbol: unknown context value cron

Please sign in to comment.