Nativefier: Support opening URLs passed as parameter to Nativefied application (+ "deep linking")

Created on 10 Jul 2017  ยท  12Comments  ยท  Source: jiahaog/nativefier

Description

It doesn't seem to be possible to have a Nativefier app open up links from other apps. This works with Epichrome, but Nativefier apps are much nicer to use.

Steps to Reproduce Issue

Try to drag URL to dock icon of Nativefier app - nothing happens.
Use Choosy to set up custom rule to open Nativefier app as browser for certain links - app comes to foreground but doesn't open link.

Specifications

Version of Nativefier 7.4.0
Version of Node.jsv6.9.1
OS: macOS 10.12.5
Architecture: x86

feature-request

Most helpful comment

Reopening this.

The use case is Google Docs. Each document is a unique URL. I want to create a Docs app, a Slides app, and a Sheets app. I want to edit documents in windows, each within their own app, like a native office suite (Office/iWork). In order to do this I need my Nativefier apps to receive URLs.

If someone sends me a link to a doc in Gmail, I want my Gmail Nativefier app to open the document in my Docs app, not a browser tab. There's no way to do that if the Docs app can't receive URLs.

This use case is very similar to iOS. There are native apps for Google Docs, Sheets, and Slides. When you tap on a link to a doc the OS intelligently opens the Docs app, not a web page in Safari. I want to create the same thing.

If Nativefier could just receive HTTPS URLs to start with, Choosy or Browser Fairy can handle which app should launch for each URL domain. Long term it would be great if apps could register their own URL helper scheme.

From an outsider's perspective this initial functionality doesn't seem particularly difficult. Just open whatever HTTP URL is passed through, as long as it matches the internal-urls regex. It's very similar to Gmail spawning secondary windows except the URLs are coming from outside the app, not inside.

It also seems to fit perfectly within Nativefier's goal of taking popular web apps and making them feel native. That's exactly what I'm trying to do.

Therefore, in response:

You have to open a one-time URL?
โ†’ Use your browser ๐Ÿ™‚.

Each Doc has a unique URL. I open countless unique Docs URLs daily.

It's a one-time URL but you want it to be isolated?
โ†’ Open it in an incognito window in your browser.

I don't want to edit Docs in a browser tab, I want to edit them in my Docs app. The Docs app is a superior experience since it feels like a native word processor. The windows are cleaner and each document has its own window.

It's not a one-time URL but a frequently-used app?
โ†’ Well, nativefy it.

It is a very frequently used app, but I need it to open the proper URL for each document link when I click on it in other apps.

All 12 comments

Hi @dsemaya, thanks for the feedback ๐Ÿ‘. Not sure I want to file this as feature request though, such a feature would be precisely opposed to Nativefier's main goal, which is precisely to bundle applications.

  • You have to open a one-time URL?
    โ†’ Use your browser ๐Ÿ™‚.
  • It's a one-time URL but you want it to be isolated?
    โ†’ Open it in an incognito window in your browser.
  • It's not a one-time URL but a frequently-used app?
    โ†’ Well, nativefy it.

Closing, but feel free to argue if I'm missing your point, and we can re-open.

Reopening this.

The use case is Google Docs. Each document is a unique URL. I want to create a Docs app, a Slides app, and a Sheets app. I want to edit documents in windows, each within their own app, like a native office suite (Office/iWork). In order to do this I need my Nativefier apps to receive URLs.

If someone sends me a link to a doc in Gmail, I want my Gmail Nativefier app to open the document in my Docs app, not a browser tab. There's no way to do that if the Docs app can't receive URLs.

This use case is very similar to iOS. There are native apps for Google Docs, Sheets, and Slides. When you tap on a link to a doc the OS intelligently opens the Docs app, not a web page in Safari. I want to create the same thing.

If Nativefier could just receive HTTPS URLs to start with, Choosy or Browser Fairy can handle which app should launch for each URL domain. Long term it would be great if apps could register their own URL helper scheme.

From an outsider's perspective this initial functionality doesn't seem particularly difficult. Just open whatever HTTP URL is passed through, as long as it matches the internal-urls regex. It's very similar to Gmail spawning secondary windows except the URLs are coming from outside the app, not inside.

It also seems to fit perfectly within Nativefier's goal of taking popular web apps and making them feel native. That's exactly what I'm trying to do.

Therefore, in response:

You have to open a one-time URL?
โ†’ Use your browser ๐Ÿ™‚.

Each Doc has a unique URL. I open countless unique Docs URLs daily.

It's a one-time URL but you want it to be isolated?
โ†’ Open it in an incognito window in your browser.

I don't want to edit Docs in a browser tab, I want to edit them in my Docs app. The Docs app is a superior experience since it feels like a native word processor. The windows are cleaner and each document has its own window.

It's not a one-time URL but a frequently-used app?
โ†’ Well, nativefy it.

It is a very frequently used app, but I need it to open the proper URL for each document link when I click on it in other apps.

@dsemaya thanks for the clarification ๐Ÿ‘. Makes sense, now that I know your use case is opening URLs "for the same app". Your first-time description sounded like dragging youtube.com on a facebook app, which made no sense.

Re-opening (which only means the issue is open, no guarantee anyone will work on that).

I have the same issue - I have created a "Jira" app and want urls to specific issues to open in my "Jira" app.

This issue was mixing two concerns; claryfing them based on feedback from @jancbeck on #604. The two concerns are:

  1. Dispatch opening URLs to different browser/apps depending on the URL (matching the domain or a regex/wildcard pattern).
  2. Let Nativefied apps accept and open a site passed as parameter. This is what this issue is about and I renamed the issue to make that clear. PR still welcome ๐Ÿ™‚.

Looks like the "open-url" event could be helpful:

app.on('open-url', function(event, url) {
  console.log("Open URL: " + url);
  event.preventDefault();
});

Tried adding that to main.js and manually editing Info.plist to support http(s) but I'm not getting anything back in the console.
It is a macOS-only feature, but I'm testing on macOS.

I installed Choosy, but I don't see how that helps:

image

Now, while that app activates (or launches) when I click an Asana link, it doesn't actually navigate there. What do I do?

@ELLIOTTCABLE you reproduced what this issue is about. You could submit a PR or just hope somebody else pics it up.

For macOS, does Electron's 'open-url' event do this behavior?

@ronjouch I found what appears to be a Choosey equivalent for Windows, BrowserSelector . Any progress on getting Nativefier to support the core of this issue?

Hi, another great alternative for choosy on macOS is Finicky: it's open-source, in active development and more customizable for power users.
Concerning the actual issue, @jancbeck 's solution sounds promising. Did you have any luck getting that to work?

UPDATE: sorry just saw #767 , thanks @dahjelle ! This feature would be really great.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

StyxOfDynamite picture StyxOfDynamite  ยท  4Comments

Waitsnake picture Waitsnake  ยท  5Comments

ranzou06 picture ranzou06  ยท  3Comments

jamiewilson picture jamiewilson  ยท  5Comments

simonweil picture simonweil  ยท  5Comments