url in window title
Is it possible to have more control about what is shown in the window title, for example it would be useful to have the url of the current page in there so that keepass auto-type works better.
@JJK96 I've already thought about something like this to allow the user to configure seomthing like the set statusline in vim. How does the keepass auto-type work? And how does it communicate with vimb?
Keepass looks at the title of a window (any window, not specifically vimb) and compares that to the data you have stored with the key. So for example if the title contains the word github it will enter your github password.
Now, some websites dont have a very descriptive title, something like "Log in", for those websites it would be useful to have the url in the title so that keepass can also compare that.
Sounds interesting! At the time you could change the title by hand (:e! document.title="The new title"), until we have a generic solution, so that the keepass can pick this up. I know that this is more a workaround, but with some key binding this is done really fast.
thanks for the hint, I have found another solution, I placed
document.title+=' '+document.URL
in scripts.js, which does exactly what I suggested.
edit: I just noticed that this does not work for when I open a page through a link. Is that intended behaviour?
Oh, this is even better. If you have vimb compiles with autocmd support, following should help you to do this automatically.
augroup titlechange
autocmd LoadFinished * e! document.title+=' '+document.URL;
augroup end
I think id does not work properly in scripts.js, because it's not ensured that the dom is available at the time the script is executed. But you might observe the dom:loaded event.
That works even better indeed, I changd LoadFinished to LoadCommitted however
If LoadCommitted work, fine. But the LoadCommited might be fired before the DOM and the title are available.
I noticed that indeed it did not go correctly for every website.
Thank you for your support, I think that this fixes my problem and any other problem where the title has to be edited.