Javascript detect closing popup loaded with another domain

As mentioned, same origin policy prevents Javascript from detecting such events. But there’s a quite simple solution which allows you to detect closure of such windows. Here’s the JS code: var openDialog = function(uri, name, options, closeCallback) { var win = window.open(uri, name, options); var interval = window.setInterval(function() { try { if (win == null … Read more

Reload the site when reached via browsers back button

You should use a hidden input as a refresh indicator, with a value of “no”: <input type=”hidden” id=”refresh” value=”no”> Now using jQuery, you can check its value: $(document).ready(function(e) { var $input = $(‘#refresh’); $input.val() == ‘yes’ ? location.reload(true) : $input.val(‘yes’); }); When you click on the back button, the values in hidden fields retain the … Read more

Browser waits for ajax call to complete even after abort has been called (jQuery)

Thank you for your replies! It turns out I was completely wrong about this being a browser issue – the problem was on the server. ASP.NET serializes requests of the same session that require session state, so in this case, the next page didn’t begin processing on the server until those ajax-initiated requests completed. Unfortunately, … Read more

How to disable a “Reload site? Changes you made may not be saved” popup for (python) selenium tests in chrome?

This popup with text as Reload site? Changes you made may not be saved is the implementation of onbeforeunload property of WindowEventHandlers onbeforeunload The onbeforeunload property of the WindowEventHandlers mixin is the EventHandler for processing beforeunload events. These events fire when a window is about to unload its resources. At this point, the document is … Read more