-
Notifications
You must be signed in to change notification settings - Fork 128
Webview navigation history getter #72
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: nw22
Are you sure you want to change the base?
Conversation
65c8d20 to
482e210
Compare
| baseUrlForDataUrl, currentEntryIndex, entryCount, | ||
| processId, url, isTopLevel) { | ||
| processId, url, isTopLevel, pagesHistory) { | ||
| this.baseUrlForDataUrl = baseUrlForDataUrl; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This would send the whole history from browser to renderer process on every navigation, which could hurt performance. Is there any better way to do this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It’s true it is send with every navigation. But I consider it to be insignificant. After all it is just few strings. I guess it would be possible to make changes just in javascript code. Even without ‘pagesHistory’ you get ‘url’ and ‘currentEntryIndex’ from which you can create array of everything you need. But then all logic needs to be there. E.g. if you go back and then navigate to other page you should delete some record.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The history will grow longer and longer. So eventually the data will grow big enough to hurt performance. And there is a size limit of IPC message. Should find another way to do this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don’t know about limit for IPC message. But it will not grow longer and longer. For navigation history there is some limit. When you have about 30 or so items it will remove the oldest. Or at least it seems to be the case after quick test.
426fc70 to
f78c16a
Compare
da3929b to
b060cdf
Compare
f464f22 to
1884f31
Compare
|
Updated to current nw21. so it will not grow longer and longer. In some cases, even 50 entries could be quite big. But we never encountered any issue related to this. Regarding the performance, I don't think it is significant. Currently we send everything at once synchronously. This suit us well since we use it to show session history. We could send it one at a time asynchronously but I guess that would be even more performance demanding. Other way could be to restrict it more e.g. to last 10 entries. On the other hand, if use case would be to get just one entry at a time it seems to be Ok. |
9396d7f to
8adf1c9
Compare
f1e4ded to
4fd96a3
Compare
27692f7 to
f854061
Compare
Webview now has: -getPagesHistory function, returning array of URLs, titles and favicons of pages in history. Titles and favicons are not known for current page because array is created before page is fully loaded. -getCurrentHistoryIndex function, returning current history index
65748ff to
90fd209
Compare
Documentation (see for details):
nwjs/nw.js#5752
Our project:
https://groups.google.com/forum/#!topic/nwjs-general/TmZUq-JHIuQ