| 'use strict'; |
| |
| var log = null; |
| var dom_loaded = false; |
| |
| async function downloadLog() { |
| if (log == null || dom_loaded == false) |
| return; |
| let response = await fetch(log); |
| let blob = await response.blob(); |
| readFile(blob); |
| }; |
| |
| chrome.runtime.onMessage.addListener(async function(request,sender,response) { |
| log = request.logData; |
| await downloadLog(); |
| response('ok'); |
| }); |
| |
| window.addEventListener('DOMContentLoaded', () => { |
| if (window.location.hash == '#fromFeedback=true') { |
| // Hide the text to open a new log. |
| document.getElementById('file-load-instructions').innerHTML = |
| 'loading log from feedback system...'; |
| } |
| dom_loaded = true; |
| downloadLog(); |
| }); |