[SalesForce] (Properly) Link to custom Lightning App from record detail page

I have a custom lightning app.

How can I link to this app from a record's detail LEX page (e.g. Opportunity) and pass the Opp's ID to it?
The end-user is supposed to launch the app and do some additional Opportunity-stuff.

I've tried this so far:

  1. Create a custom button (type = URL). Content:

    {!URLFOR('/c/OppAwesomizer.app?opp=' + Opportunity.Id )}

The button/action shows up on the Opp's detail page (in LEX), but…

So e.g. my Chrome just displays a blank area and the console shows this message:

Uncaught SecurityError: Failed to read the 'sessionStorage' property
from 'Window': Access is denied for this document.

  1. Create a custom action to a LEX-enabled VF page that redirects to the app: Same behaviour as above…

Any help is greatly appreciated, I don't think SF has no way to achieve this but I have not been able to find anything on this…

Best Answer

This works in a URL button, although it sometime gives a warning "We'd like to open the Salesforce page https://[myDomain].lightning.force.com... in a new tab. Because of your browser settings, we need your permission first."

/c/OppAwesomizer.app#{!Opportunity.Id}
Related Topic