8 ms·
Does it support regular expressions to match parts of a URL? I have two different GitHub accounts, that I need to be able open in different containers based on
by Ch00k 2y ago
Does it support regular expressions to match parts of a URL? I have two different GitHub accounts, that I need to be able open in different containers based on the organization name (https://github.com/<org> https://github.com/<org>). I am currently using https://addons.mozilla.org/en-CA/firefox/addon/containerise/ https://addons.mozilla.org/en-CA/firefox/addon/containerise/, but it is a bit of a pain. I would much prefer defining my rules in code.
- 0x696C6961 2y agoYeah, it's JavaScript so you can write whatever logic you want! if (url.hostname === "github.com") { if (/.*foo.*/.test(url.pathname)) { return "My Foo Conatiner" } if (/.*bar.*/.test(url.pathname)) { return "My Bar Container" } }