Open multiple links using a specific browser

I know I can do that with Send Intent, but if I want to open it with a new browser in the future, I have to manually change all the package name from each link. Is there a way that when I run the macro, it pops up a message to ask me which browser I want to use to open these links? Or any alternative that is reasonably easy and quick. Also, is there a way to create one single “Send Intent” action that opens multiple links at once, instead of creating multiple “Send Intent” actions and each with a different link? I'm new to the macro world, thanks for helping!
 

RSF

Well-known member
One option for your first question would be to leave the package name blank, in which case Android should pick whatever browser you've configured as your default:
Screenshot 2023-04-25 8.08.37 PM.png
This works on Android 12 and 13.

There may be a way to change the default browser via settings manipulation in MacroDroid, but I'm not aware of it. Others may know.
 
One option for your first question would be to leave the package name blank, in which case Android should pick whatever browser you've configured as your default:
View attachment 5407
This works on Android 12 and 13.

There may be a way to change the default browser via settings manipulation in MacroDroid, but I'm not aware of it. Others may know.
Thanks for the idea, unfortunately, it says no activity found to handle intent even though I'm running Android 12 on Oneplus 7 pro.
 

RSF

Well-known member
Hmmm. Worked on my phone (Pixel 6 / Android 13) with both Chrome and DuckDuckGo browsers. Couple things you might try:
  • Make sure the Data parameter is a valid URL like "https://google.com" in the example above. I assume Android parses that to determine which default app to invoke.
  • Leave the MIME Type blank. For some reason, specifying anything there, even the presumably valid "text/html", triggers the "No activity found" error
  • Make sure you have a default browser app selected for the browser (Settings / App / Default Apps / Browser App). I don't have an option for "Undefined" on my phone, just those two browser apps I've installed, so this may not help...
 
Hmmm. Worked on my phone (Pixel 6 / Android 13) with both Chrome and DuckDuckGo browsers. Couple things you might try:
  • Make sure the Data parameter is a valid URL like "https://google.com" in the example above. I assume Android parses that to determine which default app to invoke.
  • Leave the MIME Type blank. For some reason, specifying anything there, even the presumably valid "text/html", triggers the "No activity found" error
  • Make sure you have a default browser app selected for the browser (Settings / App / Default Apps / Browser App). I don't have an option for "Undefined" on my phone, just those two browser apps I've installed, so this may not help...
It turns out I can't leave out the https part of the link, it works now. I'd like to be prompted with “open with” message, so I can choose which browser to open these link with, instead of setting a different default browser every time. But still, thank you so much for helping out.
 

RSF

Well-known member
Yeah; understood. You could try UI Interaction to pick the default browser, but that's subject to Android & UI changes, so isn't the best option.

Maybe MacroDroid will at some point allow a variable for the package, in the Send Intent action.

In the meantime, assuming you have only a few browsers you want to choose between, you could always create an if/else-if scheme like the attached. Each browser would have its own Send Intent action, but since the URL to open can be a variable, you could modify the macro to loop through your URL's, invoking the browser if/else-if scheme each time (or even in an action block).

Screenshot 2023-04-27 4.08.35 PM.png
 

Attachments

  • Select_default_browser_.macro
    12.7 KB · Views: 11
Yeah; understood. You could try UI Interaction to pick the default browser, but that's subject to Android & UI changes, so isn't the best option.

Maybe MacroDroid will at some point allow a variable for the package, in the Send Intent action.

In the meantime, assuming you have only a few browsers you want to choose between, you could always create an if/else-if scheme like the attached. Each browser would have its own Send Intent action, but since the URL to open can be a variable, you could modify the macro to loop through your URL's, invoking the browser if/else-if scheme each time (or even in an action block).

View attachment 5421
That seems like the best solution for now, thank you so much!
 
Top