Skip to content

Commit

Permalink
Enables contextmenu again / Fixes #51 & #50
Browse files Browse the repository at this point in the history
  • Loading branch information
0xWDG committed Mar 31, 2016
1 parent 20b2f46 commit 17d69d5
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion WebShell/WebShellDebug.swift
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,15 @@ extension ViewController {

// Edit contextmenu...
func webView(sender: WebView!, contextMenuItemsForElement element: [NSObject : AnyObject]!, defaultMenuItems: [AnyObject]!) -> [AnyObject]! {
var NewMenu:[AnyObject] = [AnyObject]()

// @wdg Fix contextmenu (problem with the swift 2 update #50)
// Issue: #51
var NewMenu:[AnyObject]
if (SETTINGS["debugmode"] as! Bool) {
NewMenu = defaultMenuItems // Enable webinspector etc
} else {
NewMenu = [AnyObject]()
}

// Add debug menu. (if enabled)
if (SETTINGS["debugmode"] as! Bool) {
Expand Down

0 comments on commit 17d69d5

Please sign in to comment.