     }
 
     override class func canonicalRequestForRequest(request: NSURLRequest) -> NSURLRequest {
-
         if (TrackingProtection.singleton.shouldBlock(request) || AdBlocker.singleton.shouldBlock(request)) {
             let newRequest = cloneRequest(request)
             // the minimum I can return without a crash is this url. NSURL() or NSURL("") will crash.

        if let url = request.URL, redirectedUrl = HttpsEverywhere.singleton.tryRedirectingUrl(url) {
            let newRequest = cloneRequest(request)
            newRequest.URL = redirectedUrl
            return newRequest
        }
        return request

        self.mutableData = NSMutableData()
    }

    func connection(connection: NSURLConnection, willSendRequest request: NSURLRequest, redirectResponse response: NSURLResponse?) -> NSURLRequest?
    {
        if let response = response {
            client?.URLProtocol(self, wasRedirectedToRequest: request, redirectResponse: response)
        }
        return request
    }

    func connection(connection: NSURLConnection!, didReceiveData data: NSData!) {
        self.client!.URLProtocol(self, didLoadData: data)
        self.mutableData.appendData(data)
