Skip to content
This repository was archived by the owner on Nov 6, 2023. It is now read-only.

Update GoogleTranslate.xml - #6996

Merged
jeremyn merged 3 commits into
EFForg:masterfrom
gloomy-ghost:gloomy-ghost-rm-translate_googleapis_com
Sep 30, 2016
Merged

jeremyn merged 3 commits into
EFForg:masterfrom
gloomy-ghost:gloomy-ghost-rm-translate_googleapis_com

Conversation

@gloomy-ghost

@gloomy-ghost gloomy-ghost commented Sep 24, 2016 •

Copy link
Copy Markdown
Collaborator

securecookie for all
remove translate.googleapis.com*

* Preloaded
Chromium, Firefox, Tor

securecookie for all
@jeremyn

jeremyn commented Sep 27, 2016 •

Copy link
Copy Markdown
Contributor

Thanks. Please:

  • Add translate.google.*, translate.google.co.*, and translate.google.com.* to Google.tld_Subdomains.xml along with whatever tests, cookie updates etc are needed
  • Delete GoogleTranslate.xml
  • Add a reference in GoogleServices.xml to Google.tld_Subdomains.xml

@jeremyn jeremyn self-assigned this Sep 27, 2016
@jeremyn

jeremyn commented Sep 27, 2016

Copy link
Copy Markdown
Contributor

Please move the various translate targets to within the appropriate TLD group, instead of bunching them at the end.

@jeremyn

jeremyn commented Sep 28, 2016

Copy link
Copy Markdown
Contributor

Thanks. Please re-add the non-capturing ?: markers to the rule tags. Note that the rule tags use groups so it might not be safe to remove ?:.

@gloomy-ghost

Copy link
Copy Markdown
Collaborator Author

Sorry, I don't get you. Are there any differences? (?:) is in the second group of rule, it only matters when the rewriting pattern contains $3.

@jeremyn

jeremyn commented Sep 29, 2016

Copy link
Copy Markdown
Contributor

Honestly these regexes are complicated, I don't really understand how nested capturing groups work and I don't want to mess with it on high-traffic sites like Google.

@gloomy-ghost

Copy link
Copy Markdown
Collaborator Author

Just had a test on it:

with (?:) redirect to https://$1.google.$2/: https://translate.google.com.kh/
without (?:) redirect to https://$1.google.$2/: https://translate.google.com.kh/

with (?:) redirect to https://$1.google.$3/: https://translate.google./ *
without (?:) redirect to https://$1.google.$3/: https://translate.google.com./

* In this case we don't really have group 3 because (?:) doesn't count as a group, to show the relationship clearer there is another test, add a group on \w{2,3}:

(redirect to https://$1.google.$3/)

^http://(translate)\.google\.((?:com?\.)?(\w{2,3})) https://translate.google.kh/
$1 is translate, $2 is com.kh, $3 is kh

^http://(translate)\.google\.((com?\.)?(\w{2,3})) https://translate.google.com./
$1 is translate, $2 is com.kh, $3 is 'com.', $4 is kh

@jeremyn
jeremyn merged commit cb03ac8 into EFForg:master Sep 30, 2016
@jeremyn

jeremyn commented Sep 30, 2016

Copy link
Copy Markdown
Contributor

All right, you've forced me to learn something, thanks. This StackOverflow Q&A is consistent with your results, which is that capturing groups are numbered from left to right in order of their opening parentheses. So, nested capturing groups will be $3, $4 etc which doesn't matter for us. Also it seems okay in a browser, and passes the tests.

Merged.

@jeremyn jeremyn removed their assignment Sep 30, 2016
@gloomy-ghost
gloomy-ghost deleted the gloomy-ghost-rm-translate_googleapis_com branch October 16, 2016 09:24
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants