| 164 | }, |
| 165 | |
| 166 | copyCurrentUrl() { |
| 167 | chrome.runtime.sendMessage({ handler: "getCurrentTabUrl" }, function (url) { |
| 168 | HUD.copyToClipboard(url); |
| 169 | // This length is determined empirically based on a 350px width of the HUD. An alternate |
| 170 | // solution is to have the HUD ellipsize based on its width. |
| 171 | const maxLength = 40; |
| 172 | if (url.length > maxLength) { |
| 173 | url = url.slice(0, maxLength - 2) + "..."; |
| 174 | } |
| 175 | HUD.show(`Yanked ${url}`, 2000); |
| 176 | }); |
| 177 | }, |
| 178 | |
| 179 | openCopiedUrlInNewTab(count, request) { |
| 180 | HUD.pasteFromClipboard((url) => |