UVE: Firefox shows "about:srcdoc" error in the canvas when a traditional page assigns window.location

オープン
#38,605 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 2 日以内に返信

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
65/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
java, javascript
領域
frontend, web-dev

調査の方向性

Start in dot-uve-iframe.component.ts and trace insertPageContent, where traditional page HTML is written to the canvas iframe's srcdoc. Reproduce the Firefox failure using the steps in the issue, then inspect how the editor handles iframe navigation and hash-only navigation. Done means assigned window.location no longer leaves the Firefox canvas on an error page, while reload, hash handling, and Chromium behavior still meet the acceptance criteria.

索引モデルが issue の本文から書いたものです。

説明

dotCMS : UVE OKR : Customer Support Team : Maintenance Type : Defect
Problem Statement

In Firefox, when a traditional (VTL) page is open in the Universal Visual Editor and a script on the page navigates by assigning window.location / window.location.href (for example to the current URL with added query-string parameters), the editor canvas is replaced by Firefox's own "Hmm. That address doesn't look right." error page ("Firefox can't connect to the server at about:srcdoc"). Editors have to refresh the browser tab to get the page back.

UVE renders traditional pages by writing the server-rendered HTML into the canvas iframe's srcdoc (dot-uve-iframe.component.ts, insertPageContent, introduced by #36583). Inside that iframe the document's location is about:srcdoc, so a page script that builds a navigation from window.location targets about:srcdoc, which Firefox treats as an invalid address.

A common real-world trigger is a cookie/privacy consent banner that, after the visitor clicks "Accept", writes the consent cookie and then navigates to the current URL (often with extra query parameters) so consent-dependent scripts are rendered. The same applies to any page script that navigates itself (language/region switchers, JS redirects). Sites migrating from the 5.x Edit Mode, which loaded the page by its real URL, did not hit this.

Impact: editors only (live site visitors are unaffected), on first access before the consent cookie exists, every time. It reads to editors as a backend malfunction.

Browsers: Firefox only. Chrome and Chromium-based browsers handle the same navigation without the error. Per the reporter, location.reload() works in Firefox too; the failure is on assignment to window.location / window.location.href.

Steps to Reproduce
  1. Open the dotCMS demo site (demo.dotcms.com) in Firefox and log in to the backend.
  2. Open any traditional page (e.g. /index) in the Page Editor (UVE).
  3. Open the browser developer tools (F12) → Console, and switch the JavaScript context selector to the canvas iframe (about:srcdoc).
  4. Run: window.location.href = window.location
  5. Observe: the canvas shows Firefox's "Hmm. That address doesn't look right." / "can't connect to the server at about:srcdoc" page instead of the page content. Only a full browser-tab refresh restores the editor.
  6. Repeat steps 1–4 in Chrome: the canvas does not break.

Real-world variant: add a script to a page template that, on a button click, sets a cookie and then sets window.location.href to the current URL plus a query parameter; clear cookies; open the page in UVE in Firefox and click the button.

Acceptance Criteria
  • In Firefox, a traditional page in UVE that assigns window.location / window.location.href (to its own URL, with or without added query parameters) does not leave the canvas on a browser error page; the editor keeps or reloads the page in the current editor mode.
  • Behavior in Chrome/Chromium-based browsers is unchanged.
  • location.reload() from page scripts continues to work in all supported browsers.
  • Hash-only navigation (#section) keeps its current in-canvas scroll handling.
dotCMS Version

dotEvergreen, current release (reproduced on demo.dotcms.com). Traditional pages have rendered through srcdoc since #36583.

Severity

Medium - Some functionality impacted

Links
主要言語
Java
スター
972
フォーク
493
平均マージ
2日 12時間
マージ済み PR(30日)
228

環境構築

Codespaces で開く

このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

dotCMS/core のほかの issue

dotCMS/core の issue をすべて見る

似ている issue

Java の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。