Skip to content

Commit d2dec0c

Browse files
author
Mike Perry
committed
Fix for link prefetching. Possible fix for weird wikipedia
bug. svn:r196
1 parent 844ee96 commit d2dec0c

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

src/chrome/content/code/HTTPS.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@ const HTTPS = {
2929
httpsRewrite: null,
3030

3131
forceChannel: function(channel) {
32+
if (channel.loadFlags & CI.nsIRequest.LOAD_BACKGROUND) {
33+
HTTPS.log(INFO, "Background request.. Forcing channel replacement.");
34+
return HTTPS.replaceChannel(channel);
35+
}
3236
return this.forceURI(channel.URI, function() { return HTTPS.replaceChannel(channel); });
3337
},
3438

src/components/https-everywhere.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -252,12 +252,13 @@ HTTPSEverywhere.prototype = {
252252
// to "should this load?", but also allow us to change the thing.
253253

254254
shouldLoad: function(aContentType, aContentLocation, aRequestOrigin, aContext, aMimeTypeGuess, aInternalCall) {
255+
if (aContentType == 11)
256+
this.log(DBUG, "shouldLoad: "+aContentLocation.spec);
255257
var unwrappedLocation = IOUtil.unwrapURL(aContentLocation);
256258
var scheme = unwrappedLocation.scheme;
257259
var isHTTP = /^https?$/.test(scheme); // s? -> either http or https
258-
//this.log(WARN, "should load " + unwrappedLocation.spec);
259260
if (isHTTP)
260-
HTTPS.forceURI(unwrappedLocation, null, aContext);
261+
HTTPS.forceURI(aContentLocation, null, aContext);
261262
return true;
262263
},
263264

0 commit comments

Comments
 (0)