Child pages
  • [cms] Javascript error when adding frame with external URL into CMS block [5.2.1]
Skip to end of metadata
Go to start of metadata

It is impossible to save changes made to a content block in case if it contains iframe with external URL (e.g. youtube embed code <iframe width="560" height="315" src="https://www.youtube.com/embed/...">>). Error happens because browser usually have no permissions to get properties ("name" property in this case) of foreign domain frames.

Problematic code is:

/core/admin_templates/incs/close_popup.tpl and /core/admin_templates/js/script.js
var $frameset = $main_window.parent.frames;
for ($i = 0; $i < $frameset.length; $i++) {
   if ($frameset[$i].name == $name) {
          return $frameset[$i];
   }
}

Solution

Use try-catch construct to avoid breaking of the JavaScript.

Related Tasks

INP-1432 - Getting issue details... STATUS