Skip to content
This repository was archived by the owner on Nov 6, 2023. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
75 changes: 29 additions & 46 deletions src/chrome/content/rules/GoogleMaps.xml
Original file line number Diff line number Diff line change
@@ -1,38 +1,39 @@
<!--
For other Google coverage, see GoogleServices.xml.

-->
<ruleset name="Google Maps">

<target host="maps.google.*" />
<!--
https://trac.torproject.org/projects/tor/ticket/8627
-->
<exclusion pattern="^http://maps\.google\.com/local_url" />
<test url="http://maps.google.com/local_url" />
<exclusion pattern="^http://maps\.google\.gr/transitathens" />
<test url="http://maps.google.gr/transitathens" />
<test url="http://maps.google.ca/" />
<test url="http://maps.google.com/" />

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add at least 3 for each wildcard.

<test url="http://maps.google.fr/" />
<target host="maps.google.co.*" />
<test url="http://maps.google.co.kr/" />
<test url="http://maps.google.co.nz/" />
<test url="http://maps.google.co.uk/" />
<target host="maps.google.com.*" />
<test url="http://maps.google.com.au/" />
<test url="http://maps.google.com.br/" />
<test url="http://maps.google.com.hk/" />
<target host="maps-api-ssl.google.com" />
<test url="http://maps-api-ssl.google.com/maps/api/js?sensor=false" />

<target host="maps.googleapis.com" />

<target host="maps.gstatic.com" />

<target host="khms.google.com" />
<target host="khms0.google.com" />
<test url="http://khms0.google.com/kh/v=157&amp;src=app&amp;x=5&amp;y=0&amp;z=3" />
<!-- test url 404s but I couldn't find any that still worked -->
<target host="khms1.google.com" />
<test url="http://khms1.google.com/kh/v=157&amp;src=app&amp;x=5&amp;y=0&amp;z=3" />
<!-- test url 404s but I couldn't find any that still worked -->
<target host="khms2.google.com" />
<target host="khms3.google.com" />
<target host="maps-api-ssl.google.com" />
<!-- This domain doesn't host anything at the root, and will give a 404 if
you fetch / vis HTTPS. However, there are resources elsewhere on the
domain that can be rewritten. We exclude the root so
https-everywhere-checker doesn't generate an error based on the implicit
test URL for the domain. -->
<exclusion pattern="^http://maps-api-ssl\.google\.com/$" />
<test url="http://maps-api-ssl.google.com/maps/api/js?sensor=false" />

<target host="mw2.google.com" />
<target host="maps.google.com.*" />
<target host="maps.googleapis.com" />
<!--
https://mail1.eff.org/pipermail/https-everywhere-rules/2012-September/001317.html
These now 404
<exclusion pattern="^http://maps\.googleapis\.com/mapfiles/lib/map_\d+_\d+\.swf" />
<test url="http://maps.googleapis.com/mapfiles/lib/map_1_20.swf" />
<exclusion pattern="^http://maps\.googleapis\.com/mapsapi/publicapi\?file=flashapi" />
<test url="http://maps.googleapis.com/mapsapi/publicapi?file=flashapi" />
-->
<target host="maps.gstatic.com" />


<!--securecookie host="^maps\.google\.(com?\.)?(au|ca|gh|ie|in|jm|ke|lk|my|n[agz]|pk|rw|sl|sg|ug|uk|za|zw)$" name=".+" /-->
Expand All @@ -41,12 +42,6 @@
<securecookie host="^maps-api-ssl\.google\.com$" name=".+" />


<rule from="^http://maps\.google\.((?:com?\.)?\w{2,3})/"
to="https://maps.google.$1/" />
<test url="http://maps.google.ca/" />
<test url="http://maps.google.com/" />
<test url="http://maps.google.com.au/" />

<!-- https://khms1.google.com/ 404s but http://khms1.google.com/ does not.
-->
<rule from="^http://khms\d?\.google\.com/+\??$"
Expand All @@ -56,19 +51,7 @@
Covering the root only /,//,/? etc
Whereas the below rule covers the rest /foo for example
-->
<rule from="^http:"
to="https:" />

<rule from="^http://(khms\d?|maps-api-ssl|mw2)\.google\.com/"
to="https://$1.google.com/" />
<test url="http://khms0.google.com/kh/v=157&amp;src=app&amp;x=5&amp;y=0&amp;z=3" />
<test url="http://khms1.google.com/kh/v=157&amp;src=app&amp;x=5&amp;y=0&amp;z=3" />
<!-- test url 404s but I couldn't find any that still worked -->

<rule from="^http://maps\.googleapis\.com/"
to="https://maps.googleapis.com/" />

<rule from="^http://maps\.gstatic\.com/"
to="https://maps.gstatic.com/" />
<!-- covered in exclusion rule, there should be no need to downgrade -->
<!--rule from="^https://maps\.googleapis\.com/map(?=files/lib/map_\d+_\d+\.swf|sapi/publicapi\?file=flashapi)"
to="http://maps.googleapis.com/map" downgrade="1" /-->
</ruleset>