TypeScript

Code

【TypeScript初心者】選択したテキストをコンテキストメニューを使ってクリップボードにコピーするChrome拡張機能

テキストを選択して右クリックメニューからクリップボードにコピーするChrome拡張機能の開発に関する記事になります。サービスワーカーとコンテンツスクリプト間のやり取りと、Uncaught (in promise) NotAllowedError: Failed to execute 'writeText' on 'Clipboard': Document is not focused.のエラーへの対応も紹介します。