andy-portmen / open-in

Send URLs from one browser to another one
http://add0n.com/open-in.html
172 stars 113 forks source link

Feature Request: Specify subdomains to be included/excluded #64

Open e-t-l opened 2 years ago

e-t-l commented 2 years ago

Hi Andy, this request is kind of the opposite of #18. Is it possible to specify which subdomains to include/exclude? For example, I want Open-In to capture clicks for https://**mail**.google.com, but NOT for other subdomains like https://**docs**.google.com, https://**sheets**.google.com, https://**www**.google.com, etc.

Is this already possible, and I'm just doing something wrong? These are my current settings, where non-specified google subdomains (like docs and sheets) are getting captured by Open-In...

Comma-separated list of domains to open with the external browser when the link is opened with left-click

Comma-separated list of URLs to open with the external browser when the link is opened with left-click

https://mail.google.com/*

Comma-separated list of keywords to open with the external browser when the link is opened with left-click

mail

  Thanks!

Out-Of-Names commented 2 years ago

I was going to request something similar that would allow the same thing. I was thinking that a simple blacklist of sites to not open in another browser would work. As long as the blacklist has priority over the whitelist, the same results could be achieved. i.e. Blacklist: docs.google.com, sheets.google.com Whitelist: google.com Result: Opening docs.google.com hits the blacklist and the original browser processes the request. Opening mail.google.com does not hit on the blacklist but does hot on the whitelist so the other browser receives the request.

andy-portmen commented 2 years ago

The new release of "Open in Firefox" in the URL matching section uses URLPattern API. With this powerful API, you can probably achieve what you need.

https://github.com/andy-portmen/open-in-firefox/blob/master/v3/data/inject.js#L35

beyond9thousand commented 1 year ago

doesn't really answer the question. I've been relentlessly trying out multiple domain names with the reverse mode enabled but links that are supposedly whitelisted with reverse mode enabled still keep opening in firefox. can you point me in the right direction? the domain i am trying to whitelist is discord

Camusensei commented 1 year ago

I confirm the URLPattern API does not allow handing exceptions. Regular expressions also do not allow everything-but-a-defined-text. If I want to use the external browsers for ALL LINKS except say "example.com", there is no way to do it currently with the extension.

EDIT: HOWEVER, the "reverse mode" allows you to revert the regex matching, which seems to be fine enough for me.

chaoscreater commented 7 months ago

I'm trying to use the following regex and it doesn't work:

^https://teams\.microsoft\.com/(?!dl/launcher).* Basically, I want anything that is teams.microsoft.com/* except teams.microsoft.com/dl/launcher to be open in Firefox. I'm using reverse mode and trying to add the regex to the URL pattern list and it just doesn't work. There needs to be a separate option for a blacklist that overrides everything else.