kintesh / containerise

Firefox extension to automatically open websites in a container
MIT License
408 stars 54 forks source link

Feature Request: Change containers by specific URL instead of the domain only. #149

Open rtevans01 opened 3 years ago

rtevans01 commented 3 years ago

Title says it all. It would be nice if we could have more granular control. I often change my container based on the entire URL address. Thanks.

LoveIsGrief commented 3 years ago

What have you tried? It should be already possible.

addons.mozilla.org/es/firefox , Shopping for example only containerizes URLs that start with that path while leaving the rest of addons.mozilla.org intact.

rtevans01 commented 3 years ago

It doesn't work when changing subreddits on Reddit.

‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐ On Friday, February 12th, 2021 at 2:22 PM, LoveIsGrief notifications@github.com wrote:

What have you tried? It should be already possible.

addons.mozilla.org/es/firefox , Shopping for example only containerizes URLs that start with that path while leaving the rest of addons.mozilla.org intact.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

kintesh commented 3 years ago

Isn't the new Reddit SAP? Need to confirm if extensions can observe url changes via history api.

benyaminl commented 3 years ago

What have you tried? It should be already possible.

addons.mozilla.org/es/firefox , Shopping for example only containerizes URLs that start with that path while leaving the rest of addons.mozilla.org intact.

Hello I hereby confirm this also isn't working on my side. I tried to add https://classroom.google.com/c/MjQ2NjYwODE4NDAx* as the link and save it, but it doesn't go to the container when I navigate to that link or even

*mjq2njywode4ndax* , STTS
*mjq2njywode4ndyx* , STTS
LoveIsGrief commented 3 years ago

@benyaminl the * aren't being interpreted in your rules. https://github.com/kintesh/containerise states this image

You will need to use e.g !*mjq2njywode4ndax* , STTS if you want * to work. Could you try it with that?

benyaminl commented 3 years ago

@benyaminl the * aren't being interpreted in your rules. https://github.com/kintesh/containerise states this image

You will need to use e.g !*mjq2njywode4ndax* , STTS if you want * to work. Could you try it with that?

I tried. It stay on default container. Any other ways? image Only domain works. And the domain settings on addons settings are turned off image

using @+.MjQ2NjYwODE4NDAx also doesn't help with regex. Tested with regexr.com javascript. image

What have you tried? It should be already possible.

addons.mozilla.org/es/firefox , Shopping for example only containerizes URLs that start with that path while leaving the rest of addons.mozilla.org intact.

This also don't work with containerize

@.+mjq2njywode4ndax , STTS
https://classroom.google.com/u/0/c/mjq2njywode4ndax , STTS

EDIT : I found the root cause. MjQ2NjYwODE4NDAx is uppercase, and when we save it, it become lowercase, that should be the case. Does the CSV really need to be lowered? I think about it hm.. and JS doesn't support (?i) modifier. It only works directly on the regex class, we only could change using /gi at the end of it. https://regexr.com/5nh9d

because

@.+classroom.google.com.+

do work

benyaminl commented 3 years ago

Hello, @LoveIsGrief could you reproduce based on my post before? The only resort for me now only adding some query param to make it work, as the regex is case sensitive.

so for that url that's case sensitive like https://classroom.google.com/u/0/c/MjQ2NjYwODE4NDAx, I add query param ?domain=stts.edu to https://classroom.google.com/u/0/c/MjQ2NjYwODE4NDAx?domain=stts.edu so it will trigger the containerise based on domain config

!*stts.edu, STTS

I think the regex selector should support case insensitive because when you save the config, you make it lowercase. maybe probably here(just guessing it) and make it /gi https://github.com/kintesh/containerise/blob/ec227436341fb761a7bdc51477085779e5c6373b/src/utils.js#L96-L99

Any reply regard this is appreciated thanks.

LoveIsGrief commented 3 years ago

@benyaminl it looks like you found the root cause. I don't contribute code to this project anymore as I maintain a fork to make more radical changes.

You can fork #125 which should contain the fix for this issue, which I wrote a long time ago, and test it to see if it fixes your issue.

benyaminl commented 3 years ago

@benyaminl it looks like you found the root cause. I don't contribute code to this project anymore as I maintain a fork to make more radical changes.

You can fork #125 which should contain the fix for this issue, which I wrote a long time ago, and test it to see if it fixes your issue.

Seems yours working. I remove containerise. Thanks. It seems work decently. I give star.

timmooney commented 3 years ago

I too have run into issues where containerise isn't correctly handling mixed-case URLs in a regex. This breaks the ability for me to get certain URLs to open in specific containers.

It would be really nice if containerise wasn't automatically lower-casing everything in the regex when clicking "Save". If I typed in a capital letter in my regex, I want it to be there.

benyaminl commented 3 years ago

I too have run into issues where containerise isn't correctly handling mixed-case URLs in a regex. This breaks the ability for me to get certain URLs to open in specific containers.

It would be really nice if containerise wasn't automatically lower-casing everything in the regex when clicking "Save". If I typed in a capital letter in my regex, I want it to be there.

For now I create a lowercase get/query param that make the containerise work.

Example https://classroom.google.com/u/0/c/MjQ2NjYwODE4NDAx

To

https://classroom.google.com/u/0/c/MjQ2NjYwODE4NDAx?domain=stts.edu so it will trigger the containerise based on domain config

for now it's the only way to make it work