Finding the coordinates of the browser alerts

98 views
Skip to first unread message

Rajapriya Radhakrishnan

unread,
May 24, 2022, 9:06:16 PM5/24/22
to Chromium-dev, chromi...@chromium.org
Hi Team,

I'm Rajapriya Radhakrishnan and have some queries specific to browser alerts. As I'm novice in the web browser development, I'm unsure I have reported my query to relevant group of chrome. If it is not, please guide me where exactly I need to raise my query.

The scenario is, I'm working on a project where the browser is controlled remotely as the remote machine is not an user-interactable one.
In the host side, I can find out the browser coordinates where user is touched and what action (such as tap, double tap) is done. Then the coordinates and the action details will be forwarded to remote browser.
On the remote side, will receive those info  first and use the pointer events to control the browser according to the received data.

NOTE: Please take a look at the attached file - browser_confirm_dialog_box.png.

Queries are,
1. How to know if there is an alert in the browser page.
2. As the height of the alert is set dynamically w.r.t. the description length, I need to find out the dimension and origin points of the alerts. How can I get the origin points (x, y) and dimension(width and height) of an alert?

Could you please check and help me out on this. If you need any information, please let me know.


Best Regards,
Rajapriya R.
browser_confirm_dialog_box.png

K. Moon

unread,
May 25, 2022, 12:19:51 AM5/25/22
to rajapr...@gmail.com, Chromium-dev
It sounds like your goals might be better accomplished using the Playwright or Puppeteer libraries, which are designed for browser automation.

--
--
Chromium Developers mailing list: chromi...@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-dev
---
You received this message because you are subscribed to the Google Groups "Chromium-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-dev...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-dev/ad67134c-6f51-4426-b70e-6a6dc4317664n%40chromium.org.

Bang He

unread,
May 26, 2022, 7:40:29 PM5/26/22
to Chromium-dev, km...@chromium.org, Chromium-dev, rajapr...@gmail.com
do you want to acomplish some things like remote desktop?

Rajapriya Radhakrishnan

unread,
May 26, 2022, 7:41:01 PM5/26/22
to Chromium-dev, km...@chromium.org, Chromium-dev, Rajapriya Radhakrishnan
The browser is rendered on a touchscreen display (using HDMI/DVI outputs of system), that touchscreen controls the browser and sends the interaction data over network to system hosting browser. This interaction data is then send to browser by a module in the system. We can not use input drivers because there could be multiple browser sessions opened for multiple users using different touchscreens.

Rajapriya Radhakrishnan

unread,
Jun 3, 2022, 6:39:12 PM6/3/22
to Chromium-dev, km...@chromium.org, Chromium-dev
Hi Team,

Please take a look at the attached images for
1. the overview of the use case with alert action (overview_of_the_use_case_with_alert_action.png)
2. the detailed view of the client system with two users (detailed_view_of_the_client_system_with_two_users.png)

The scenario is, I'm working on a project where the browser is controlled remotely as the remote machine is not an user-interactable one, it is for viewing purposes only.

Overview
1. (Client system) User#1 is supposed to do any one of the below actions in order to interact with the Browser#1.

    - Tap
    - Double Tap
    - Scroll Up/Down and Right/Left
    - Pinch-Zoom in/out
   
2. (Host system) In parallel with User#1, User#2 wants to view the same page (which is currently displayed on the Browser#1) in the Browser#2 without interacting with it. This Browser#2 screen is for viewing purposes only.

So the goal here is, we need to bring the same page content in Browser#2 although there is no user interaction in it.

Solution
1. First, the client application will capture the touch coordinates and action type once the user is done with their action on the browser touch screen.
2. Then this info will be sent to the host application network.
3. The host application will receive the data, form the web driver commands and send it to the browser.

Now I have to handle the user prompts - alert, prompt, confirm. I need a way of getting coordinates of alerts since we cant use the window coordinates directly inside the alert (If I'm wrong here, please correct me). I have to either accept/dismiss the alert using the received coordinates (Please note, the host application is unaware of the buttons the received coordinates point to, so I couldn't make use of accept() and dismiss() methods directly)

If any point is not clear/correct, please let me know.


Regards,
Rajapriya
detailed_view_of_the_client_system_with_two_users.png
overview_of_the_use_case_with_alert_action.png

Bang He

unread,
Jun 13, 2022, 9:18:53 PM6/13/22
to Chromium-dev, rajapr...@gmail.com, km...@chromium.org, Chromium-dev
it feels weird. how to push mouse event to browser in the host machine after the host machine have received  mouse event from touch screen device?
Reply all
Reply to author
Forward
0 new messages