Open Bug 1773681 Opened 2 years ago Updated 2 years ago

Enable showing "Paste" button for `navigator.clipboard.readText()` when called from Addons which don't have `clipboardRead` permssion

Categories

(Core :: DOM: Copy & Paste and Drag & Drop, task)

task

Tracking

()

People

(Reporter: mbrodesser-Igalia, Assigned: edgar, NeedInfo)

References

(Blocks 1 open bug)

Details

(Keywords: dev-doc-needed)

Attachments

(2 files)

No description provided.
Summary: Enable showing "Paste" button for `navigator.clipboard.readText()` when called from Addons → Enable showing "Paste" button for `navigator.clipboard.readText()` when called from Addons which don't have `clipboardRead` permssion

After bug 1744524, we use different security model for clipboard.readText() in web content which will show a prompt to user. Currently we keeps security model for Addons unchanged, i.e. Addon is allowed to read clipboard only if it has clipboardRead permission, otherwise, throw an error.

I am not sure if we need to apply the user prompt to Addon, there are following possible options off the top of my head.
1). Keeps security model for Addons unchanged: if Addon has clipboardRead permission, allow to read (without showing prompt), otherwise, throw an error.
2). If Addon has clipboardRead permission, show the prompt to user, otherwise reject promise.
3). If Addon has clipboardRead permission, allow read (without showing prompt), otherwise, show a prompt to user.
or 4). others

It will be nice to have some input from Addons folks, :zombie, would you mind shedding some light here? Or do you know who might have opinion on this? Thanks!

Flags: needinfo?(tomica)

Hi Edgar! Personally, I would prefer 1 or 3, as my extension depends on that behavior to do some very cool things.

I think the option 3 would be our preference, generally whatever is available to normal web pages is by default exposed to extensions (unless we have a specific reason not to).

We would be very much against option 2, as it would be both a backwards-breaking change, and cross-browser compatibility issue.

I'll follow up with the team and let you know if we have any more opinions here.

Thanks :zombie, then we will go with option 3 first in this bug, feel free to file a new bug or comment if any other opinions.

Assignee: nobody → echen

Move common code into head.js

Depends on D159895

Attachment #9299571 - Attachment description: Bug 1773681 - Cleanup clipboard browser tests; → Bug 1773681 - Cleanup clipboard browser tests; r?smaug
Attachment #9299572 - Attachment description: Bug 1773681 - Enable clipboard context menu on extension; → Bug 1773681 - Show clipboard context menu on extension; r?smaug
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: