logseq / logseq/db-test

Bug: Paste fails on Firefox due to asynchronous clipboard read (NotAllowedError)

Open
#919 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
No language data
Stars
28
Forks
2
PR merge metrics
No merged PRs in 30d

Description

Search first
  • I searched and no similar issues were found
What Happened?

When attempting to paste text or content into the Logseq web app on Firefox, the paste operation fails, and the following error is thrown in the developer console:
DOMException NotAllowedError: Clipboard read operation is not allowed.

This issue occurs because Logseq attempts to read the clipboard asynchronously (e.g., using navigator.clipboard.read or readText) after the initial paste event. Firefox has a strict security policy that blocks any asynchronous clipboard read operations unless a specific development flag (dom.events.testing.asyncClipboard) is enabled in about:config, which is insecure for daily use.

Unlike Logseq, most other web apps (like Notion, GitHub, etc.) handle pasting successfully on Firefox because they extract the clipboard data synchronously within the native paste event handler.

Reproduce the Bug
  1. Open Logseq Web app (e.g., https://test.logseq.com/ or a self-hosted instance) using Firefox.
  2. Copy any text from an external source.
  3. Click on a block in Logseq and press Ctrl + V (or Cmd + V on macOS) to paste.
  4. Notice that nothing is pasted into the block.
  5. Open the browser's Developer Tools (F12) -> Console, and you will see the NotAllowedError: Clipboard read operation is not allowed. error.
Expected Behavior

Pasting should work seamlessly on Firefox without requiring users to change risky about:config settings.

To resolve this fundamentally, Logseq should be updated to extract clipboard data synchronously within the paste event handler using e.clipboardData.getData('text/plain') (and 'text/html'), rather than requesting it asynchronously later via the Clipboard API.

Screenshots

No response

Files

No response

Browser, Desktop or Mobile Platform Information

Firefox 150.0.1
https://test.logseq.com/ (2026-06-05)

Additional Context

No response

Are you willing to submit a PR? If you know how to fix the bug.
  • I'm willing to submit a PR (Thank you!)

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No source file or test is identified. Start by locating Logseq's paste event handler and any asynchronous navigator.clipboard.read or readText calls, then reproduce the issue in Firefox. Done means text and HTML paste successfully in Firefox without changing about:config settings.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend, web-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.