Skip to content

Commit 86dd59d

Browse files
committed
Ignore untrusted click events on the apply response button
└── apps ├── browser │ └── src │ ├── background │ │ └── message-handler.ts │ ├── content-scripts │ │ └── send-prompt-content-script │ │ ├── chatbots │ │ │ └── hugging-chat.ts │ │ ├── send-prompt-content-script.ts │ │ └── utils │ │ ├── add-apply-response-button.ts │ │ └── session-state.ts │ └── types │ └── messages.ts └── editor └── src ├── commands │ └── apply-response-command │ └── apply-response-command.ts └── services ├── websocket-manager.ts └── websocket-server-process.ts
1 parent 8e7fa75 commit 86dd59d

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

‎apps/browser/src/content-scripts/send-prompt-content-script/utils/add-apply-response-button.ts‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,9 @@ export function add_apply_response_button(params: {
3131
apply_response_button_style(apply_response_button)
3232
if (params.customize_button) params.customize_button(apply_response_button)
3333

34-
apply_response_button.addEventListener('click', async () => {
34+
apply_response_button.addEventListener('click', async (event) => {
35+
if (!event.isTrusted) return
36+
3537
set_button_disabled_state(apply_response_button)
3638
requestAnimationFrame(async () => {
3739
await params.perform_copy(params.footer)

0 commit comments

Comments
 (0)