Browsers-software/browsers

Trying to create a rule that opens all links from Mail in Safari

Closed this issue · 4 comments

I'm trying to create a config stanza that will just "open all links from Mail.app in Safari, regardless of the rest of the rules in config.json"

The documentation is still a little light on using the source_app parameters, but this is what I've written:

  {
      "source_app": "com.apple.mail",
      "url_pattern": "*",
      "opener": {
        "profile": "/System/Volumes/Preboot/Cryptexes/App/System/Applications/Safari.app/Contents/MacOS/Safari#",
        "incognito": false
      },
      "profile": "",
      "incognito": false
    }

But this doesn't work. I've also tried using null for url_pattern with the same results.

Any tips?

Edit: I also tried moving the rule to the very top, in case sequential processing was the issue. That didn't work either.

Hey. You can use "**" as url_pattern

    {
      "source_app": "com.apple.mail",
      "url_pattern": "**",
      "opener": {
        "profile": "/System/Volumes/Preboot/Cryptexes/App/System/Applications/Safari.app/Contents/MacOS/Safari#",
        "incognito": false
      },
      "profile": "",
      "incognito": false
    }

I tried that but it still opens in Arc - here's a more complete picture of what I'm trying to do.

I have Arc configured to pick up all "docs.google.com" links. But sometimes, I get an email to my personal account that has an embedded Google docs link. That email will always come in from Mail.app. I want Browsers to recognize that I clicked on a link matching that pattern (or any link) from that app, and route it to Safari instead of my work-configured Arc instance.

So, I have an existing URL matcher rule:

 {
      "source_app": null,
      "url_pattern": "*://docs.google.com/**",
      "opener": {
        "profile": "/Applications/Arc.app/Contents/MacOS/Arc#",
        "incognito": false
      },
      "profile": "",
      "incognito": false
    },

And this one always seems to win over the "open ** from mail.app in Safari" rule

I tried changing the order, moving the mail one to top, and that did do the trick for me.
Just in case, exit Browsers while editing the config file, let me know if that helped.

Yes! Ok, so I needed two things. To have the rules in the right order and to correct the URL matching pattern. Now this works as expected. Appreciate the help and great app as always 😄