Uploaded image for project: '[Read Only] - Addon Channel Manager'
  1. [Read Only] - Addon Channel Manager
  2. CHANNELMGR-855

MutationObserver in OverlaySyncService should filter out duplicate callbacks

    XMLWordPrintable

Details

    • Improvement
    • Status: Closed
    • Normal
    • Resolution: Fixed
    • 4.0.1, 4.1.0
    • 4.0.3
    • None

    Description

      The current DOM MutationObserver in the OverlaySyncService can easily lead to infinite loops. For example, when a website has a resize callback that mutates the DOM (e.g. set the height of an element) this will trigger the MutationObserver callback, which in turns re-calculates the height of the iframe and subsequently triggering another resize event in the website, starting the infinite loop.

      After trying out different solutions (simply checking if the width/height of the site has changed, or fixing the script in the website to only cause a DOM mutation when necessary) it became clear that the list of MutationRecords provided by the MutationObserver is always the same when we are in the loop. This allows for a generic fix that only triggers a redraw in the ChannelManager overlay if the current list of MutationRecords differers from the previous list.

      For a more thorough explanation, please see the linked HIPCON-2018 issue.

      Attachments

        Issue Links

          Activity

            People

              asolod Andrey Solod (Inactive)
              abogaart Arthur Bogaart
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: