-
Notifications
You must be signed in to change notification settings - Fork 82
The matrix scope
A matrix scope tells HTTPSB which set of rules to use when visiting a particular web page. There are three levels of scope in HTTPSB:
- Global scope -- identified as
*(this scope is always present)- All rules in the global scope apply to all web pages for which no narrower scope exists.
- Domain-level scope (example above:
http://*.arstechnica.com)- Rules in a domain-level scope apply only to web pages which URL match the domain of the page.
- Site-level scope (example:
http://arstechnica.com)- Rules in a site-level scope apply only to web pages which URL match the hostname of the page.
Out of the box, there are two scopes in HTTPSB: the global scope (*), and the behind-the-scene scope (http://chromium-behind-the-scene).
For any web page you visit, you can create a narrower scope for that web page, or use the default global scope.
Just to avoid any confusion in the context of this doc, "domain name" is different than "site name". For example, example.com is a domain name, whereas www.example.com and forums.example.com are site names.
The global scope is identified with the ∗ glyph.
Rules in global scope will apply to any web site, except where a narrower scope exists for that site.
Rules in domain-level scope will apply only to web sites which domain matches the domain of the scope.
Domain-level scopes are narrower than global scope, but broader than site-level scopes. Rules in a domain-level scope will apply only to all websites matching the domain name of the scope.
For example, all rules in domain-level scope http://∗.example.com will apply to http://www.example.com, http://forums.example.com`, http://where.am.i.example.com, etc.
Rules in domain-level scope will apply only to web sites which hostname matches exactly the hostname of the scope.
Site-level scopes are the most narrow of all level of scopes. Rules in a site-level scope will apply only to one single web site.
For example, all rules in domain-level scope http://∗.example.com will apply to http://www.example.com, http://forums.example.com`, http://where.am.i.example.com, etc.
There is a scope precedence in HTTPSB. If one scope doesn't exist, a scope with lower precedence is then tried, until global scope is reached.
If one visits https://www.example.com, the precedence is:
https://www.example.com
http://www.example.com
https://*.example.com
http://*.example.com
*
If one visit http://www.example.com:
http://www.example.com
http://*.example.com
*
The scope precedence above is based on the premise that a user will typically have more restrictive rules for an unencrypted connection than its encrypted counterpart. Thus it is ok to have more restrictive rules being used for an encrypted connection, but not ok to have less restrictive rules being used for an unencrypted connection.
