I have a webpage that tries to check the contents of the user's clipboard using navigator.clipboard.readText(). There's a button the page that can import something from the user's clipboard, but only if the contents are in the right format. I want to enable the button if the contents are in that format, and disable it if not.

Since there's no easy way to know when the clipboard contents have updated, I'm checking it repeatedly. Chrome just asks for permission to access the clipboard once, but Firefox asks every time I try to check the clipboard contents, and pops up a rather unhelpful ephemeral context menu to do so.

I'm aware that setting dom.events.testing.asyncClipboard in about:config solves the problem, but I can't ask all my site's users to do this.

Is there a way to get Firefox to only check once and then silently allow reading the clipboard going forwards?

DrRelling's user avatar

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.