Replies: 3 comments 10 replies
-
Can you please clarify what you mean by force the hover media query?
What does your code look like? |
Beta Was this translation helpful? Give feedback.
-
The CSS media query hover @media (hover: hover) basically says is the browser cable of hovering. If it is show x. Without a mouse connected this is set to none. Using SendMouseMoveEvent method doesn't trigger the CSS, from what I can see as this is CSS this is used by the browser before any mouse events. I am using this to create PDF's and screenshots. I guess none of the client.CSS methods would be of any use? I have looked through them but can't find anything obvious. |
Beta Was this translation helpful? Give feedback.
-
Not quite. That CSS will make the background red in a browser that supports hover. So if you view it in a normal browser it will work. However if you run it from a server without a mouse connected, so not via RDP, it won't work. Another way of testing this is to run a simple windows service calling one of the examples exes that create a screenshot on the above code. As this is running in isolation mode, i.e session 0 it won't have access to the mouse on your PC and therefore the above code doesn't work. From what I have managed to find out this is a chrome thing media queries uses MediaValues::CalculateAvailableHoverTypes() which calls in ui::GetAvailableHoverTypes(), which calls IsMouseOrTouchpadPresent(), which calls DeviceDataManager::GetTouchpadDevices() and checks for presence of an active touchpad or a mouse. Which was why I thought there might be a way to set hover media query with emulation. But maybe there isn't. |
Beta Was this translation helpful? Give feedback.
-
Is there anyway to force cefsharp to force the hover media query?
I have been trying to set it using the devtools but I think I may have missed something.
Beta Was this translation helpful? Give feedback.
All reactions