()
| 13 | } |
| 14 | |
| 15 | function getAlternateUrl(): string { |
| 16 | const url = new URL(location.href); |
| 17 | |
| 18 | if (isHidingWhitespace()) { |
| 19 | url.searchParams.delete('w'); |
| 20 | } else { |
| 21 | url.searchParams.set('w', '1'); |
| 22 | } |
| 23 | |
| 24 | return url.href; |
| 25 | } |
| 26 | |
| 27 | function addShortcut(signal: AbortSignal): void { |
| 28 | registerHotkey('d w', getAlternateUrl(), {signal}); |
no test coverage detected