Chromium Code Reviews| Index: chrome/test/data/extensions/unload_listener/page.js |
| diff --git a/chrome/test/data/extensions/unload_listener/page.js b/chrome/test/data/extensions/unload_listener/page.js |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..205375e6711c40f612a0622abdf4cbf0619f7a79 |
| --- /dev/null |
| +++ b/chrome/test/data/extensions/unload_listener/page.js |
| @@ -0,0 +1,12 @@ |
| +// Copyright 2016 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +function onUnload() { |
| + var xhr = new XMLHttpRequest(); |
| + xhr.open('GET', 'https://www.example.com/', true); |
| + xhr.send(); |
| +} |
| + |
| +window.onbeforeunload = onUnload; |
|
Charlie Reis
2016/09/21 18:29:33
I'd suggest leaving this line out, since beforeunl
Devlin
2016/09/22 00:35:21
Is there any harm? Neither one of these should ch
Charlie Reis
2016/09/22 20:37:47
I suppose it would matter more if it were possible
|
| +window.onunload = onUnload; |