Replies: 2 comments
-
is not specific to cromite, but I think you can use the Visual Viewport API
try css "position: fixed; bottom: 0"
this behaviour is also not specific to cromite |
Beta Was this translation helpful? Give feedback.
0 replies
-
Thank you, dear uazo, for confirming the non-specificity. Visual Viewport parameters were the solution for my problem. Note: the number of buttons are increasing, I aim to switch to more automated concept and include links in the content directly. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi, I'm working on a user script for mobile devices that involves displaying some real-time information about the zoom level, screen width, screen height, button size, and font size in a button at the bottom of the screen. All these for testing purposes due to zooming issues I ran into earlier.
Note: Originally, the script should display action buttons on text selection and the buttons shall stay at the same size and at the bottom of the screen regardless of the zoom level induced by pinching. Because I cannot hack the Cromite browser to extend its context menu on content selection, e.g., to detect phone numbers and offer to call or SMS, I dropped to display overlay buttons to the page.
Here's the key part of what I'm trying to accomplish:
Here’s a simplified version of the code I’ve been trying:
Issues:
window.outerWidth / window.innerWidth
to calculate the zoom level, but it doesn't seem to work consistently across devices.window.outerWidth
andwindow.innerWidth
are the best approach for detecting zoom on mobile browsers, especially when zooming is controlled by pinch gestures.Questions:
Thanks for any help or guidance!
Note: To some extend this script works on Firefox Ubuntu. Zoom is always 1, but screen is changing. With larger zooming, screen has lower dimensions and so the button width is lower. Additionally the button stays at the bottom if the visible screen. This does not happen in Cromite: the button gets off the visible viewport when pinching, such as Cromite, the page and the button does not know anything about the zooming in and zooming happens on the level of Android OS, my guess.
Beta Was this translation helpful? Give feedback.
All reactions