Skip to content

Commit f096a8b

Browse files
author
Jeremy White
committed
Added close support to webOS platform
1 parent b6e7917 commit f096a8b

File tree

4 files changed

+44
-2
lines changed

4 files changed

+44
-2
lines changed

dist/connect_bridge.js

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -289,6 +289,10 @@ var connectsdk = (function () {
289289
this.handleMediaCommand(msgData);
290290
break;
291291

292+
case "connectsdk.serviceCommand":
293+
this.handleServiceCommand(msgData);
294+
break;
295+
292296
default:
293297
this.emit(ConnectManager.EventType.MESSAGE, msgData);
294298
}
@@ -322,6 +326,23 @@ var connectsdk = (function () {
322326
}
323327
},
324328

329+
handleServiceCommand: function (msgData) {
330+
var serviceCommand = msgData.message.serviceCommand;
331+
if (!serviceCommand) {
332+
return;
333+
}
334+
335+
var commandType = serviceCommand.type;
336+
console.log('processing serviceCommand ' + JSON.stringify(serviceCommand) + ' of type ' + commandType);
337+
338+
switch (commandType) {
339+
case "close":
340+
// this is a hack to circumvent the fact that window.close() doesn't work with the webOS app type
341+
window.open(window.location, '_self').close();
342+
break;
343+
}
344+
},
345+
325346
handleDisplayImage: function (msgData) {
326347
var from = msgData.from;
327348
var mediaCommand = msgData.message.mediaCommand;

0 commit comments

Comments
 (0)