         }
 
         let queryDictionary = newURL.monkeyking_queryDictionary
-        hideWebView(webView, tuples: (queryDictionary, nil, nil))
+        removeWebView(webView, tuples: (queryDictionary, nil, nil))
     }
 
     public func webView(webView: WKWebView, didReceiveServerRedirectForProvisionalNavigation navigation: WKNavigation!) {


        // Pocket OAuth
        if let errorString = error.userInfo["NSErrorFailingURLStringKey"] as? String where errorString.hasSuffix(":authorizationFinished") {
            hideWebView(webView, tuples: (nil, nil, nil))
        }
    }


            return
        }

        // WeChat OAuth
        if URL.absoluteString.hasPrefix("wx") {
            
            let queryDictionary = URL.monkeyking_queryDictionary
            guard let code = queryDictionary["code"] as? String else {
                return
            }
            
            MonkeyKing.fetchWeChatOAuthInfoByCode(code: code) { [weak self] (info, response, error) -> Void in
                self?.removeWebView(webView, tuples: (info, response, error))
            }
            
        } else {
            
            // Weibo OAuth
            for case let .Weibo(appID, appKey, redirectURL) in accountSet {
                if URL.absoluteString.lowercaseString.hasPrefix(redirectURL) {
                    
                    webView.stopLoading()
                    
                    guard let code = URL.monkeyking_queryDictionary["code"] as? String else {
                        return
                    }
                    
                    var accessTokenAPI = "https://api.weibo.com/oauth2/access_token?"
                    accessTokenAPI += "client_id=" + appID
                    accessTokenAPI += "&client_secret=" + appKey
                    accessTokenAPI += "&grant_type=authorization_code&"
                    accessTokenAPI += "redirect_uri=" + redirectURL
                    accessTokenAPI += "&code=" + code
                    
                    activityIndicatorViewAction(webView, stop: false)
                    
                    request(accessTokenAPI, method: .POST) { [weak self] (JSON, response, error) -> Void in
                        dispatch_async(dispatch_get_main_queue()) {
                            self?.removeWebView(webView, tuples: (JSON, response, error))
                        }
                    }
                }
            }
        }
        
    }
}

