Closed Bug 1535102 Opened 6 months ago Closed 4 months ago

Implement Page.bringToFront

Categories

(Remote Protocol :: Page, enhancement, P1)

enhancement

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: aslushnikov, Assigned: jdescottes)

References

(Blocks 3 open bugs)

Details

Attachments

(2 files, 2 obsolete files)

User Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.75 Safari/537.36

Steps to reproduce:

CDP's Page.bringToFront is supposed to select tab and bring browser window in front of other applications in OS.

How do we do this in Gecko?

Blocks: puppeteer
Status: UNCONFIRMED → NEW
Ever confirmed: true
Priority: -- → P3

tabBrowser.selectedTab = newTab and ChromeWindow#focus() seems
to work for me when I test this in the Browser Toolbox.

This is incidentally the same technique we use in Marionette.

I wonder how hard it would be to implement this method!

Assignee: nobody → ato
Status: NEW → ASSIGNED
Type: defect → enhancement
Priority: P3 → P1

Although unrelated to this bug, I have a question about how Puppeteer
deals with browsing context focus.

When “a page” is in the background, can you still interact with it
in Chrome? I.e. is it possible to click and type things into a
page living in an application window in the background?

Flags: needinfo?(aslushnikov)
Depends on: 1546722

We can reconstruct the CDP error and print a better error message
using RemoteAgentError. This is better than the current output,
which in a lot of cases will be "CDP Exception: [object Object]".

A possible future improvement to this involves extending the CDP
protocol to send the individual components of the error individually,
so that we don't have to parse the string.

Attachment #9060474 - Attachment is obsolete: true
Priority: P1 → P2
Flags: needinfo?(aslushnikov)
Whiteboard: [method=Page.bringToFront]
Summary: Page.bringToFront → Implement Page.bringToFront
Whiteboard: [method=Page.bringToFront]

Depends on D32538.
Not mandatory, but we have some duplicated code shared by several mochitests, maybe we could have a shared helper?

Assignee: ato → jdescottes
Priority: P2 → P1
Pushed by jdescottes@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/e2fbe8d063e0
Implement Page.bringToFront and introduce parent Page domain r=ato
https://hg.mozilla.org/integration/autoland/rev/4cf5a00f2fdc
Extract shared helper to setup remote CDP mochitests r=ato
Status: ASSIGNED → RESOLVED
Closed: 4 months ago
Resolution: --- → FIXED
Attachment #9066355 - Attachment is obsolete: true
You need to log in before you can comment on or make changes to this bug.