Skip to content
This repository was archived by the owner on Dec 15, 2022. It is now read-only.

Conversation

as-cii
Copy link
Contributor

@as-cii as-cii commented Mar 29, 2017

The security model of new Chromium versions forbids all event listeners, except for onDragStart and onDrop, to inspect the data values that have been previously set on the event's dataTransfer object.

To circumvent this problem we can exploit the fact that all we need to do is checking whether a boolean has been set or not. To do so, we will simply list all the items contained in the dataTransfer object and read their type property (that we use as a dictionary key), verifying that at least one of them contains the key we are searching for.

Before:
screen shot 2017-03-29 at 16 39 09

After:
screen shot 2017-03-29 at 16 38 57

/cc: @atom/maintainers

The security model of new Chromium versions forbids all event listeners,
except for `onDragStart` and `onDrop`, to inspect the data values that
have been previously set on the event's `dataTransfer` object.

To circumvent this problem we can exploit the fact that all we need to
do is checking whether a boolean has been set or not. To do so, we will
simply list all the items contained in the `dataTransfer` object and
read their `type` property (that we use as a dictionary key), verifying
that at least one of them contains the key we are searching for.
@thomasjo thomasjo mentioned this pull request Mar 29, 2017
17 tasks
@as-cii as-cii merged commit 4f9e698 into master Mar 30, 2017
@as-cii as-cii deleted the as-fix-missing-drop-indicator branch March 30, 2017 13:44
@as-cii as-cii changed the title Fix missing drop indicator on Electron >= 1.14 Fix missing drop indicator on Electron >= 1.4 Apr 12, 2017
@daviwil daviwil mentioned this pull request Dec 20, 2018
59 tasks
@rafeca rafeca mentioned this pull request Jun 25, 2019
7 tasks
@lkashef lkashef mentioned this pull request Jul 16, 2020
76 tasks
@sadick254 sadick254 mentioned this pull request Dec 1, 2020
58 tasks
@sadick254 sadick254 mentioned this pull request Aug 19, 2021
64 tasks
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant