 
 class WebViewController: NSViewController, WKNavigationDelegate {
     
+    // MARK: Properties
+    private var uneditedURL:String = ""
+    private func clear() {
+        loadURL(NSURL(string: "https://cdn.rawgit.com/JadenGeller/Helium/master/helium_start.html")!)
+    }
+    
+    private var webView = WKWebView()
+    
+    private var shouldRedirect: Bool {
+        get {
+            return !NSUserDefaults.standardUserDefaults().boolForKey(UserSetting.DisabledMagicURLs.userDefaultsKey)
+        }
+    }
+    
+    
+    // MARK: View lifecycle
     override func viewDidLoad() {
         super.viewDidLoad()
         view.addTrackingRect(view.bounds, owner: self, userData: nil, assumeInside: false)

        clear()
    }
    
    override func validateMenuItem(menuItem: NSMenuItem) -> Bool{
        switch menuItem.title {
        case "Back":

            modified = modified.replacePrefix("http://v.youku.com/v_show/id_", replacement: "http://player.youku.com/embed/")
            modified = modified.replacePrefix("http://www.twitch.tv/", replacement: "http://player.twitch.tv?&channel=")
            
            if self.uneditedURL.containsString("https://youtu.be") {
                if urlString.containsString("?t=") {
                    modified = "https://youtube.com/embed/" + getVideoHash(urlString) + makeCustomStartTimeURL(urlString)
                }
            }
            
            if urlString != modified {
                decisionHandler(WKNavigationActionPolicy.Cancel)
                loadURL(NSURL(string: modified)!)
