Skip to content

Commit

Permalink
Update ! to ?
Browse files Browse the repository at this point in the history
  • Loading branch information
thehappydinoa authored Aug 24, 2018
1 parent e65b5a1 commit 69c039b
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions WebShell/Core/WSInjector.swift
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ import WebKit
UserDefaults.standard.setValue(value, forKey: newKey)
}

let getFromLocal: @convention(block)(NSString!) -> String = {(key: NSString!) in
let getFromLocal: @convention(block)(NSString?) -> String = {(key: NSString!) in
let host: String = (self.mainWebview.mainFrame.dataSource?.request.url?.host)!
if let LSvalue = key {
let newKey = "WSLS:\(host):\(LSvalue)"
Expand Down Expand Up @@ -123,12 +123,12 @@ import WebKit
jsContext.evaluateScript("var WSApp={};") ;

// _blank external
let openInBrowser: @convention(block)(NSString!) -> Void = {(url: NSString!) in
let openInBrowser: @convention(block)(NSString?) -> Void = {(url: NSString!) in
NSWorkspace.shared.open(URL(string: (url as String))!)
}

// _blank internal
let openNow: @convention(block)(NSString!) -> Void = {(url: NSString!) in
let openNow: @convention(block)(NSString?) -> Void = {(url: NSString!) in
self.loadUrl((url as String))
}
// _blank external
Expand All @@ -149,7 +149,7 @@ import WebKit
// Add Console.log (and console.error, and console.warn)
if settings.consoleSupport {
jsContext.evaluateScript("var console = {log: function () {var message = '';for (var i = 0; i < arguments.length; i++) {message += arguments[i] + ' '};console.print(message)},warn: function () {var message = '';for (var i = 0; i < arguments.length; i++) {message += arguments[i] + ' '};console.print(message)},error: function () {var message = '';for (var i = 0; i < arguments.length; i++){message += arguments[i] + ' '};console.print(message)}};")
let logFunction: @convention(block)(NSString!) -> Void = {(message: NSString!) in
let logFunction: @convention(block)(NSString?) -> Void = {(message: NSString!) in
print("JS: \(message)")
}
jsContext.objectForKeyedSubscript("console").setObject(unsafeBitCast(logFunction, to: AnyObject.self), forKeyedSubscript: "print" as (NSCopying & NSObjectProtocol)!)
Expand All @@ -167,7 +167,7 @@ import WebKit
jsContext.evaluateScript("window.navigator.getBattery = window.navigator.battery.getBattery;")

// navigator.vibrate
let vibrateNow: @convention(block)(NSString!) -> Void = {(data: NSString!) in
let vibrateNow: @convention(block)(NSString?) -> Void = {(data: NSString!) in
self.flashScreen(data)
}
jsContext.objectForKeyedSubscript("navigator").setObject(unsafeBitCast(vibrateNow, to: AnyObject.self), forKeyedSubscript: "vibrate" as (NSCopying & NSObjectProtocol)!)
Expand Down

0 comments on commit 69c039b

Please sign in to comment.