ResourceOverride icon indicating copy to clipboard operation
ResourceOverride copied to clipboard

Using regex in the Tab URL Input

Open thmsgbrt opened this issue 7 years ago • 6 comments

Hi! I think it would be a great idea to have the possibility of setting a regex as Tab URL. I'm using Resource Overrides to match a set of URLs and as for now, I've to change the Tab URL when I want to match another page of a website.

Do you think it could be implemented ?

Thank you very much! Thomas

thmsgbrt avatar Apr 19 '18 08:04 thmsgbrt

I might look into it. As of now you can use *s to kinda help you do what you want but the result might be too "accepting". If you have a set of urls you want to match and they are not very similar, then yeah you'd either have to use just a single * or have a bunch of rules.

kylepaulsen avatar Apr 20 '18 18:04 kylepaulsen

ok, thanks for your answer 😄

thmsgbrt avatar Apr 23 '18 08:04 thmsgbrt

Hi @kylepaulsen , thanks for creating and maintaining this extension! I'm just starting to use it and think it's genius!

I have a similar use case to @thmsgbrt in that I would like to redirect a resource based on a URL parameter (eg. ://xyz.com//?...&theme=01 or ://xyz.com//?theme=01) and if I understand correctly, the current implementation means that I need to create a new URL rule for each both /?theme=* AND /?&theme= is this correct?

Either way, I still think that this feature would be useful, hence why I'm adding my +1.

Cheers

johnryan1982 avatar Sep 12 '18 11:09 johnryan1982

Hey @johnryan1982,

I built a Chrome Extensions to replace a specific request by a link of your choice, maybe it can help you. https://github.com/thmsgbrt/HTTP-Request-override

Bye!

thmsgbrt avatar Sep 12 '18 12:09 thmsgbrt

You could try something like

Match: *example.com*?*myparam=*

That would match if you are on example.com at some path with query param "myparam"

But if you wanted to be more generic maybe something like:

Match: *?*myParam=* 

Hopefully that helps...

kylepaulsen avatar Sep 12 '18 13:09 kylepaulsen

Thanks both for the feedback. I'll be looking into both options...

johnryan1982 avatar Sep 12 '18 15:09 johnryan1982