| 507 | } |
| 508 | |
| 509 | class WebShareTargetUI { |
| 510 | constructor() { |
| 511 | const parsedUrl = new URL(window.location); |
| 512 | const title = parsedUrl.searchParams.get('title'); |
| 513 | const text = parsedUrl.searchParams.get('text'); |
| 514 | const url = parsedUrl.searchParams.get('url'); |
| 515 | |
| 516 | let shareTargetText = title ? title : ''; |
| 517 | shareTargetText += text ? shareTargetText ? ' ' + text : text : ''; |
| 518 | |
| 519 | if(url) shareTargetText = url; // We share only the Link - no text. Because link-only text becomes clickable. |
| 520 | |
| 521 | if (!shareTargetText) return; |
| 522 | window.shareTargetText = shareTargetText; |
| 523 | history.pushState({}, 'URL Rewrite', '/'); |
| 524 | console.log('Shared Target Text:', '"' + shareTargetText + '"'); |
| 525 | } |
| 526 | } |
| 527 | |
| 528 | |
| 529 | class Snapdrop { |
nothing calls this directly
no outgoing calls
no test coverage detected