Skip to content

Commit 53d60d9

Browse files
committed
Added support for navigator.vibrate and partial navigator.battery and navigator.getBattery
1 parent fd8634a commit 53d60d9

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

WebShell/ViewController.swift

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ class ViewController: NSViewController, WebFrameLoadDelegate, WebUIDelegate {
223223
jsContext.objectForKeyedSubscript("app").setObject(unsafeBitCast(openNow, AnyObject.self), forKeyedSubscript:"openInternal")
224224

225225
// Add Battery!
226-
// Not fully working right now.
226+
// (Not fully working right now.)
227227
jsContext.evaluateScript("navigator.battery = {charging: true, chargingTime:0, dischargingTime:999, level:1, addEventListener:function(val, cal){}}")
228228
jsContext.evaluateScript("navigator.getBattery = function() { return {charging: true, chargingTime:0, dischargingTime:999, level:1, addEventListener:function(val, cal){}, then:function(call){return call(navigator.battery)}}}")
229229

@@ -276,7 +276,6 @@ class ViewController: NSViewController, WebFrameLoadDelegate, WebUIDelegate {
276276
if ((Int(data as String)) != nil || data.isEqualToString("undefined")) {
277277
AudioServicesPlaySystemSound(kSystemSoundID_FlashScreen);
278278
} else {
279-
// Flash multiple times..
280279
let time:NSArray = (data as String).componentsSeparatedByString(",")
281280
for(var i = 0; i < time.count; i++) {
282281
var timeAsInt = NSNumberFormatter().numberFromString(time[i] as! String)

0 commit comments

Comments
 (0)