Skip to content
This repository has been archived by the owner on May 5, 2019. It is now read-only.

JS alerts block all windows/tabs #251

Open
Ygrex opened this issue Apr 18, 2017 · 3 comments
Open

JS alerts block all windows/tabs #251

Ygrex opened this issue Apr 18, 2017 · 3 comments

Comments

@Ygrex
Copy link

Ygrex commented Apr 18, 2017

What I do:

  1. run luakit (it opens github.io by default)
  2. open a new tab (press 'T' followed by Return)
  3. spawn a new window (press 'W' followed by Return)
  4. invoke a JS alert (type ':javascript alert()' in the new window)
  5. go back to the first window and try to work there (all events are ignored)

What I expect:
only the tab where alert is invoked is blocked

@aidanholm
Copy link
Owner

The current behavior is identical to chromium, which prevents focusing a second window while an alert is open on the first. I seem to remember seeing articles about some websites relying on interaction being blocked in order to function correctly.

It seems possible, however, to implement custom UI for these alerts which may prevent blocking other windows/tabs. The obvious approach is to completely expose the WebKit API to Lua, which allows maximum flexibility, but also adds complexity; likely a lot of code would now have to check whether an alert is active, there's the possibility of multiple alerts on separate tabs, changes to the modes/binds infrastructure, etc. etc.

In general I'm not against accepting some risk of website breakage in exchange for increased user flexibility, especially when such websites are few and far between. I'll look for any articles on the design decisions behind interaction blocking and then see what I can do.

@aidanholm
Copy link
Owner

Firefox seems to implement per-tab blocking, and popups don't prevent closing the tab. We'll do that as well.

@aidanholm
Copy link
Owner

Upon closer inspection, it appears the relevant WebKitGTK signal script-dialog is designed to be connected to a handler that blocks the main loop while a GTK dialog is shown. This basically makes it useless, and prevents any modification of the window blocking behavior.

I'll leave this issue open, as it's possible that improved APIs will be available in the future.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants