ernestosemedy opened a new issue, #1962:
URL: https://github.com/apache/wicket/issues/1962

   `wicket-ajax-jquery.js` binds an `unload` listener on `window` to clear the 
Ajax timers:
   
   ```js
   Wicket.Event.add(window, "unload", function() {
        Wicket.Timer.clearAll();
   });
   ```
   
   Browsers are deprecating `unload` listeners. Chrome is phasing them out; 
where it has turned them off, it does not run
   them and logs, on every page that uses Wicket's Ajax:
   
   ```
   [Violation] Permissions policy violation: unload is not allowed in this 
document.
   ```
   
   Where such a listener still runs, it keeps the page out of the back/forward 
cache. Clearing the timers is not needed:
   they end with the page.
   
   **Proposal:** remove the listener. `pagehide` is no replacement: it also 
fires when the page goes into the
   back/forward cache, and the timers would then be gone when the page comes 
back.
   
   Present on `wicket-10.x` (10.11.0), in 11.0.0 and on `master`.
   
   **Workaround** until then: run this after jQuery and before 
`wicket-ajax-jquery.js`, so that jQuery keeps the handler
   without adding the native listener:
   
   ```js
   jQuery.event.special.unload = { setup: function () { return true; } };
   ```
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to