Quicksaver / AutoPager

7 stars 6 forks source link

Update splitbrowse.js #3

Closed alexolog closed 10 years ago

alexolog commented 10 years ago

Squashed another error

Quicksaver commented 10 years ago

What exactly does this do? (I'm not very familiar with the history interfaces), It seems to me like the objective is to create a new nsISHEntry for every "child" entry in aEntry, and place it into a new nsISHContainer. But like this it'll return the nsISHContainer at the end, instead of the initial nsISHEntry from before. Is this what's supposed to happen?

alexolog commented 10 years ago

It just uses a different interface of the same object.

Actually, the docs say that you don't need the assignment, so: newEntry = newEntry.QueryInterface(Components.interfaces.nsISHContainer); can be changed to just: newEntry.QueryInterface(Components.interfaces.nsISHContainer); (and so on for other QueryInterface calls)

See https://developer.mozilla.org/en-US/docs/XUL/Tutorial/XPCOM_Interfaces http://mozilla.6506.n7.nabble.com/what-does-QueryInterface-do-in-Javascript-td260597.html

There may be a better way of doing it.