8000 Can't prevent dropped file from opening in webview · Issue #13811 · electron/electron · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Can't prevent dropped file from opening in webview #13811
Closed
@EdwardLiao

Description

@EdwardLiao
  • Electron Version: 2.0.3
  • Operating System (Platform and Version): macOS 10.13.5

Expected Behavior
By default, dropping a file to a webview will trigger electron to open it within the webview.
I expect there is some way to prevent it.

Actual behavior
I can not find a way to prevent it.

To Reproduce

I'm trying to prevent the default drop behavior of Electron by adding the following code to renderer process.

document. = (ev) => {
    ev.preventDefault()
    ev.stopPropagation();
}
  
document.body. => {
    ev.preventDefault();
    ev.stopPropagation();
}

It did work for any non-webview elements, but if I drop the file to a webview, the webview will open the dropped file.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0