| 1 | const messageHandler = event => { |
| 2 | var message = event.data.message; |
| 3 | var args = event.data.args; |
| 4 | |
| 5 | switch (message) { |
| 6 | case commands.MG_GET_SETTINGS: |
| 7 | loadSettings(args.settings); |
| 8 | break; |
| 9 | case commands.MG_CLEAR_CACHE: |
| 10 | if (args.content && args.controls) { |
| 11 | updateLabelForEntry('entry-cache', 'Cleared'); |
| 12 | } else { |
| 13 | updateLabelForEntry('entry-cache', 'Try again'); |
| 14 | } |
| 15 | break; |
| 16 | case commands.MG_CLEAR_COOKIES: |
| 17 | if (args.content && args.controls) { |
| 18 | updateLabelForEntry('entry-cookies', 'Cleared'); |
| 19 | } else { |
| 20 | updateLabelForEntry('entry-cookies', 'Try again'); |
| 21 | } |
| 22 | break; |
| 23 | default: |
| 24 | console.log(`Unexpected message: ${JSON.stringify(event.data)}`); |
| 25 | break; |
| 26 | } |
| 27 | }; |
| 28 | |
| 29 | function addEntriesListeners() { |
| 30 | let cacheEntry = document.getElementById('entry-cache'); |
nothing calls this directly
no test coverage detected