UVE: Firefox shows "about:srcdoc" error in the canvas when a traditional page assigns window.location
I maintainer di solito rispondono entro 2 giorni
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 65/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- java, javascript
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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
- Open the dotCMS demo site (demo.dotcms.com) in Firefox and log in to the backend.
- Open any traditional page (e.g.
/index) in the Page Editor (UVE). - Open the browser developer tools (F12) → Console, and switch the JavaScript context selector to the canvas iframe (
about:srcdoc). - Run:
window.location.href = window.location - 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.
- 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
- Freshdesk ticket #41459
- Related (closed): #37961 (consent-banner buttons in the UVE canvas)
- Lingua principale
- Java
- Stelle
- 972
- Fork
- 493
- Merge medio
- 2g 12h
- PR unite (30g)
- 228
Preparare l'ambiente
Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di dotCMS/core
-
dotCMS : UVE OKR : Customer Support Team : Maintenance Type : Defect
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
I maintainer di solito rispondono entro 2 giorni
-
OKR : Customer Support Team : Maintenance Type : Defect
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 2 giorni
-
Opening content from Content Search replaces the "Search" breadcrumb in the new Edit Content screenApertadotCMS: New Edit Contentlet OKR : Customer Support Team : Falcon Type : Defect
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 2 giorni
-
Escape the Binary field hint in the legacy content editor so an apostrophe doesn't break the fieldApertaOKR : Customer Support Team : Maintenance Type : Defect
Difficoltà 2/5 1-3 ore Idoneità per principianti 79/100
I maintainer di solito rispondono entro 2 giorni
-
dotCMS : Permissions OKR : Customer Support Team : Maintenance Type : Defect
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
I maintainer di solito rispondono entro 2 giorni
Issue simili
-
desktop grp:about type:graphics-bug ui-public
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 68/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
I maintainer di solito rispondono entro 2 giorni
-
enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
it-at-m/Wahllokalsystem#3846 ·
I maintainer di solito rispondono entro 2 giorni
-
Area/Connector module/solace Priority/Low Type/Bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 77/100
ballerina-platform/ballerina-library#9849 ·
I maintainer di solito rispondono entro 1 giorno