This is used to update the titlebar according to the contentWindow title (and when the contentWindow title changes):
Code:
kindle.chrome.onContentTitleChanged = function (title) {
kindle.chrome.setTitleBar('', title);
}
And this is used to take control on the searchbar buttons (store, back and menu). As described before, we can use those buttons to trigger any function but we need first to take control on them (i.e setting the button to "notifyApp").
We can also disable buttons (they become grayed).
Code:
function setupSearchBar(){
var json = {
"appId": "YOUR APP ID HERE",
"searchBar": {
"clientParams": {
"profile": {
"name": "default",
"buttons": [
{
"id": "menu",
"state": "enabled",
"handling":"notifyApp"
},
{
"id": "back",
"state": "disabled",
"handling":"notifyApp" },
{
"id": "store",
"state": "enabled",
"handling":"system"
}
]
}
}
}
};
kindle.messaging.sendMessage('com.lab126.pillow', 'configureChrome', json);
}
"State" could be enabled or disabled, "handling" could be notifyApp or system.