Javascript

QtWebEngine: Be careful when doing periodic WebChannel requests

Today I had to resolve a mysterious bug in a PyQt5 / QtWebEngine application. After the user unlocked his session, the application hangs for a while before resuming to normal activity. I've added an JavaScript interval that prints the current time once a second onto the console, but even through the timestamps were OK it seems that something had freezed the application while the screen was locked.

Introducing: Nested Scroll

Nested Scroll is a Javascript library that allows you to scroll selected elements into the viewport. You can define if the element should be aligned to the upper, lower, left or right boundary, or let Nested Scroll automatically decide depending on the shortest path.

Additionally, it is possible to define some animation methods, respect the element's border and margin and add extra margins on each side when scrolling.

But what makes this library unique compared to other libraries I've looked into is that it that it not only works with vertical but also with horizontal scrollbars, with nested scrollable DIVs and with fixed elements!

Logout from HTTP auth using Apache

Since there is no mechanism defined to log the user out of a HTTP authenticated session you have to use a workaround. Most browsers forget their login data once they received a 403 response. The problem is, that the user have to return to the normal starting page manually.

Update 2017-02-22: It seems that this technique doesn't work anymore in recent Firefox and Chrome browsers.