This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 27010 - allow beforepaste event listeners to inspect type of clipboard contents (?)
Summary: allow beforepaste event listeners to inspect type of clipboard contents (?)
Status: RESOLVED FIXED
Alias: None
Product: WebAppsWG
Classification: Unclassified
Component: HISTORICAL - Clipboard API and events (show other bugs)
Version: unspecified
Hardware: PC Windows NT
: P2 normal
Target Milestone: ---
Assignee: Hallvord R. M. Steen
QA Contact: public-webapps-bugzilla
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-10-09 15:31 UTC by Hallvord R. M. Steen
Modified: 2014-12-19 11:17 UTC (History)
1 user (show)

See Also:


Attachments

Description Hallvord R. M. Steen 2014-10-09 15:31:46 UTC
A script listening to beforepaste might only want to handle certain types of content. For example, it may want to enable the paste command for text and HTML but not images. We should consider if a beforepaste listener should be allowed to inspect the types (but not the actual contents) of the clipboard data.

(Technically, to do this we spec that the event object passed to all three types will be a ClipboardEvent instance and that the associated drag data store is in protected mode).
Comment 1 Hallvord R. M. Steen 2014-10-09 15:35:31 UTC
The proposed solution obviously adds type inspection to copy and cut events too - is it worth the trouble to special-case beforecut and beforecopy and give them an empty, newly initialized data store? Possibly - it could be a privacy issue, for example leaking details about installed software that can be inferred from types of clipboard content if user or website triggers copy/cut.
Comment 2 Hallvord R. M. Steen 2014-12-19 11:17:35 UTC
This should be working now