1

i'm trying to emulate the browser back button when clicking samsung smartTV remote control return button, my application is a web based application using angularjs framework.

when i executed this:

case tvKey.KEY_RETURN:
        alert("RETURN");
        widgetAPI.blockNavigation(event);
        console.log(window.history.length);
        break;

it gives "1" in the console log, and i couldn't go back to the previous page, does this means that the samsung smart tv does not store URLs in history? and is there any other way in going back to previous pages ?

2 Answers2

1

Samsung Browser does store the history and to Go back you actually have to use this code

 case tvKey.KEY_RETURN:
            alert("RETURN");
            widgetAPI.blockNavigation(event);
            window.history.back();
            break;

This will work fine until you reach the Ist page from where you started

abhi
  • 1,059
  • 9
  • 19
  • thank you, i was testing my app on the samsung emulator which doesn't support history.back() function but when i tested it on the real tv it worked – Clementine_Bash May 26 '15 at 09:29
0

If you want use "go back", you may fill and use own history array like this answer:

https://stackoverflow.com/a/18894897/2068612

Community
  • 1
  • 1
Ilya Zaytsev
  • 1,055
  • 1
  • 8
  • 12