New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Weird drag and drop with Electron app #33

Open
scripting opened this Issue Oct 2, 2017 · 2 comments

Comments

Projects
None yet
2 participants
@scripting
Owner

scripting commented Oct 2, 2017

I want my Electron app to handle drag-and-drop from the desktop.

I want to drag an OPML file onto it, and have it open it.

I have done this before with Electron apps, for example Public Folder lets you drag a file onto it to upload it. It works.

In this case, it works when I'm debugging the app, but when I build the app, it launches the OPML Editor. This is so weird. When I drag an OPML file onto Chrome, it shows me the OPML source.

But when I do it with the browser inside Electron it opens it in the OPML Editor.

I figure I have something configured in the OS to make it do this, but I have no memory of doing it and no idea how it might have worked.

Any suggestions most welcome.

@richb-hanover

This comment has been minimized.

Show comment
Hide comment
@richb-hanover

richb-hanover Oct 2, 2017

I don't know for sure, but maybe this is a clue: What happens if you double-click the OPML file? Does OPML Editor open?

If so, perhaps Electron is responding to the Finder's Open With... attribute. To see that attribute, use Finder's Get Info on a ".opml" file. You'll see a section of the Info window with "Open with:" dropdown.

You can set this to tell the Finder always to open that file with the selected program. If you click "Change All...", it'll permanently open any file with that suffix using the selected program. Good luck!

richb-hanover commented Oct 2, 2017

I don't know for sure, but maybe this is a clue: What happens if you double-click the OPML file? Does OPML Editor open?

If so, perhaps Electron is responding to the Finder's Open With... attribute. To see that attribute, use Finder's Get Info on a ".opml" file. You'll see a section of the Info window with "Open with:" dropdown.

You can set this to tell the Finder always to open that file with the selected program. If you click "Change All...", it'll permanently open any file with that suffix using the selected program. Good luck!

@scripting

This comment has been minimized.

Show comment
Hide comment
@scripting

scripting Oct 2, 2017

Owner

Rich, thanks for the clues. Your guesses were all correct. ;-)

  1. When I double-click it does open the OPML Editor.

  2. When I did a Get Info, the popup menu does say open the OPML Editor.

  3. I tried changing it to my new app, but no luck -- the Finder no longer opens the OPML Editor but it opens the file in the browser, showing me the OPML as an XML file (which it is).

Owner

scripting commented Oct 2, 2017

Rich, thanks for the clues. Your guesses were all correct. ;-)

  1. When I double-click it does open the OPML Editor.

  2. When I did a Get Info, the popup menu does say open the OPML Editor.

  3. I tried changing it to my new app, but no luck -- the Finder no longer opens the OPML Editor but it opens the file in the browser, showing me the OPML as an XML file (which it is).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment