LEFT | RIGHT |
(no file at all) | |
| 1 (function() |
| 2 { |
| 3 var basename = {{metadata.get("general", "basename")|json}}; |
| 4 |
| 5 function doPoll() |
| 6 { |
| 7 var request = new XMLHttpRequest(); |
| 8 request.open("GET", "http://localhost:43816/"); |
| 9 request.addEventListener("load", function() |
| 10 { |
| 11 if (request.responseText != basename) |
| 12 return; |
| 13 |
| 14 var views = chrome.extension.getViews(); |
| 15 for (var i = 0; i < views.length; i++) |
| 16 if (views[i] != window) |
| 17 views[i].close(); |
| 18 window.location.reload(); |
| 19 }, false); |
| 20 request.send(null); |
| 21 |
| 22 window.setTimeout(doPoll, 5000); |
| 23 } |
| 24 |
| 25 // Delay first poll to prevent reloading again immediately after a reload |
| 26 window.setTimeout(doPoll, 10000); |
| 27 })(); |
LEFT | RIGHT |