timche / gmail-desktop

:postbox: Nifty Gmail desktop app for macOS, Linux & Windows
MIT License
832 stars 91 forks source link

Add support for disabling the "open external link" warning for **all** domains #190

Closed cipriancraciun closed 4 years ago

cipriancraciun commented 4 years ago

In the latest version 2.18 the "do you want to open the external link" alert was introduced. (Which I find welcomed for the normal user.)

However advanced users, might use custom xdg-open wrappers that already include facilities to triage the opened URL's. For these advanced users, I would propose adding the following simple "workaround":

If the trustedHosts array contains an *, then allow opening all URL's without asking the question. (This doesn't necessarily require a menu, as advanced users can simply edit their configuration file and add that manually.)

It appears that only a single line of code has to be changed in: https://github.com/timche/gmail-desktop/blob/b87767e0e47e5c73dd3df17dd3cd9dd725d446a2/src/app.ts#L177-L180 , to add:

- if (trustedHosts.includes(origin)) { 
+ if (trustedHosts.includes(origin) || trustedHosts.includes("*")) { 
timche commented 4 years ago

We can easily make this configurable through the settings menu by enabling/disabling this feature.

timche commented 4 years ago

Closed by 72083d435e914fadf55778ddbc1adedc8f0541cb.