[HTTPS-Everywhere] compatibility with other add-on

Justin Samuel justin at justinsamuel.com
Fri Apr 20 11:27:29 PDT 2012


> On Fri, Apr 20, 2012 at 01:39:16PM -0400, Loic J. Duros wrote:
>> I have read that to remedy to the issue of incompatibility,
>> https-everywhere has set up a custom notification
>> "https-everywhere-uri-rewrite". Do you have any concrete examples on
>> how this works, or do you know any extension or add-on that make use
>> of this and have achieved compatibility with https-everywhere?

Hi Loic,

Here's how RequestPolicy uses this notification.

First, RequestPolicy registers to observe the
"https-everywhere-uri-rewrite" topic:

https://github.com/RequestPolicy/requestpolicy/blob/master/src/components/requestpolicyService.js#L499

Once registered to observe this topic, here is where RequestPolicy
receives notifications:

https://github.com/RequestPolicy/requestpolicy/blob/master/src/components/requestpolicyService.js#L1619

that in turn calls here which just stores the old and new URIs for later usage:

https://github.com/RequestPolicy/requestpolicy/blob/master/src/components/requestpolicyService.js#L1581

the stored old and new URIs are used by RequestPolicy in its
implementation of nsIContentPolicy::shouldLoad(). When RequestPolicy
is checking whether there are rules which match the request, if it
doesn't find any rules it checks whether the destination URI has been
mapped to an https URI. If there is a URI mapping, it calls
shouldLoad() again with the new (https) destination. This check is
done here:

https://github.com/RequestPolicy/requestpolicy/blob/master/src/components/requestpolicyService.js#L2218

This approach has made RequestPolicy and HTTPS Everywhere work
together in many cases but there are still problems that I haven't had
time to investigate (e.g.
https://github.com/RequestPolicy/requestpolicy/issues/292).

Justin




More information about the HTTPS-everywhere mailing list