Uploaded image for project: 'Moodle app'
  1. Moodle app
  2. MOBILE-4018

Review how links and window.open are treated in iframes

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Unresolved
    • Icon: Minor Minor
    • None
    • 4.2.0
    • Others
    • Hide

      This issue needs to be tested in 1 Android and 1 iOS device. Basically the behaviour should be almost the same in Android vs iOS, and in local iframe vs online iframe.

      I already prepared a SCORM (local iframe) and a custom main menu item (online iframe) to test this, they're in our master site.

      1. In the app, login in our master site and open MM Dev Testing course > SCORM > SCORM with links _top, _self, etc.
      2. Clicking each link should do what the link already says. E.g. if the link says "opened in same iframe", then the new page will be loaded in the same iframe, if it says "opened in app" then it's opened in a new page in the app, etc. The behaviour should be the same in Android and in iOS, with minor differences like the "popover" which is different in iOS and Android (in Android it uses the embedded browser, in iOS it uses a native viewer).
      3. Now go to More tab > MOBILE-4018: Iframe to test open links.
      4. As before, clicking each link should do what the link already says. The behaviour is almost the same as in point 2, except that the first section in SCORM is "Local file" because the app is loading a local file (a file downloaded in the device), while in this case it's "Relative link" because the page opened is online, that's why the behaviour is different. But the link already says what it should do.
      Show
      This issue needs to be tested in 1 Android and 1 iOS device. Basically the behaviour should be almost the same in Android vs iOS, and in local iframe vs online iframe. I already prepared a SCORM (local iframe) and a custom main menu item (online iframe) to test this, they're in our master site. In the app, login in our master site and open MM Dev Testing course > SCORM > SCORM with links _top, _self, etc. Clicking each link should do what the link already says. E.g. if the link says "opened in same iframe", then the new page will be loaded in the same iframe, if it says "opened in app" then it's opened in a new page in the app, etc. The behaviour should be the same in Android and in iOS, with minor differences like the "popover" which is different in iOS and Android (in Android it uses the embedded browser, in iOS it uses a native viewer). Now go to More tab > MOBILE-4018 : Iframe to test open links. As before, clicking each link should do what the link already says. The behaviour is almost the same as in point 2, except that the first section in SCORM is "Local file" because the app is loading a local file (a file downloaded in the device), while in this case it's "Relative link" because the page opened is online, that's why the behaviour is different. But the link already says what it should do.
    • MOODLE_402_STABLE
    • Moodle Apps Sprint 2025-I1.4, Moodle Apps Sprint 2025-I2.2

      The behaviour changes depending on the OS, whether it's an online iframe or a local iframe, and whether it's a clicked link or a window.open. Maybe we want to make it more consistent.

      Local iframe (points to local file)

      Same behaviour in iOS and Android:

      • External links: opened in browser, not in app.
      • window.open: opens link in app if needed.

      The logic is handled in CoreIframeUtilsProvider.treatFrame.

      Online iframe (points to http...)

      • Android
        • Same behaviour for external links and window.open: opens link in app if needed.
      • iOS
        • External links: opened in browser, not in app.
        • window.open: opens link in app if needed.

      In Android, the logic is handled in onOverrideUrlLoading.

      In iOS, the logic is handled in iframe-treat-links.js.

       

        1. MOBILE-4018_OpenedInPopoverOrExternalApp_Android.png
          141 kB
          Isabel Renedo Rouco
        2. MOBILE-4018_OpenedInPopoverOrExternalApp_iPad.png
          108 kB
          Isabel Renedo Rouco
        3. MOBILE-4018_Mssg_Android.png
          128 kB
          Isabel Renedo Rouco
        4. MOBILE-4018_Mssg_iPad.png
          139 kB
          Isabel Renedo Rouco
        5. MOBILE-4018_NoTarget-OpenedInSameIframe-NoAutoLogin_Android.png
          162 kB
          Isabel Renedo Rouco
        6. MOBILE-4018_NoTarget-OpenedInSameIframe-NoAutoLogin_iPad.png
          390 kB
          Isabel Renedo Rouco
        7. MOBILE-4018_step3_NoAutologin.png
          337 kB
          Isabel Renedo Rouco
        8. MOBILE-4018_links_App.png
          587 kB
          Isabel Renedo Rouco
        9. MOBILE-4018_local_browser-SCORMdirectly.png
          46 kB
          Isabel Renedo Rouco
        10. MOBILE-4018_local_iframeApp.png
          574 kB
          Isabel Renedo Rouco
        11. MOBILE-4018_moodleorgWithNoTarget_openedInSameIframe.png
          472 kB
          Isabel Renedo Rouco
        12. MOBILE-4018_moodleorgWithNoTarget_openedInSameIframe_maintenance.png
          155 kB
          Isabel Renedo Rouco
        13. Links>Captured>NoTarget-openedInSameIframeNoAutologin_iPad.png
          387 kB
          Isabel Renedo Rouco
        14. MOBILE-4018_NoTarget-OpenedInSameIframeNoAutoLogin_Android.png
          419 kB
          Isabel Renedo Rouco

            dpalou Dani Palou
            dpalou Dani Palou
            Pau Ferrer Pau Ferrer
            Isabel Renedo Rouco Isabel Renedo Rouco
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 1 week, 1 day, 2 hours, 4 minutes
                1w 1d 2h 4m

                  Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.