Question
I have a remote web application for Tizen TV that is redirected from config.xml to a remote URL instead of using index.html. As a result, I cannot access the Tizen object in the window to exit the application using tizen.application.getCurrentApplication().exit().
How can I exit from the remote web application using JavaScript?
Answer
Problem Understanding
When developing a remote web application for Tizen TV that loads content from an external URL (configured in config.xml), you lose direct access to the Tizen object in the window context. This prevents you from using the standard tizen.application.getCurrentApplication().exit() method to close the application.
Solution Methods
-
Basic Window Close Method:
- Try using
window.close() - Note: This works on older Tizen TV models but may not work on 2016+ models (e.g., UE55KS8500)
- Try using
-
Self-Reference Window Close Method:
- Create a self-reference to the window and then close it:
function closeApp() { var appWin = window.open("", "_self"); appWin.close(); }
Code Examples
// Method 1: Simple window close
window.close();
// Method 2: Self-reference window close
function closeApp() {
var appWin = window.open("", "_self");
appWin.close();
}
Additional Tips
- The effectiveness of these methods may vary depending on the Tizen TV model and version
- For newer Tizen TV models, consider implementing a custom communication channel between your remote web application and the Tizen host application
- Always test your solution on the target device models