Open myrdd opened 8 years ago
A case where the proposed new behavior of scheme = undefined
is counterintuitive: When viewing an image directly (e.g. https://github.com/favicon.ico), allowing “all requests from .github.com” won't allow the `resource://gre/` requests (see screenshot 2). In contrast, allowing “all requests to resource://gre” would work.
In this issue I'd like to present the rule semantics, and open them for discussion. This specification does not yet represent RP's current behavior, but it will be implemented. Still, I'd like to hear your comments.
TL;DR: Take a look at screenshots 1 and 2 below.
Below you'll see two tables: the first one is a reduced version of the second one.
The reduced table:
undefined
"*"
ornone
null
""
"*"
null
, the port is ignored.about:blank
– “blank” is the URI's path.file:///
"*"
) will match any string, including empty strings (e.g.file:///
), but will not matchnull
hosts (e.g.about:
).The more complete table:
undefined
"*"
) or no host (none
)null
""
"*"
undefined
.Notes
Each rule has a site specification for the origin and another one for the destination. If any of the fields (scheme, host, port, etc.) is unspecified, its value is
undefined
. Let's talk about someundefined
fields.scheme = undefined
If the scheme of a site specification is
undefined
, the specification will only match URIs with HTTP, HTTPS and FTP schemes. Those are the most typical protocols/schemes, so the user usually doesn't see this behavior.The behavior of
scheme = undefined
separates common internet protocols from other schemes such asfile
,about
,chrome
andresource
. For instance, requests fromhttp://gre/
toresource://gre/
are blocked, even if a rule allowinggre -> gre
exists.port = undefined
Similarly, if the port is
undefined
, the site specification will only apply to URIs with a default port. Since the mayor part of websites uses the default port, this shouldn't affect many users.Non-default ports are often used by applications installed on the local computer or the local network. Since
port = undefined
means default port, more fine-grained control is possible – even in base domain and full domain strictness (see #474).Conclusions
Conclusions for the menu
The menu translates any URI of a tab into a shorter string. For example,
https://www.example.com/foo
will become*.example.com
in base-domain strictness. If any of those URIs has a non-default port, the menu will also show that port number. For instance,http://www.example.com:8080/
will become*.example.com:8080
in base-domain strictness. Consequently, the menu will also allow to add/remove such rules (issue #473). Screenshot 1 below shows how the menu will look like.If an URI has a non-internet scheme/protocol, base-domain and full-domain strictness will fall back to full-address strictness for that URI. An example is shown in screenshot 2 below. In the screenshot, RP is configured for full-domain strictness, and the
resource://gre/*
URIs are displayed full-address.Conclusions for the "Your Policy" page
The Your Policy settings page contains a list of all active rules. Screenshot 3 (below) shows how the list currently looks like. For origin-only rules, the destination field is empty; vice versa for dest-only rules. While it is correct that “nothing has been specified”, an empty origin/dest cell hides the details implied by above rule semantics.
@nodiscc has suggested (#560) to display a wildcard (
*
) instead of an empty field. I like that idea, so I think I'll implement it.[Explanation] If you've read this post carefully you might think displaying
*
is not fully accurate: If the host isundefined
, it allows both*
andnone
. But at the same time, the scheme isundefined
, meaning only http(s) and ftp are allowed, meaning there is always a host. So IMHO displaying*
is accurate enough.Screenshots
Screenshot 1: if the port is non-default, it will be displayed in the menu
Screenshot 2: the menu shows
resource://gre
(full-address), while actually base-domain strictness is configuredScreenshot 3: current display of “active rules”