Friday, September 2, 2011

Advanced Browser - Fixing Tabs

One last tweak (fix) for Advanced Browser. There's a bug where when closing a tab, another one would not always be automatically selected.

Really hope the developer releases a general bug fix update soon....until then, here's my fix:

1. Open /media/cryptofs/apps/usr/palm/applications/com.maklesoft.browser/source/BrowserApp.js
2. Find the closeTab function, and replace it's contents with the following (inside the curly brackets for non-coders):

var browserIndex = sender.parent.value;

var currentIndex = this.$.tabs.getValue();

if (this.$.tabs.getControls().length > 2) {

this.$["tab" + browserIndex].destroy();

this.$["browser" + browserIndex].destroy();

if (browserIndex == currentIndex) {

//start by looking left

for (var i = currentIndex-1; i > -1; i--) {

if (this.$["tab" + (i)]) {

this.$.tabs.setValue(i);

this.tabChanged(this.$.tabs);

return true;

}

}

//then look right if not found

for (var i = currentIndex+1; i < this.tabCount+1; i++) {

if (this.$["tab" + (i)]) {

this.$.tabs.setValue(i);

this.tabChanged(this.$.tabs);

return true;

}

}

}

}

return true;


3. Reboot tablet
4. Done

2 comments:

  1. To save possible error (for non-coders) could you post the edited version in a zipped file for a file replacement please?

    Know I haven't coded since college and there three locations on closeTab with { }.

    When we coded we used programs similar to NotePad2 that had line numbers. Then you could point to the issue and line number ## through ## to edit.
    Sure a lot better to have addresses and line numbers rather than Search & Replace.

    ReplyDelete
  2. NotePad2 can be downloaded from Flo's Freeware
    http://www.flos-freeware.ch/notepad2.html

    ReplyDelete