()
| 5 | const isLoon = typeof $loon != "undefined"; |
| 6 | |
| 7 | function getWeatherData() { |
| 8 | if (isQuantumultX) { |
| 9 | $task.fetch({ url: apiurl }).then(response => { |
| 10 | showNotification(response.body); |
| 11 | }, reason => { |
| 12 | console.log(reason.error); |
| 13 | $done(); |
| 14 | }); |
| 15 | } else if (isSurge || isLoon) { |
| 16 | $httpClient.get(apiurl, function (error, response, data) { |
| 17 | if (error) { |
| 18 | console.log(error); |
| 19 | $done(); |
| 20 | } else { |
| 21 | showNotification(data); |
| 22 | } |
| 23 | }); |
| 24 | } |
| 25 | } |
| 26 | |
| 27 | function showNotification(data) { |
| 28 | var obj = JSON.parse(data); |
no test coverage detected