Indirectly selling haram

Assalamu alaikum,

I wanted to ask about the indirect selling or investing ina company that could sell haram. For example investing in a supermarket that sells halal aswell as haram products.
Another more specific example was say for you develop/invest in an app that allows restuarants to advertise themselves and you take a transaction fee of any orders that are placed through your app, is this haram.

2 posts were merged into an existing topic: Investing Question: Investing in a food company