3 ms·
One feature I look for in any webview is the ability to make parts of the UI transparent while still allowing mouse events over transparent pixels to seamlessly
by aragonite 2y ago
One feature I look for in any webview is the ability to make parts of the UI transparent while still allowing mouse events over transparent pixels to seamlessly fall through to the window below while those events (not just clicking but hovering) over non-transparent pixels be intercepted as usual.
IMO the old ActiceX IE browser control had an exceptionally good (most performant
and natural) implementation of this feature. Unfortunately replicating it in chromium based webviews appears to be a lot trickier.
- peter_l_downs 2y agoAs someone who doesn't use webviews, why is this such a necessary feature?
- afavour 2y agoI imagine the OP is layering views on top of each other and wants them to all respond to clicks. I could imagine a sticky “please log in” banner at the top of a view, something like that.
- aragonite 2y agoI wouldn't say it's a necessary feature, but it's particularly important for frameless & partially transparent apps with irregularly shaped UI components that interact with the mouse (see example here [1]; need to click the play button). Having an invisible rectangle around the component where mouse clicks mysteriously disappear can feel inelegant. This feature is also especially important for my own use case where I'm trying to make an app where the UI is essentially a "frame" around the screen, rather than a traditional window. It's much easier (& surprisingly efficient via the IE browser control) to simply use a single webview the size of the entire screen, render in the border regions and let mouse events fall through the transparent pixels. [1] https://github.com/electron/electron/issues/1335#issuecomment-1627768438 https://github.com/electron/electron/issues/1335#issuecommen... Edit: fixed the link
- peter_l_downs 2y agoMakes sense, thank you! EDIT: degenerate example, but still a good explanation.
- jefftk 2y agoThat seems pretty easy to abuse for click jacking?
- aragonite 2y agoI hadn't thought of that! Possibly. I wasn't thinking of the use case of loading external websites in webviews.