eclipse-theia/theia

[Violation] Permissions policy violation: unload is not allowed in this document --> layout is not saved

Offen

#17.798 geöffnet am 21.07.2026

 (0 Kommentare) (1 Reaktion) (0 zugewiesene Personen)TypeScript (2.478 Forks)batch import
browsercoreelectronhelp wantedlayout restoration

Repository-Metriken

Stars
 (18.676 Sterne)
PR-Merge-Metriken
 (Durchschn. Merge 15T 4h) (75 gemergte PRs in 30 T)

Beschreibung

Bug Description:

Hi, This note is from the Chrome Developers site https://developer.chrome.com/docs/web-platform/deprecating-unload: The unload event will be gradually deprecated by gradually changing the default so that unload handlers stop firing on pages unless a page explicitly opts in to re-enable them.

The issue is that we see the "[Violation] Permissions policy violation: unload is not allowed in this document" error now in some environments (I can't tell why only in these environments). This error originates from the store layout method, which is triggered during the unload event. Consequently, the layout is not saved in these environments.

So we need to replace all the unload events in Theia code:

  1. DefaultWindowService
  2. DefaultSecondaryWindowService
  3. WindowService (onUnload is triggered on this event)
  4. ElectronMenuContribution, ElectronWindowService, ElectronSecondaryWindowService

Steps to Reproduce:

  1. I don't have steps to reproduce, but once it happens, the layout is not saved, and you see the error above in the console log

Additional Information

  • Operating System: Mac/Windows
  • Theia Version: 1.73

Contributor Guide