Uploaded image for project: 'Titanium SDK/CLI'
  1. Titanium SDK/CLI
  2. TIMOB-27522

WebView: onlink and beforeload are not consistent across platforms

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: Release 8.2.1
    • Fix Version/s: Release 9.0.0
    • Component/s: iOS

      Description

      What happens:

      • on iOS both the onlink function and the beforeload event are called when setting html, while on Android this happens only for beforeload.
      • on iOS both the onlink function and the beforeload event are called also for embeds (like iframe) while on Android this not happen at all.

      This is causing me some trouble working on iOS because of "false positive" events that I need to distinguish as user clicks or normal page loading.

      I'd like to suggest a PR where

      solution 1:

      • iOS will send onlink only when navigation type is WKNavigationTypeLinkActivated
      • beforeload event will expose the isMainFrame indication to indicate if it was generated on the main page or an iframe.

      or:

      solution 2:

      • iOS will send onlink only when navigation type is WKNavigationTypeLinkActivated
      • beforeload event is generated only if navigationAction.targetFrame.isMainFrame is true

      At the moment I've implemented in the PR the first solution, since iOS is already a little different from Android because it already exposes the platform specific attribute navigationType

      See the PR

        Attachments

          Activity

            People

            • Assignee:
              jvennemann Jan Vennemann
              Reporter:
              gmandolini Giorgio Mandolini
              Reviewer:
              Jan Vennemann
              Tester:
              Satyam Sekhri
            • Watchers:
              8 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Backbone Issue Sync

                • Backbone Issue Sync is enabled for your project, but we do not have any synchronization info for this issue.

                  Git Integration