You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Warning in chrome developer console regarding use of the unload event in
/manager/assets/ext3/adapter/ext/ext-base.js:21
Step to reproduce
Warning shows up on every kind of MODX 3.0 manager page. I'd expect that is also true for modx 2.x (no proof)
Observed behavior
The error points to g = "unload" which ist marked as deprecated in chrome
Ext.lib.Event = function() {
var v = false, f = {}, z = 0, o = [], d, A = false, k = window, E = document, l = 200, r = 20, p = 0, i = 1, s = 2, w = 3, t = "scrollLeft", q = "scrollTop", g = "unload", y = "mouseover", D = "mouseout", e = function() {
var F;
if (k.addEventListener) {
F = function(J, H, I, G) {
if (H == "mouseenter") {
I = I.createInterceptor(n);
J.addEventListener(y, I, (G))
} else {
if (H == "mouseleave") {
I = I.createInterceptor(n);
J.addEventListener(D, I, (G))
} else {
J.addEventListener(H, I, (G))
}
...
Quote from the google docs:
A Permission-Policy for creating unload event listeners will be added.
Initially the default policy will be to allow but Chrome will gradually migrate the default policy to deny creating unload event listeners until it is fully opt-in. The eventual goal is to remove support for unload event.
Source: https://chromestatus.com/feature/5579556305502208
Expected behavior
Use of unload should be removed from ext.js. According to google support it is unreliable and there are also possible performance issues (see source, above).
Environment
MODX version 3.1
The text was updated successfully, but these errors were encountered:
Proof of concept that this can be worked around by monkeypatching
# loadthisbeforeExtJSisloadedvaroriginalAddEventListener=EventTarget.prototype.addEventListener;EventTarget.prototype.addEventListener=function(type,listener,options){// For now, just dump the listenerif(type==='unload')return;// Call the original addEventListener functionreturnoriginalAddEventListener.apply(this,arguments);};
We may want to replace the unload event with something else. I'm not super clear on the ramifications of not having an unload event handler in MODX.
We could also choose to target Chrome only, if we're able to be accurate about that.
Thanks for reporting this. IMO, for the time-being, this is best left alone. This deprecation notice is something one has to seek out in dev tools (as opposed to a warning/error that appears in the console), and is not likely to be seen by most users.
Google is still at a pretty early point in the process of eventually removing the unload listener. The next thing to happen will merely be requiring apps to opt in to the event; I believe this can be handled outside of Ext JS (via the header Permissions-Policy: unload=*). The actual removal is likely far off. In the meantime, if MODX is to move forward, we will have developed a completely different front end (hopefully) before that breaking change occurs.
Bug report
Summary
Warning in chrome developer console regarding use of the unload event in
/manager/assets/ext3/adapter/ext/ext-base.js:21
Step to reproduce
Warning shows up on every kind of MODX 3.0 manager page. I'd expect that is also true for modx 2.x (no proof)
Observed behavior
The error points to g = "unload" which ist marked as deprecated in chrome
Quote from the google docs:
Expected behavior
Use of unload should be removed from ext.js. According to google support it is unreliable and there are also possible performance issues (see source, above).
Environment
MODX version 3.1
The text was updated successfully, but these errors were encountered: